java.lang.Object | |
↳ | com.atlassian.confluence.util.LabelUtil |
Utility class designed to assist dealing with the client interface. In particular, the conversion from a string to a label and back, and the conversion from a list of strings to a list of labels and back.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | LABEL_DELIM | The canonical delimiter in output | |||||||||
String | LABEL_DELIM_CHARS | The characters accepted as label delimiters | |||||||||
int | MAX_ALLOWED_LABELS | The maximum number of labels allowed on a page or space. | |||||||||
int | MAX_ALLOWED_LABELS_PER_INPUT | The maximum number of labels we allow to be entered via a single sumbission from the user interface. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method is deprecated.
since 2.9
| |||||||||||
Adds the label to the specified object.
| |||||||||||
Helper method converting list of labels associated with the labelable object into a space separated string
of the label names.
| |||||||||||
Counts the labels present in an input string.
| |||||||||||
Simple utility method to extract the label instances from the given list of labelling instances.
| |||||||||||
returns only labels the user can see and also strips out special labels if 'hideSpecialLabels' flag is set
| |||||||||||
Get a list of the visible label names for this content.
| |||||||||||
Split the input string according to the label delimitation rules.
| |||||||||||
Neat method that will synchronize a space separated list of label names with the labels contained within the
labelable object.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
The characters accepted as label delimiters
The maximum number of labels allowed on a page or space.
The maximum number of labels we allow to be entered via a single sumbission from the user interface.
Adds the label to the specified object. The label is a string in the form of an unparsed label, and is
validated by isValidLabelName(String)
and isValidLabelLength(String)
.
Helper method converting list of labels associated with the labelable object into a space separated string of the label names.
Counts the labels present in an input string. Counts each appearance of duplicate labels.
input | a string of labels delimited by the characters in LABEL_DELIM_CHARS . May be null or empty. |
---|
Simple utility method to extract the label instances from the given list of labelling instances.
Label
instances.
returns only labels the user can see and also strips out special labels if 'hideSpecialLabels' flag is set
Get a list of the visible label names for this content. System labels and personal labels that do not belong to this user will be stripped. Visible non-global label names will have their namespace prefixed( i.e. my:foo, team:bar)
labels | the list of Label objects to filter |
---|---|
username | the user who the list is being filtered for |
String
s that the user can see
delimitedLabelNames | contains a list of label names delimited by LABEL_DELIM_CHARS |
---|
names | a collection of label names as String s. |
---|
Split the input string according to the label delimitation rules.
Neat method that will synchronize a space separated list of label names with the labels contained within the labelable object. Labels that do not exist in the comma separated list will be removed, and labels that appear in the comma separated list will be created.
If a label is removed and that label no longer labels any labelable content, then it will be deleted if the removeUnusedLabels is set to true.source | is a space separated list of label names, eg: the following list "LabelA LabelB LabelC" will be converted into label instances with the names 'LabelA', 'LabelB' and 'LabelC' |
---|