com.atlassian.confluence.labels
Class LabelParser
java.lang.Object
com.atlassian.confluence.labels.LabelParser
public class LabelParser
- extends java.lang.Object
The Label parser understands the formatting of label strings.
The following are considered valid label strings.
my:label
: a user label owned by the currently logged in user. If no user is logged in, this
defaults to the global label of the same name..
label
: a global label.
~username:label
: a user label owned by the specified user.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INVALID_CHARACTERS
public static final char[] INVALID_CHARACTERS
MAX_LABEL_NAME_LENGTH
public static final int MAX_LABEL_NAME_LENGTH
- See Also:
- Constant Field Values
MAX_LABEL_PREFIX_LENGTH
public static final int MAX_LABEL_PREFIX_LENGTH
- See Also:
- Constant Field Values
NAMESPACE_DELIMITER
public static final java.lang.String NAMESPACE_DELIMITER
- See Also:
- Constant Field Values
PERSONAL_LABEL_PREFIX
public static final java.lang.String PERSONAL_LABEL_PREFIX
- See Also:
- Constant Field Values
TEAM_LABEL_PREFIX
public static final java.lang.String TEAM_LABEL_PREFIX
- See Also:
- Constant Field Values
GLOBAL_LABEL_PREFIX
public static final java.lang.String GLOBAL_LABEL_PREFIX
USER_LABEL_PREFIX
public static final java.lang.String USER_LABEL_PREFIX
- See Also:
- Constant Field Values
LabelParser
public LabelParser()
isValidLabelLength
public static boolean isValidLabelLength(ParsedLabelName labelName)
isValidNameLength
public static boolean isValidNameLength(ParsedLabelName labelName)
isValidPrefixLength
public static boolean isValidPrefixLength(ParsedLabelName labelName)
isPersonalLabel
public static boolean isPersonalLabel(java.lang.String labelString)
- Returns true if the label is a personal label, false otherwise.
- Parameters:
labelString
- a string representation of exactly one label, optionally including a namespace.
E.g. "my:favourite"
, "team:confluence"
or "blah"
. Should not be null.
- Returns:
- true if the label is a personal label, false otherwise.
isLabelOwnedByUser
public static boolean isLabelOwnedByUser(java.lang.String labelString,
com.atlassian.user.User user)
- Returns true if the label is a personal label and is owned by the specified user, false otherwise. Returns false,
if the specified labelString is not a personal or user label (as no other label types have user ownership).
- Parameters:
labelString
- must be user label or personal labeluser
- user to check against
- Returns:
- true if the label is a personal label and is owned by the specified user, false otherwise.
parse
public static ParsedLabelName parse(java.lang.String labelString)
getInvalidCharactersAsString
public static java.lang.String getInvalidCharactersAsString()
create
public static ParsedLabelName create(java.lang.String labelName,
java.lang.String userName)
create
public static ParsedLabelName create(Label label)
render
public static java.lang.String render(Label label)
render
public static java.lang.String render(ParsedLabelName parsedLabelName)
render
public static java.lang.String render(ParsedLabelName parsedLabelName,
boolean ignoreCurrentUser)
Copyright © 2003-2013 Atlassian. All Rights Reserved.