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

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


    }

    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: " +
                    type);
View Full Code Here


        return validator;
    }

    public void visit(WrappingContent wrapping) {
        ContentModel nested = wrapping.getContentModel();
        nested.accept(this);
    }
View Full Code Here

        ContentModel nested = wrapping.getContentModel();
        nested.accept(this);
    }

    public void visit(BoundedContent bounded) {
        ContentModel nested = bounded.getContentModel();
        int minimum = bounded.getMinimum();
        int maximum = bounded.getMaximum();

        // Get the validator for the nested content.
        ContentValidator nestedValidator = processReferencedValidator(nested);
View Full Code Here

    private void updateExclusions(ContentModel model) {
        Iterator i = model.excluded();
        if (i != null) {
            while (i.hasNext()) {
                ContentModel nested = (ContentModel) i.next();
                exclusions = contentCollector.collectContent(
                        nested, exclusions);
            }
        }
    }
View Full Code Here

    private List visitCompositeContents(CompositeModel composite) {
        Iterator iterator = composite.iterator();
        List validators = new ArrayList();
        while (iterator.hasNext()) {
            ContentModel model = (ContentModel) iterator.next();
            ContentValidator validator = processReferencedValidator(model);
            if (validator != null) {
                validators.add(validator);
            }
        }
View Full Code Here

        }

        private void visitComposite(CompositeModel composite) {
            Iterator i = composite.iterator();
            while (i.hasNext()) {
                ContentModel model = (ContentModel) i.next();
                model.accept(this);
            }
        }
View Full Code Here

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

        ContentModel model = new EmptyContentImpl();

        ElementSchema schema =
                new ElementSchemaImpl(containingElement, model);

        ValidatorPrototypeBuilder builder =
View Full Code Here

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

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

        ElementSchema schema =
                new ElementSchemaImpl(containingElement, bounded);
View Full Code Here

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

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

        ElementSchema schema =
                new ElementSchemaImpl(containingElement, sequence);
View Full Code Here

                "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(
View Full Code Here

TOP

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

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.