Package org.wicketstuff.rest.resource.urlsegments

Examples of org.wicketstuff.rest.resource.urlsegments.MultiParamSegment


    String segmentMultiParam = "{segment0}asegment{segment1:^\\(?\\d{3}\\)?[ -]?\\d{3}[ -]?\\d{4}$}anotherseg";
    segment = AbstractURLSegment.newSegment(segmentMultiParam);

    assertTrue(segment instanceof MultiParamSegment);

    MultiParamSegment multiParamSegment = (MultiParamSegment)segment;
    List<AbstractURLSegment> subSegments = multiParamSegment.getSubSegments();

    assertEquals(4, subSegments.size());
    metaPattern = subSegments.get(2).getMetaPattern();
    assertEquals(metaPattern.toString(), "^\\(?\\d{3}\\)?[ -]?\\d{3}[ -]?\\d{4}$");

    segmentMultiParam = "filename-{symbolicName:[a-z]+}-{version:\\d\\.\\d\\.\\d}{extension:\\.[a-z]+}";
    segment = AbstractURLSegment.newSegment(segmentMultiParam);
    multiParamSegment = (MultiParamSegment)segment;
    metaPattern = multiParamSegment.getMetaPatternWithGroups();

    String fileName = "filename-gsaon-1.2.3.zip";
    Matcher matcher = metaPattern.matcher(fileName);

    assertTrue(matcher.matches());
View Full Code Here

TOP

Related Classes of org.wicketstuff.rest.resource.urlsegments.MultiParamSegment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.