Package org.apache.xerces.impl.dv

Examples of org.apache.xerces.impl.dv.XSSimpleType.validate()


                XSSimpleType dv = ctype.fXSSimpleType;
                try {
                    if (!fNormalizeData || fUnionType) {
                        fValidationState.setNormalizationRequired(true);
                    }
                    actualValue = dv.validate(textContent, fValidationState, fValidatedInfo);
                } catch (InvalidDatatypeValueException e) {
                    reportSchemaError(e.getKey(), e.getArgs());
                    reportSchemaError("cvc-complex-type.2.2", new Object[] { element.rawname });
                }
                // REVISIT: eventually, this method should return the same actualValue as elementLocallyValidType...
View Full Code Here


        if (isNumeric) {
            type = dvFactory.getBuiltInType("double");
        } else {
            type = dvFactory.getBuiltInType("string");
        }
        return type.validate(value, null, null);
    }
   
    public String getStringValue() {
        return value;
    }
View Full Code Here

       
        Object obj;
        if (child.getType() == TYPE_UNTYPED) {
            //attribute cast
            String attrValue = child.getValue(attributes).toString();
            obj = type.validate(attrValue, null, null);
        } else {
            //literal cast (perform using the string value of the literal node)
            obj = type.validate(child.getStringValue(), null, null);
        }
       
View Full Code Here

            //attribute cast
            String attrValue = child.getValue(attributes).toString();
            obj = type.validate(attrValue, null, null);
        } else {
            //literal cast (perform using the string value of the literal node)
            obj = type.validate(child.getStringValue(), null, null);
        }
       
        //Workaround (this is here because double validator can only validate double values)
        if (type.getNumeric()) {
           obj = dvFactory.getBuiltInType("double").validate(obj, null, null);
View Full Code Here

            // "string" type for validation
            dv = STRING_TYPE;
        }
        try {
            // validate the original lexical rep, and set the actual value
            actualValue = dv.validate(value, context, vinfo);
            // validate the canonical lexical rep
            if (vinfo != null)
                actualValue = dv.validate(vinfo.stringValue(), context, vinfo);
        } catch (InvalidDatatypeValueException ide) {
            return null;
View Full Code Here

        try {
            // validate the original lexical rep, and set the actual value
            actualValue = dv.validate(value, context, vinfo);
            // validate the canonical lexical rep
            if (vinfo != null)
                actualValue = dv.validate(vinfo.stringValue(), context, vinfo);
        } catch (InvalidDatatypeValueException ide) {
            return null;
        }

        return actualValue;
View Full Code Here

        // get simple type
        XSSimpleType attDV = currDecl.fType;

        Object actualValue = null;
        try {
            actualValue = attDV.validate(attrValue, fValidationState, fValidatedInfo);
           
            // additional check for assertions processing, for simple type having 
            // variety 'union'.
            if (attDV.getVariety() == XSSimpleTypeDefinition.VARIETY_UNION) {
                if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(),
View Full Code Here

                // Apply extra checking rules (ID/IDREF/ENTITY)
                final XSSimpleType attDV = currDecl.fType;
                final boolean facetChecking = fValidationState.needFacetChecking();
                try {
                    fValidationState.setFacetChecking(false);
                    attDV.validate(fValidationState, defaultValue);
                   
                    // additional check for assertions processing, for simple type having
                    // variety 'union'.
                    if (attDV.getVariety() == XSSimpleTypeDefinition.VARIETY_UNION) {
                        if (XSTypeHelper.isAtomicValueValidForAnUnion(attDV.getMemberTypes(),
View Full Code Here

                XSSimpleType dv = (XSSimpleType) fCurrentType;
                try {
                    if (!fNormalizeData || fUnionType) {
                        fValidationState.setNormalizationRequired(true);
                    }
                    retValue = dv.validate(textContent, fValidationState, fValidatedInfo);
                   
                    // additional check for assertions processing, for simple type having
                    // variety 'union'.
                    if (dv.getVariety() == XSSimpleTypeDefinition.VARIETY_UNION) {
                        if (XSTypeHelper.isAtomicValueValidForAnUnion(dv.getMemberTypes(),
View Full Code Here

                XSSimpleType dv = ctype.fXSSimpleType;
                try {
                    if (!fNormalizeData || fUnionType) {
                        fValidationState.setNormalizationRequired(true);
                    }
                    actualValue = dv.validate(textContent, fValidationState, fValidatedInfo);
                   
                    // additional check for assertions processing, for simple type having
                    // variety 'union'.
                    if (dv.getVariety() == XSSimpleTypeDefinition.VARIETY_UNION) {
                        if (XSTypeHelper.isAtomicValueValidForAnUnion(dv.getMemberTypes(),
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.