Class ScoreMethodAndExtractPathVars
java.lang.Object
org.wicketstuff.rest.resource.urlsegments.visitor.ScoreMethodAndExtractPathVars
- All Implemented Interfaces:
ISegmentVisitor
Visitor implementation to assign a score to URL segments and to extract path variables.
The score is an integer positive value if the string in input is compatible with the current
segment, 0 otherwise. Segments of type FixedURLSegment have the priority over the
other types of segment. That's why positive matches has a score of 2 for FixedURLSegment,
it's 1 for the other types of segment.
- Author:
- andrea del bene
-
Constructor Summary
ConstructorDescriptionScoreMethodAndExtractPathVars
(MethodMappingInfo methodInfo, PageParameters pageParameters) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPathVariable
(String name, String value) void
addScore
(int partialSocre) int
getScore()
boolean
protected String
segmentActualValue
(AbstractURLSegment segment) Extract segment value from current page parameters.void
visit
(FixedURLSegment segment) void
visit
(MultiParamSegment segment) void
visit
(ParamSegment segment)
-
Constructor Details
-
ScoreMethodAndExtractPathVars
-
-
Method Details
-
visit
- Specified by:
visit
in interfaceISegmentVisitor
-
visit
- Specified by:
visit
in interfaceISegmentVisitor
-
visit
- Specified by:
visit
in interfaceISegmentVisitor
-
segmentActualValue
Extract segment value from current page parameters.- Parameters:
segment
-- Returns:
-
isSegmentValid
public boolean isSegmentValid() -
addScore
public void addScore(int partialSocre) -
getScore
public int getScore() -
getMethodInfo
-
getPathVariables
-
addPathVariable
-