Class UriTemplateParser
java.lang.Object
org.glassfish.jersey.uri.internal.UriTemplateParser
- Direct Known Subclasses:
PathTemplate.PathTemplateParser
A URI template parser that parses JAX-RS specific URI templates.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int[]private static final String[]private intprivate final StringBufferprivate final StringBufferprivate intprivate final Patternprivate final StringBufferprivate intprivate final Stringstatic final PatternDefault URI template value regexp pattern. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate charprotected StringencodeLiteralCharacters(String characters) Encode literal characters of a template.Get the capturing group counts for each template variable.final int[]Get the group indexes to capturing groups.getNames()Get the list of template names.Get the map of template names to patterns.final StringGet the normalized template.final intGet the number of explicit regular expressions.final intGet the number of literal characters.final intGet the number of regular expression groupsfinal PatternGet the pattern.final StringGet the template.private static String[]private voidprivate intparseName(CharacterIterator ci, int skipGroup) private Stringprivate void
-
Field Details
-
EMPTY_INT_ARRAY
static final int[] EMPTY_INT_ARRAY -
RESERVED_REGEX_CHARACTERS
-
HEX_TO_UPPERCASE_REGEX
-
TEMPLATE_VALUE_PATTERN
Default URI template value regexp pattern. -
template
-
regex
-
normalizedTemplate
-
literalCharactersBuffer
-
pattern
-
names
-
groupCounts
-
nameToPattern
-
numOfExplicitRegexes
private int numOfExplicitRegexes -
skipGroup
private int skipGroup -
literalCharacters
private int literalCharacters
-
-
Constructor Details
-
UriTemplateParser
Parse a template.- Parameters:
template- the template.- Throws:
IllegalArgumentException- if the template is null, an empty string or does not conform to a JAX-RS URI template.
-
-
Method Details
-
initReserved
-
getTemplate
-
getPattern
-
getNormalizedTemplate
Get the normalized template.A normalized template is a template without any explicit regular expressions.
- Returns:
- the normalized template.
-
getNameToPattern
-
getNames
-
getGroupCounts
-
getGroupIndexes
public final int[] getGroupIndexes()Get the group indexes to capturing groups.Any nested capturing groups will be ignored and the the group index will refer to the top-level capturing groups associated with the templates variables.
- Returns:
- the group indexes to capturing groups.
-
getNumberOfExplicitRegexes
public final int getNumberOfExplicitRegexes()Get the number of explicit regular expressions.- Returns:
- the number of explicit regular expressions.
-
getNumberOfRegexGroups
public final int getNumberOfRegexGroups()Get the number of regular expression groups- Returns:
- the number of regular expressions groups
- Since:
- 2.9
-
getNumberOfLiteralCharacters
public final int getNumberOfLiteralCharacters()Get the number of literal characters.- Returns:
- the number of literal characters.
-
encodeLiteralCharacters
-
parse
-
processLiteralCharacters
private void processLiteralCharacters() -
initHexToUpperCaseRegex
-
parseName
-
parseRegex
-
consumeWhiteSpace
-