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

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


        validatorPrototypes = new HashMap();
    }

    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


        //   Test Expectations
        // =====================================================================

        ContentModel model = new EmptyContentImpl();

        ElementSchema schema =
                new ElementSchemaImpl(containingElement, model);

        ValidatorPrototypeBuilder builder =
                new ValidatorPrototypeBuilder(validatorFactoryMock);
        ElementValidator validator = builder.build(schema);
View Full Code Here

        // =====================================================================

        ContentChoiceImpl choice = new ContentChoiceImpl();
        choice.add(aReferenceMock).add(bReferenceMock);

        ElementSchema schema =
                new ElementSchemaImpl(containingElement, choice);

        ValidatorPrototypeBuilder builder =
                new ValidatorPrototypeBuilder(validatorFactoryMock);
        ElementValidator validator = builder.build(schema);
View Full Code Here

        //   Test Expectations
        // =====================================================================

        BoundedContent bounded = new BoundedContentImpl(aReferenceMock);

        ElementSchema schema =
                new ElementSchemaImpl(containingElement, bounded);

        ValidatorPrototypeBuilder builder =
                new ValidatorPrototypeBuilder(validatorFactoryMock);
        ElementValidator validator = builder.build(schema);
View Full Code Here

        // =====================================================================

        ContentModel bounded = new BoundedContentImpl(aReferenceMock)
                .atLeastOne();

        ElementSchema schema =
                new ElementSchemaImpl(containingElement, bounded);

        ValidatorPrototypeBuilder builder =
                new ValidatorPrototypeBuilder(validatorFactoryMock);
        ElementValidator validator = builder.build(schema);
View Full Code Here

        ContentModel sequence = new ContentSequenceImpl()
                .add(aReferenceMock)
                .add(bReferenceMock);

        ElementSchema schema =
                new ElementSchemaImpl(containingElement, sequence);

        ValidatorPrototypeBuilder builder =
                new ValidatorPrototypeBuilder(validatorFactoryMock);
        ElementValidator validator = builder.build(schema);
View Full Code Here

        // =====================================================================

        ValidatorPrototypeBuilder builder =
                new ValidatorPrototypeBuilder(validatorFactoryMock);

        ElementSchema schema1 =
                new ElementSchemaImpl(containingElement, aReferenceMock);


        // Create validators for the same model so the element validator
        // should be the same.
        ElementValidator validator1 = builder.build(schema1);

        assertEquals(
                "Element validator should match", elementValidatorMock,
                validator1);

        // Create validator for a different model but using part of the
        // previous model so the content validator should be reused.
        ContentModel bounded = new BoundedContentImpl(aReferenceMock);
        ElementSchema schema2 =
                new ElementSchemaImpl(containingElement, bounded);
        ElementValidator validator3 = builder.build(schema2);

        assertEquals(
                "Second element validator should match", elementValidator2Mock,
View Full Code Here

    }

    private void addSimpleInitializationSchema(
            ElementType instanceElement, ElementType itemElement) {

        ElementSchema instance = createElementSchema(instanceElement);
        ElementSchema item = createElementSchema(itemElement);
        instance.setContentModel(bounded(choice().add(item)));
        item.setContentModel(PCDATA);

        INSTANCE_CONTENT.add(instance);
    }
View Full Code Here

TOP

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

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.