org.wicketstuff.rest.resource.urlsegments
Class MultiParamSegment

java.lang.Object
  extended by org.apache.wicket.util.string.StringValue
      extended by org.wicketstuff.rest.resource.urlsegments.AbstractURLSegment
          extended by org.wicketstuff.rest.resource.urlsegments.MultiParamSegment
All Implemented Interfaces:
Serializable, IClusterable

public class MultiParamSegment
extends AbstractURLSegment

This kind of segment can contain more than one path parameter, for example "/message-{day}-{month}-{year}/".

Author:
andrea del bene
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.wicketstuff.rest.resource.urlsegments.AbstractURLSegment
REGEXP_BODY, REGEXP_DECLARATION, SEGMENT_PARAMETER
 
Method Summary
 int calculateScore(String actualSegment)
          This method checks if a given string is compatible with the current segment.
 List<AbstractURLSegment> getSubSegments()
           
protected  MetaPattern loadMetaPattern()
          Method invoked to load the MetaPattern for the current segment.
 void populatePathVariables(Map<String,String> variables, String segment)
          With this method every segment contributes to extract path parameters from the current request URL.
 
Methods inherited from class org.wicketstuff.rest.resource.urlsegments.AbstractURLSegment
getActualSegment, getMetaPattern, getSegmentMatrixParameters, newSegment
 
Methods inherited from class org.apache.wicket.util.string.StringValue
afterFirst, afterLast, beforeFirst, beforeLast, equals, hashCode, isEmpty, isNull, repeat, repeat, replaceAll, to, toBoolean, toBoolean, toBooleanObject, toChar, toChar, toCharacter, toDouble, toDouble, toDoubleObject, toDuration, toDuration, toEnum, toEnum, toEnum, toInt, toInt, toInteger, toLong, toLong, toLongObject, toOptional, toOptionalBoolean, toOptionalCharacter, toOptionalDouble, toOptionalDuration, toOptionalEnum, toOptionalInteger, toOptionalLong, toOptionalString, toOptionalTime, toString, toString, toTime, toTime, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf, valueOf
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

loadMetaPattern

protected MetaPattern loadMetaPattern()
Description copied from class: AbstractURLSegment
Method invoked to load the MetaPattern for the current segment.

Specified by:
loadMetaPattern in class AbstractURLSegment
Returns:
the MetaPattern for the current segment.

calculateScore

public int calculateScore(String actualSegment)
Description copied from class: AbstractURLSegment
This method checks if a given string is compatible with the current segment.

Specified by:
calculateScore in class AbstractURLSegment
Returns:
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 if the method is invoked on a FixedURLSegment, while it returns 1 for the other types of segment.

populatePathVariables

public void populatePathVariables(Map<String,String> variables,
                                  String segment)
Description copied from class: AbstractURLSegment
With this method every segment contributes to extract path parameters from the current request URL.

Specified by:
populatePathVariables in class AbstractURLSegment
Parameters:
variables - the Map object containing the extracted parameters.
segment - the value of the current segment.

getSubSegments

public List<AbstractURLSegment> getSubSegments()


Copyright © 2013–2014. All rights reserved.