com.atlassian.jira.issue.label
Class LabelParser
java.lang.Object
com.atlassian.jira.issue.label.LabelParser
public class LabelParser
- extends java.lang.Object
This class provides a number of static utility methods for validating labels.
- Since:
- v4.2
Method Summary |
static
|
buildFromString(LabelParser.CreateFromString<Y> factory,
java.lang.String labelsString)
Takes a set of labels represented as a string and parses them out. |
static java.util.Set<Label> |
buildFromString(java.lang.String labelsString)
Takes a set of labels represented as a string and parses them out. |
static java.lang.String |
getCleanLabel(java.lang.String label)
Cleans up the label so that it can be stored in JIRA. |
static boolean |
isValidLabelName(java.lang.String name)
Checks if the label provided contains any invalid chars |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MAX_LABEL_LENGTH
public static final int MAX_LABEL_LENGTH
- See Also:
- Constant Field Values
INVALID_PATTERN
public static final java.util.regex.Pattern INVALID_PATTERN
LabelParser
public LabelParser()
isValidLabelName
public static boolean isValidLabelName(java.lang.String name)
- Checks if the label provided contains any invalid chars
- Parameters:
name
- The label to check for invalid chars
- Returns:
- true if any invalid chars were found false otherwise
getCleanLabel
public static java.lang.String getCleanLabel(java.lang.String label)
- Cleans up the label so that it can be stored in JIRA. It may replace characters in the label to ensure
it can be stored within JIRA.
- Parameters:
label
- the label to clean.
- Returns:
- the cleaned label that can be stored in JIRA. Will return null on label that cannot be corrected.
buildFromString
public static java.util.Set<Label> buildFromString(java.lang.String labelsString)
- Takes a set of labels represented as a string and parses them out.
- Parameters:
labelsString
- a String containing labels separated by LabelsSystemField#SEPARATOR_CHAR
- Returns:
- a Set of Label
buildFromString
public static <Y> java.util.Set<Y> buildFromString(LabelParser.CreateFromString<Y> factory,
java.lang.String labelsString)
- Takes a set of labels represented as a string and parses them out. Any invalid labels will be
transformed to that they become valid.
- Parameters:
labelsString
- the string to parse.factory
- class that will convert a string to the object required
- Returns:
- the collection of labels contained within the string.
Copyright © 2002-2010 Atlassian. All Rights Reserved.