Package org.atmosphere.util.uri
Class UriTemplateParser
- java.lang.Object
-
- org.atmosphere.util.uri.UriTemplateParser
-
public class UriTemplateParser extends java.lang.ObjectA URI template parser that parses JAX-RS specific URI templates.- Author:
- Paul.Sandoz@Sun.Com
-
-
Constructor Summary
Constructors Constructor Description UriTemplateParser(java.lang.String template)Parse a template.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UriTemplateParserdestroy()protected java.lang.StringencodeLiteralCharacters(java.lang.String literalCharacters)Encode literal characters of a template.java.util.List<java.lang.Integer>getGroupCounts()Get the capturing group counts for each template variable.int[]getGroupIndexes()Get the group indexes to capturing groups.java.util.List<java.lang.String>getNames()Get the list of template names.java.util.Map<java.lang.String,java.util.regex.Pattern>getNameToPattern()Get the map of template names to patterns.java.lang.StringgetNormalizedTemplate()Get the normalized template.intgetNumberOfExplicitRegexes()Get the number of explicit regular expressions.intgetNumberOfLiteralCharacters()Get the number of literal characters.java.util.regex.PatterngetPattern()Get the pattern.java.lang.StringgetTemplate()Get the template.
-
-
-
Method Detail
-
destroy
public UriTemplateParser destroy()
-
getTemplate
public final java.lang.String getTemplate()
Get the template.- Returns:
- the template.
-
getPattern
public final java.util.regex.Pattern getPattern()
Get the pattern.- Returns:
- the pattern.
-
getNormalizedTemplate
public final java.lang.String getNormalizedTemplate()
Get the normalized template.A normalized template is a template without any explicit regular expressions.
- Returns:
- the normalized template.
-
getNameToPattern
public final java.util.Map<java.lang.String,java.util.regex.Pattern> getNameToPattern()
Get the map of template names to patterns.- Returns:
- the map of template names to patterns.
-
getNames
public final java.util.List<java.lang.String> getNames()
Get the list of template names.- Returns:
- the list of template names.
-
getGroupCounts
public final java.util.List<java.lang.Integer> getGroupCounts()
Get the capturing group counts for each template variable.- Returns:
- the capturing group counts.
-
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.
-
getNumberOfLiteralCharacters
public final int getNumberOfLiteralCharacters()
Get the number of literal characters.- Returns:
- the number of literal characters.
-
encodeLiteralCharacters
protected java.lang.String encodeLiteralCharacters(java.lang.String literalCharacters)
Encode literal characters of a template.- Parameters:
literalCharacters- the literal characters- Returns:
- the encoded literal characters.
-
-