Package com.volantis.mcs.xml.schema.model

Examples of com.volantis.mcs.xml.schema.model.ElementType


        validatorMock = new ElementValidatorMock("validatorMock", expectations);

        validatorMock.expects.hasExcludes().returns(false).any();

        elementType = new ElementType("", "e", "e");

    }
View Full Code Here


        contentCollector = new ContentCollector();
    }

    public ElementValidator build(ElementSchema schema) {

        ElementType type = schema.getElementType();
        ContentModel model = schema.getContentModel();
        boolean useAnywhere = schema.getUseAnywhere();
        boolean transparent = schema.isTransparent();
        if (!transparent && model == null) {
            throw new IllegalStateException("Model not provided: " +
View Full Code Here

    }

    public void addSchema(Schema schema) {
        for (Iterator i = schema.elements(); i.hasNext();) {
            ElementSchema element = (ElementSchema) i.next();
            ElementType type = element.getElementType();
            ElementValidator elementValidator = builder.build(element);
            validatorPrototypes.put(type, elementValidator);
        }
    }
View Full Code Here

    public void startElement(
            String uri, String localName, String qName,
            Attributes attributes)
            throws SAXException {

        ElementType type = getElementType(uri, localName);
        validator.open(type);
    }
View Full Code Here

    }

    public void endElement(String uri, String localName, String qName)
            throws SAXException {

        ElementType type = getElementType(uri, localName);
        validator.close(type);
    }
View Full Code Here

    /**
     * Ensure that it validates the content correctly.
     */
    public void testValidation() {

        ElementType element = new ElementType("", "");

        ContentValidator validator = new AnyContentValidator();

        // Make sure that it can accept an element.
        assertEquals(validator.check(element, ValidationState.CURRENT),
View Full Code Here

     * Ensure that a transparent validator at the root of a document works
     * correctly.
     */
    public void testTransparentAtRoot() throws Exception {

        ElementType e = new ElementType("", "e", "e");
        ElementType c = new ElementType("", "c", "c");

        TransparentElementValidator elementValidator =
                new TransparentElementValidator(e, null, true);

        elementValidator.open(null);
View Full Code Here

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

        containingElement = new ElementType("", "container");

        validatorFactoryMock = new ValidatorPrototypeFactoryMock(
                "factoryMock", expectations);

        contentValidatorMock = new ContentValidatorMock(
View Full Code Here

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

        ElementType aElement = new ElementType("", "a");

        aReferenceMock = new ElementReferenceMock(
                "aReferenceMock", expectations);

        aValidatorMock = new ContentTypeValidatorMock(
View Full Code Here

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

        ElementType bElement = new ElementType("", "a");

        bReferenceMock = new ElementReferenceMock(
                "bReferenceMock", expectations);

        bValidatorMock = new ContentTypeValidatorMock(
View Full Code Here

TOP

Related Classes of com.volantis.mcs.xml.schema.model.ElementType

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.