com.atlassian.jira.help.HelpUrlsParser |
Known Indirect Subclasses |
@Internal
or @PublicApi
.
A parser that a creates HelpUrls
from name-value pairs.
Consider the following properties file:
url-prefix=https:///DOCS/docs-${docs.version}/ url-prefix.ondemand=https://CAC/display/AOD/ jira101.url=JIRA+101 jira101.url.ondemand=JIRA+OnDemand jira101.title=JIRA 101 jira101.title.ondemand=JIRA OnDemand default.url = Index default.title = JIRA HelpIt OnDemand it produces a
HelpUrls
where:
urls.getDefault() == HelpUrl{url: https://CAC/display/AOD/Index, title: "JIRA Help"
}urls.get(default) == HelpUrl{url: https://CAC/display/AOD/Index, title: "JIRA Help"
}urls.get(jira101) == HelpUrl{url: https://CAC/display/AOD/JIRA+OnDemand, title: "JIRA OnDemand"
}urls.get(anyOtherKey) == HelpUrl{url: https://CAC/display/AOD/Index, title: "JIRA Help"
}urls.getDefault() == HelpUrl{url: https:///DOCS/docs-062/Index, title: "JIRA Help"
}urls.get(default) == HelpUrl{url: https:///DOCS/docs-062/Index, title: "JIRA Help"
}urls.get(jira101) == HelpUrl{url: https:///DOCS/docs-062/JIRA+101, title: "JIRA 101"
}urls.get(anyOtherKey) == HelpUrl{url: https:///DOCS/docs-062/Index, title: "JIRA Help"
}defaultUrl(String, String)
is used when a default URL is not configured
in the passed properties.
An injected instance is configured with the default url being null (i.e. defaultUrl(null, null)
) and
with the correct OnDemand status (i.e. onDemand(inOnDemand)
). The object is immutable, however, you can
easily create new instances of HelpUrlParser
with different settings using onDemand(boolean)
or
defaultUrl(String, String)
.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns a new parser that will use the passed URL (title) in URLs that don't have a URL (title) set.
| |||||||||||
Returns a new parser that will either use or ignore
.ondemand properties. | |||||||||||
Parse the passed properties and return an equivalent
HelpUrls instance. | |||||||||||
Parse the passed properties and return an equivalent
HelpUrls instance. | |||||||||||
Parse the passed properties and return an equivalent
HelpUrls instance. |
Returns a new parser that will use the passed URL (title) in URLs that don't have a URL (title) set. It is possible for the parser to ignore these values if the input name-value pairs during a parse have their own configured default.
url | the default URL. |
---|---|
title | the default title of the URL. |
HelpUrl
configured.
Returns a new parser that will either use or ignore .ondemand
properties.
onDemand | true if the parser should use .ondemand properties, or false if they
should be ignored. |
---|
.ondemand
properties
Parse the passed properties and return an equivalent HelpUrls
instance.
properties | the properties to parse. |
---|
HelpUrls
representation of the passed properties.
@Internal
classes and interfaces can not expect to be compatible with any version
other than the version they were compiled against (even minor version and milestone releases may break binary
compatibility with respect to @Internal
elements).
Parse the passed properties and return an equivalent HelpUrls
instance.
This method should not be called by plugins as the format of internalProperties
is not documented
and is subject to change.
externalProperties | the properties to parse. |
---|---|
internalProperties | the internal properties to parse. These properties follow a different format to the that documented on this interface and should only be used by JIRA internally. |
HelpUrls
representation of the passed properties.
Parse the passed properties and return an equivalent HelpUrls
instance.
properties | the properties to parse. |
---|
HelpUrls
representation of the passed properties.