Package com.volantis.mcs.xml.schema.impl.validation

Examples of com.volantis.mcs.xml.schema.impl.validation.ContentValidator


        }

        mixed = false;
        this.exclusions = null;

        ContentValidator contentValidator = null;
        if (model != null) {
            contentValidator = processReferencedValidator(model);
            if (contentValidator == null) {
                throw new IllegalStateException("No validator created");
            }
View Full Code Here


        updateExclusions(model);

        // Check to see whether this builder has already created a content
        // validator for the model.
        CachedValidator cachedValidator;
        ContentValidator validator;
        cachedValidator = (CachedValidator) model2ContentValidator.get(model);
        if (cachedValidator != null) {
            mixed = mixed || cachedValidator.isMixed();
            return cachedValidator.getValidator();
        }

        ContentValidator savedValidator = contentValidator;
        contentValidator = null;

        boolean savedMixed = mixed;
        mixed = false;
View Full Code Here

        ContentModel nested = bounded.getContentModel();
        int minimum = bounded.getMinimum();
        int maximum = bounded.getMaximum();

        // Get the validator for the nested content.
        ContentValidator nestedValidator = processReferencedValidator(nested);
        if (nestedValidator == null) {
            return;
        }

        if (minimum == 0 && maximum == 1) {

            // optional
            contentValidator = prototypeFactory.createBoundedContentValidator(
                    nestedValidator, minimum, maximum);

        } else if (minimum == 0 && maximum == Integer.MAX_VALUE) {
            // unlimited

            // If the elementValidator requires per element state then we need
            // to wrap it in a repeating validator but otherwise we can just
            // return it as is.
            if (nestedValidator.requiresPerElementState()) {
                contentValidator =
                        prototypeFactory.createBoundedContentValidator(
                                nestedValidator, minimum, maximum);
            } else {
                contentValidator =
View Full Code Here

        // Merge all the type validators together, if they are all type
        // validators then do not bother wrapping them in a choice.
        List optimisedValidators = null;
        Set validTypes = null;
        for (int i = 0; i < validators.size(); i++) {
            ContentValidator validator = (ContentValidator) validators.get(i);
            if (validator instanceof ContentTypeValidator) {
                ContentTypeValidator typeValidator =
                        (ContentTypeValidator) validator;
                if (validTypes == null) {
                    validTypes = new HashSet();
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);
            }
        }
        return validators;
View Full Code Here

TOP

Related Classes of com.volantis.mcs.xml.schema.impl.validation.ContentValidator

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.