Package org.apache.tapestry.util

Examples of org.apache.tapestry.util.RegexpMatcher


    public void validate(String value, String pattern, String errorKey)
        throws DocumentParseException
    {
        if (_matcher == null)
            _matcher = new RegexpMatcher();

        if (_matcher.matches(pattern, value))
            return;

        throw new InvalidStringException(Tapestry.format(errorKey, value), value, getLocation());
View Full Code Here


        private RegexpMatcher _matcher;

        private RegexpMatcher getPatternMatcher()
        {try { __CLOVER_455_0.M[2515]++;
            __CLOVER_455_0.S[10160]++;if ((((_matcher == null) && (++__CLOVER_455_0.CT[1732] != 0)) || (++__CLOVER_455_0.CF[1732] == 0))){
                __CLOVER_455_0.S[10161]++;_matcher = new RegexpMatcher();}

            __CLOVER_455_0.S[10162]++;return _matcher;
        } finally { }}
View Full Code Here

        verifyControls();
    }

    public void testRenderContribution()
    {
        String pattern = new RegexpMatcher().getEscapedPatternString(Email.PATTERN);

        IMarkupWriter writer = newWriter();
        IRequestCycle cycle = newCycle();

        MockControl contextc = newControl(FormComponentContributorContext.class);
View Full Code Here

    }

    public void testRenderContributionCustomMessage()
    {

        String pattern = new RegexpMatcher().getEscapedPatternString(Email.PATTERN);

        IMarkupWriter writer = newWriter();
        IRequestCycle cycle = newCycle();

        MockControl contextc = newControl(FormComponentContributorContext.class);
View Full Code Here

        verifyControls();
    }

    public void testRenderContribution()
    {
        String pattern = new RegexpMatcher().getEscapedPatternString("\\d+");

        IMarkupWriter writer = newWriter();
        IRequestCycle cycle = newCycle();

        MockControl contextc = newControl(FormComponentContributorContext.class);
View Full Code Here

        verifyControls();
    }

    public void testRenderContributionCustomMessage()
    {
        String pattern = new RegexpMatcher().getEscapedPatternString("\\d+");

        IMarkupWriter writer = newWriter();
        IRequestCycle cycle = newCycle();

        MockControl contextc = newControl(FormComponentContributorContext.class);
View Full Code Here

     * Invoked by hivemind by default to initialize
     * service.
     */
    public void initializeService()
    {
        _matcher = new RegexpMatcher();
    }
View Full Code Here

public class TestRegexpMatcher extends TapestryTestCase
{

    public void testMatch()
    {
        RegexpMatcher m = new RegexpMatcher();

        assertTrue(m.matches("[a-z]+", "c"));
        assertTrue(m.matches("foo|foot", "foo"));
    }
View Full Code Here

        assertTrue(m.matches("foo|foot", "foo"));
    }

    public void testNonmatch()
    {
        RegexpMatcher m = new RegexpMatcher();

        assertTrue(!m.matches("[0-9]+", "q"));
        assertTrue(!m.matches("foo|foot", "foot"));
    }
View Full Code Here

        assertTrue(!m.matches("foo|foot", "foot"));
    }

    public void testBadPattern()
    {
        RegexpMatcher m = new RegexpMatcher();

        try
        {
            m.matches("[[[", "x");

            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
View Full Code Here

TOP

Related Classes of org.apache.tapestry.util.RegexpMatcher

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.