Class PathRegExp
- java.lang.Object
-
- org.restlet.ext.jaxrs.internal.util.PathRegExp
-
@Deprecated public class PathRegExp extends java.lang.ObjectDeprecated.Will be removed in next minor release.Wraps a regular expression of a @Path. Instances are immutable. The regular expression has no '/' t the start.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringDEFAULT_REG_EXPDeprecated.Default regular expression to use, if no reg exp is given (matches every character expect '/').static PathRegExpEMPTYDeprecated.The PathRegExp with an empty path.private booleanemptyOrSlashDeprecated.private static byteNAME_READDeprecated.private static byteNAME_READ_READYDeprecated.private static byteNAME_READ_STARTDeprecated.private java.lang.IntegernoLitCharsDeprecated.Contains the number of literal chars in this Regular Expressionprivate intnoNonDefaultRegExpDeprecated.Contains the number of capturing groups with regular expressions that are not the default.private intnoOfCapturingGroupsDeprecated.private java.lang.StringpathTemplateDecDeprecated.private java.lang.StringpathTemplateEncDeprecated.private java.util.regex.PatternpatternDeprecated.private static byteREGEXP_READDeprecated.private static byteREGEXP_READ_READYDeprecated.private static byteREGEXP_READ_STARTDeprecated.private java.util.List<java.lang.String>varNamesDeprecated.
-
Constructor Summary
Constructors Modifier Constructor Description privatePathRegExp(java.lang.String pathTemplate, javax.ws.rs.Path pathForExcMess)Deprecated.Is intended for internal use and testing.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static PathRegExpcreateForClass(java.lang.Class<?> rrc)Deprecated.Creates aPathRegExpfor a root resource class.static PathRegExpcreateForMethod(java.lang.reflect.Method annotatedMethod)Deprecated.Creates aPathRegExpfor a sub resource method or sub resource locator.booleanequals(java.lang.Object anotherObject)Deprecated.Compares this regular expression of a @Pathwith the given Object by comparing given patterns.intgetNoNonDefCaprGroups()Deprecated.intgetNoOfCapturingGroups()Deprecated.intgetNoOfLiteralChars()Deprecated.See Footnode to JSR-311-Spec, Section 2.6, Algorithm, Part 1ejava.lang.StringgetPathTemplateDec()Deprecated.java.lang.StringgetPathTemplateEnc()Deprecated.inthashCode()Deprecated.booleanisEmptyOrSlash()Deprecated.Checks if the URI template is empty or only a slash.MatchingResultmatch(RemainingPath remainingPath)Deprecated.Checks if this regular expression matches the given remaining path.booleanmatchesWithEmpty(RemainingPath remainingPath)Deprecated.Checks, if this regular expression matches the given path with no final matching group.private intprocessTemplVarname(java.lang.String pathTemplate, int braceIndex, java.lang.StringBuilder pathPattern, javax.ws.rs.Path pathForExcMess)Deprecated.java.lang.StringtoString()Deprecated.
-
-
-
Field Detail
-
DEFAULT_REG_EXP
private static final java.lang.String DEFAULT_REG_EXP
Deprecated.Default regular expression to use, if no reg exp is given (matches every character expect '/').- See Also:
#defaultRegExp, Constant Field Values
-
EMPTY
public static final PathRegExp EMPTY
Deprecated.The PathRegExp with an empty path.
-
NAME_READ
private static final byte NAME_READ
Deprecated.- See Also:
- Constant Field Values
-
NAME_READ_READY
private static final byte NAME_READ_READY
Deprecated.- See Also:
- Constant Field Values
-
NAME_READ_START
private static final byte NAME_READ_START
Deprecated.- See Also:
- Constant Field Values
-
REGEXP_READ
private static final byte REGEXP_READ
Deprecated.- See Also:
- Constant Field Values
-
REGEXP_READ_READY
private static final byte REGEXP_READ_READY
Deprecated.- See Also:
- Constant Field Values
-
REGEXP_READ_START
private static final byte REGEXP_READ_START
Deprecated.- See Also:
- Constant Field Values
-
emptyOrSlash
private final boolean emptyOrSlash
Deprecated.
-
noLitChars
private final java.lang.Integer noLitChars
Deprecated.Contains the number of literal chars in this Regular Expression
-
noNonDefaultRegExp
private int noNonDefaultRegExp
Deprecated.Contains the number of capturing groups with regular expressions that are not the default.- See Also:
DEFAULT_REG_EXP
-
noOfCapturingGroups
private final int noOfCapturingGroups
Deprecated.
-
pathTemplateDec
private final java.lang.String pathTemplateDec
Deprecated.
-
pathTemplateEnc
private final java.lang.String pathTemplateEnc
Deprecated.
-
pattern
private final java.util.regex.Pattern pattern
Deprecated.
-
varNames
private final java.util.List<java.lang.String> varNames
Deprecated.
-
-
Constructor Detail
-
PathRegExp
private PathRegExp(java.lang.String pathTemplate, javax.ws.rs.Path pathForExcMess) throws IllegalPathExceptionDeprecated.Is intended for internal use and testing. Otherwise use the static methodscreateForClass(Class)orcreateForMethod(Method), or the constantEMPTY.- Parameters:
pathPattern-pathForExcMess-- Throws:
IllegalPathException
-
-
Method Detail
-
createForClass
public static PathRegExp createForClass(java.lang.Class<?> rrc) throws MissingAnnotationException, IllegalPathOnClassException, java.lang.IllegalArgumentException
Deprecated.Creates aPathRegExpfor a root resource class.- Parameters:
rrc- the JAX-RS root resource class- Returns:
- the PathRegExp from the given root resource class
- Throws:
MissingAnnotationException- if thePathannotation is missing.IllegalPathOnClassException- if thePathannotation is not valid.java.lang.IllegalArgumentException- if the rrc is null.
-
createForMethod
public static PathRegExp createForMethod(java.lang.reflect.Method annotatedMethod) throws IllegalPathOnMethodException, java.lang.IllegalArgumentException
Deprecated.Creates aPathRegExpfor a sub resource method or sub resource locator. ReturnsEMPTY, if the method is not annotated with @Path.- Parameters:
annotatedMethod-- Returns:
- the
PathRegExp. Never returns null. - Throws:
IllegalPathOnMethodException- if the annotation on the method is invalid.java.lang.IllegalArgumentException- if the method is null.
-
equals
public boolean equals(java.lang.Object anotherObject)
Deprecated.Compares this regular expression of a @Pathwith the given Object by comparing given patterns.- Overrides:
equalsin classjava.lang.Object
-
getNoNonDefCaprGroups
public int getNoNonDefCaprGroups()
Deprecated.- Returns:
- the number of capturing groups with regular expressions that are not the default.
-
getNoOfCapturingGroups
public int getNoOfCapturingGroups()
Deprecated.- Returns:
- Returns the number of capturing groups.
-
getNoOfLiteralChars
public int getNoOfLiteralChars()
Deprecated.See Footnode to JSR-311-Spec, Section 2.6, Algorithm, Part 1e- Returns:
- Returns the number of literal chars in the path patern
-
getPathTemplateDec
public java.lang.String getPathTemplateDec()
Deprecated.- Returns:
- the decoded path template with a '/' at the beginning, and no one at the end.
-
getPathTemplateEnc
public java.lang.String getPathTemplateEnc()
Deprecated.- Returns:
- the encoded path template with a '/' at the beginning, and no one at the end.
-
hashCode
public int hashCode()
Deprecated.- Overrides:
hashCodein classjava.lang.Object
-
isEmptyOrSlash
public boolean isEmptyOrSlash()
Deprecated.Checks if the URI template is empty or only a slash.- Returns:
- if this path regular expression is empty or "/"
-
match
public MatchingResult match(RemainingPath remainingPath)
Deprecated.Checks if this regular expression matches the given remaining path.- Parameters:
remainingPath-- Returns:
- Returns an MatchingResult, if the remainingPath matches to this template, or null, if not.
-
matchesWithEmpty
public boolean matchesWithEmpty(RemainingPath remainingPath)
Deprecated.Checks, if this regular expression matches the given path with no final matching group.- Parameters:
remainingPath-- Returns:
- true, if this regular expression matches exectly the given path, without a final capturing group.
-
processTemplVarname
private int processTemplVarname(java.lang.String pathTemplate, int braceIndex, java.lang.StringBuilder pathPattern, javax.ws.rs.Path pathForExcMess) throws IllegalPathExceptionDeprecated.- Parameters:
pathTemplate-braceIndex-pathPattern-pathForExcMess-- Throws:
IllegalPathException
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toStringin classjava.lang.Object
-
-