|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.confluence.util.LabelUtil
public final class 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.
| Field Summary | |
|---|---|
static String |
LABEL_DELIM
The canonical delimiter in output |
static String |
LABEL_DELIM_CHARS
The characters accepted as label delimiters |
| Constructor Summary | |
|---|---|
LabelUtil()
|
|
| Method Summary | |
|---|---|
static boolean |
addLabel(String labelReference,
LabelManager labelManager,
User user,
Labelable dest)
|
static String |
convertToDelimitedString(Labelable obj,
User user,
LabelManager labelManager)
Helper method converting list of labels associated with the labelable object into a space separated string of the label names. |
static String |
convertToDelimitedString(List names)
|
static String |
convertToDelimitedString(List names,
String seperator)
Utility function to convert a List into a delimited string with a custom seperator |
static List |
extractLabelsFromLabellings(List labellings)
Simple utility method to extract the label instances from the given list of labelling instances. |
static void |
fixLabels(List suggestedLabels)
|
static ListFilter |
getLabelFilters(User user,
boolean hideSpecialLabels)
returns only labels the user can see and also strips out special labels if 'hideSpecialLabels' flag is set |
static List |
getRecentAndPopularLabels(String spaceKey,
LabelManager labelManager,
int maxResults,
String user)
|
static List |
getRecentAndPopularLabelsForEntity(ContentEntityObject entity,
LabelManager labelManager,
int maxResults,
String user)
|
static boolean |
isValidLabelName(String input)
|
static boolean |
isValidLabelNames(String input)
|
static List |
rankResults(List results)
|
static void |
recordLabelInteractionInHistory(Label label)
|
static List |
split(String input)
Split the input string according to the label delimitation rules. |
static boolean |
syncState(String source,
LabelManager labelManager,
User user,
Labelable dest,
boolean removeUnusedLabels)
Neat method that will synchronize a space separated list of label names with the labels contained within the labelable object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String LABEL_DELIM_CHARS
public static final String LABEL_DELIM
| Constructor Detail |
|---|
public LabelUtil()
| Method Detail |
|---|
public static String convertToDelimitedString(Labelable obj,
User user,
LabelManager labelManager)
obj - public static String convertToDelimitedString(List names)
public static String convertToDelimitedString(List names,
String seperator)
public static boolean isValidLabelNames(String input)
input -
public static boolean isValidLabelName(String input)
public static List split(String input)
input -
public static boolean syncState(String source,
LabelManager labelManager,
User user,
Labelable dest,
boolean removeUnusedLabels)
dest - 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'labelManager - removeUnusedLabels -
public static boolean addLabel(String labelReference,
LabelManager labelManager,
User user,
Labelable dest)
public static void recordLabelInteractionInHistory(Label label)
public static List rankResults(List results)
public static List getRecentAndPopularLabelsForEntity(ContentEntityObject entity,
LabelManager labelManager,
int maxResults,
String user)
public static List getRecentAndPopularLabels(String spaceKey,
LabelManager labelManager,
int maxResults,
String user)
public static void fixLabels(List suggestedLabels)
public static List extractLabelsFromLabellings(List labellings)
labellings -
public static ListFilter getLabelFilters(User user,
boolean hideSpecialLabels)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||