Package org.apache.sling.validation.api

Examples of org.apache.sling.validation.api.Type


            String property = resourceProperty.getName();
            Object valuesObject = valueMap.get(property);
            if (valuesObject == null) {
                result.addFailureMessage(property, "Missing required property.");
            }
            Type propertyType = resourceProperty.getType();
            Map<Validator, Map<String, String>> validators = resourceProperty.getValidators();
            if (resourceProperty.isMultiple()) {
                if (valuesObject instanceof String[]) {
                    for (String fieldValue : (String[]) valuesObject) {
                        validatePropertyValue(result, property, fieldValue, propertyType, validators);
View Full Code Here


                property = relativePath + "/" + property;
            }
            if (fieldValues == null) {
                result.addFailureMessage(property, "Missing required property.");
            }
            Type propertyType = resourceProperty.getType();
            Map<Validator, Map<String, String>> validators = resourceProperty.getValidators();
            if (fieldValues instanceof String[]) {
                for (String fieldValue : (String[]) fieldValues) {
                    validatePropertyValue(result, property, fieldValue, propertyType, validators);
                }
View Full Code Here

        Set<ResourceProperty> properties = new HashSet<ResourceProperty>();
        if (propertiesResource != null) {
            for (Resource property : propertiesResource.getChildren()) {
                String fieldName = property.getName();
                ValueMap propertyValueMap = property.adaptTo(ValueMap.class);
                Type type = Type.getType(propertyValueMap.get(Constants.PROPERTY_TYPE, String.class));
                Boolean propertyMultiple = PropertiesUtil.toBoolean(propertyValueMap.get(Constants.PROPERTY_MULTIPLE), false);
                Resource validators = property.getChild(Constants.VALIDATORS);
                Map<Validator, Map<String, String>> validatorsMap = new HashMap<Validator, Map<String, String>>();
                if (validators != null) {
                    Iterator<Resource> validatorsIterator = validators.listChildren();
View Full Code Here

TOP

Related Classes of org.apache.sling.validation.api.Type

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.