class UriTemplateParser extends Object
| Modifier and Type | Field and Description |
|---|---|
(package private) static int[] |
EMPTY_INT_ARRAY |
private List<Integer> |
groupCounts |
private static String[] |
HEX_TO_UPPERCASE_REGEX |
private int |
literalCharacters |
private StringBuffer |
literalCharactersBuffer |
private List<String> |
names |
private Map<String,Pattern> |
nameToPattern |
private StringBuffer |
normalizedTemplate |
private int |
numOfExplicitRegexes |
private Pattern |
pattern |
private StringBuffer |
regex |
private static Set<Character> |
RESERVED_REGEX_CHARACTERS |
private String |
template |
private static Pattern |
TEMPLATE_VALUE_PATTERN |
| Constructor and Description |
|---|
UriTemplateParser(String template)
Parse a template.
|
| Modifier and Type | Method and Description |
|---|---|
private char |
consumeWhiteSpace(CharacterIterator ci) |
protected String |
encodeLiteralCharacters(String characters)
Encode literal characters of a template.
|
(package private) List<Integer> |
getGroupCounts()
Get the capturing group counts for each template variable.
|
(package private) int[] |
getGroupIndexes()
Get the group indexes to capturing groups.
|
(package private) List<String> |
getNames()
Get the list of template names.
|
(package private) Map<String,Pattern> |
getNameToPattern()
Get the map of template names to patterns.
|
(package private) String |
getNormalizedTemplate()
Get the normalized template.
|
(package private) int |
getNumberOfExplicitRegexes()
Get the number of explicit regular expressions.
|
(package private) int |
getNumberOfLiteralCharacters()
Get the number of literal characters.
|
(package private) Pattern |
getPattern()
Get the pattern.
|
(package private) String |
getTemplate()
Get the template.
|
private static String[] |
initHexToUpperCaseRegex() |
private static Set<Character> |
initReserved() |
private void |
parse(CharacterIterator ci) |
private void |
parseName(CharacterIterator ci) |
private String |
parseRegex(CharacterIterator ci) |
private void |
processLiteralCharacters() |
static final int[] EMPTY_INT_ARRAY
private static final Pattern TEMPLATE_VALUE_PATTERN
private final String template
private final StringBuffer regex
private final StringBuffer normalizedTemplate
private final StringBuffer literalCharactersBuffer
private final Pattern pattern
private int numOfExplicitRegexes
private int literalCharacters
private static final String[] HEX_TO_UPPERCASE_REGEX
UriTemplateParser(String template) throws IllegalArgumentException
template - the template.IllegalArgumentException - if the template is null, an empty string
or does not conform to a JAX-RS URI template.final String getTemplate()
final Pattern getPattern()
final String getNormalizedTemplate()
A normalized template is a template without any explicit regular expressions.
final Map<String,Pattern> getNameToPattern()
final List<String> getNames()
final List<Integer> getGroupCounts()
final int[] getGroupIndexes()
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.
final int getNumberOfExplicitRegexes()
final int getNumberOfLiteralCharacters()
protected String encodeLiteralCharacters(String characters)
characters - the literal charactersprivate void parse(CharacterIterator ci)
private void processLiteralCharacters()
private static String[] initHexToUpperCaseRegex()
private void parseName(CharacterIterator ci)
private String parseRegex(CharacterIterator ci)
private char consumeWhiteSpace(CharacterIterator ci)
Copyright © 2014 Sven Strittmatter. All Rights Reserved.