Package org.infinispan.schematic.document

Examples of org.infinispan.schematic.document.Path


                              Problems problems,
                              SchemaDocumentResolver resolver ) {
            if (fieldValue instanceof List) {
                // Each item in the list must match the itemValidator or additionalItemsValidator ...
                List<?> items = (List<?>)fieldValue;
                Path path = pathToParent.with(fieldName);
                int i = 1;
                boolean success = true;
                for (Object item : items) {
                    itemProblems.clear();
                    itemValidator.validate(item, fieldName, parent, pathToParent, itemProblems, resolver);
                    if (itemProblems.hasProblem()) {
                        problems.recordError(path, "The '" + fieldName + "' field on '" + pathToParent
                                                   + "' is an array, but the " + i + th(i)
                                                   + " item does not satisfy the schema for the " + i + th(i) + " item");
                        success = false;
                    }
                    ++i;
                }
                if (success) problems.recordSuccess();
            } else if (parent instanceof List) {
                // we are dealing with an optional array of items
                List<?> items = (List<?>)parent;
                int i = 1;
                boolean success = true;
                for (Object item : items) {
                    itemProblems.clear();
                    if (item instanceof Document) {
                        itemValidator.validate(null, null, (Document)item, pathToParent, itemProblems, resolver);
                        if (itemProblems.hasProblem()) {
                            success = false;
                        }
                    } else {
                        fieldName = item.toString();
                        Path path = pathToParent.with(fieldName);
                        itemValidator.validate(item, fieldName, parent, pathToParent, itemProblems, resolver);
                        if (itemProblems.hasProblem()) {
                            problems.recordError(path, "The '" + fieldName + "' field on '" + pathToParent
                                                       + "' is an array, but the " + i + th(i)
                                                       + " item does not satisfy the schema for the " + i + th(i) + " item");
View Full Code Here


                              Problems problems,
                              SchemaDocumentResolver resolver ) {
            if (fieldValue instanceof List) {
                // Each item in the list must match the itemValidator or additionalItemsValidator ...
                List<?> items = (List<?>)fieldValue;
                Path path = pathToParent.with(fieldName);
                int i = 0;
                Iterator<?> itemIterator = items.iterator();
                Iterator<Validator> itemValidatorIterator = itemValidators.iterator();
                boolean success = true;
                while (itemIterator.hasNext() && itemValidatorIterator.hasNext()) {
View Full Code Here

            output.writeObject(remove.parentPath);
        }

        @Override
        public ClearOperation readObject( ObjectInput input ) throws IOException, ClassNotFoundException {
            Path path = (Path)input.readObject();
            return new ClearOperation(path);
        }
View Full Code Here

TOP

Related Classes of org.infinispan.schematic.document.Path

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.