Package com.volantis.styling.impl.engine.matchers.constraints

Examples of com.volantis.styling.impl.engine.matchers.constraints.ValueConstraint


    /**
     * Test a successful value.
     */
    public void testSuccess() {
        ValueConstraint constraint = createSuccessfulValue("alpha");
        assertTrue("Successful value did not match", constraint.satisfied("alpha"));
    }
View Full Code Here


    /**
     * Test a failing value.
     */
    public void testFailure() {
        ValueConstraint constraint = createFailingValue("beta");
        assertFalse("Failing value matched", constraint.satisfied("alpha"));
    }
View Full Code Here

        // Update the specificity.
        specificityCalculator.addAttributeSelector();

        String attribute = selector.getName();
        ValueConstraint constraint = factory.createConstraint(
                selector.getConstraint());
        matcherSequenceList.add(factory.createAttributeMatcher(
                selector.getNamespacePrefix(), attribute, constraint));
    }
View Full Code Here

        specificityCalculator.addClassSelector();

        // A class selector is simply an attribute selector where the
        // attribute name is "class" and the constraint is ListContains.
        String styleClass = selector.getCssClass();
        ValueConstraint constraint =
                factory.createListContainsConstraint(styleClass);

        matcherSequenceList.add(factory.createAttributeMatcher(
                null, "class", constraint));
    }
View Full Code Here

        specificityCalculator.addIDSelector();

        // An id selector is simply an attribute selector where the
        // attribute name is "id" and the constraint is Equals.
        String id = selector.getId();
        ValueConstraint constraint =
                factory.createEqualsConstraint(id);

        matcherSequenceList.add(factory.createAttributeMatcher(
                null, "id", constraint));
    }
View Full Code Here

        return new MatchesLanguage(value);
    }

    // Javadoc inherited.
    public ValueConstraint createConstraint(Constraint constraint) {
        ValueConstraint valueConstraint = null;
        String value = constraint.getValue();
        if (constraint instanceof com.volantis.mcs.themes.constraints.MatchesLanguage) {
            valueConstraint = createMatchesLanguageConstraint(value);
        } else if (constraint instanceof com.volantis.mcs.themes.constraints.Equals) {
            valueConstraint = createEqualsConstraint(value);
View Full Code Here

        // =====================================================================
        //   Create Mocks
        // =====================================================================

        ValueConstraint listContains = new ValueConstraintMock(
                "listContains", expectations);

        Matcher attributeMatcher = new SimpleMatcherMock(
                "attributeMatcher", expectations);
View Full Code Here

TOP

Related Classes of com.volantis.styling.impl.engine.matchers.constraints.ValueConstraint

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.