Example usage for org.apache.wicket.util.parse.metapattern MetaPattern SEMICOLON

List of usage examples for org.apache.wicket.util.parse.metapattern MetaPattern SEMICOLON

Introduction

In this page you can find the example usage for org.apache.wicket.util.parse.metapattern MetaPattern SEMICOLON.

Prototype

MetaPattern SEMICOLON

To view the source code for org.apache.wicket.util.parse.metapattern MetaPattern SEMICOLON.

Click Source Link

Document

Constant for semicolon.

Usage

From source file:org.wicketstuff.rest.resource.urlsegments.AbstractURLSegment.java

License:Apache License

/**
 * Get the segment value without optional matrix parameters. For example given the following
 * value 'segment;parm=value', the function returns 'segment'.
 * //from   w ww  . ja  v a  2 s  .com
 * @param fullSegment
 * @return the value of the segment without matrix parameters.
 */
static public String getActualSegment(String fullSegment) {
    String[] segmentParts = fullSegment.split(MetaPattern.SEMICOLON.toString());
    return segmentParts[0];
}

From source file:org.wicketstuff.rest.resource.urlsegments.AbstractURLSegment.java

License:Apache License

/**
 * Extract matrix parameters from the segment in input.
 * /*from  www .j ava2  s.c  o m*/
 * @param fullSegment
 *            the segment in input.
 * @return a map containing matrix parameters.
 */
static public Map<String, String> getSegmentMatrixParameters(String fullSegment) {
    String[] segmentParts = fullSegment.split(MetaPattern.SEMICOLON.toString());
    HashMap<String, String> matrixParameters = new HashMap<String, String>();

    if (segmentParts.length < 2)
        return matrixParameters;

    for (int i = 1; i < segmentParts.length; i++) {
        String parameterDeclar = segmentParts[i];
        VariableAssignmentParser parser = new VariableAssignmentParser(parameterDeclar);

        parser.matcher().find();
        matrixParameters.put(parser.getKey(), parser.getValue());
    }

    return matrixParameters;
}