Package org.apache.xerces.impl.dv

Examples of org.apache.xerces.impl.dv.ValidatedInfo


        if (context == null)
            context = fEmptyContext;

        if (validatedInfo == null)
            validatedInfo = new ValidatedInfo();
        else
            validatedInfo.memberType = null;

        // first normalize string value, and convert it to actual value
        boolean needNormalize = context==null||context.needToNormalize();
View Full Code Here


        if (context == null)
            context = fEmptyContext;

        if (validatedInfo == null)
            validatedInfo = new ValidatedInfo();
        else
            validatedInfo.memberType = null;

        // first normalize string value, and convert it to actual value
        boolean needNormalize = context==null||context.needToNormalize();
View Full Code Here

    XSObjectList attrUses = attrGrp.getAttributeUses();
    int useCount = attrUses.getLength();
    XSAttributeUseImpl currUse;
    XSAttributeDecl currDecl;
    short constType;
    ValidatedInfo defaultValue;
    boolean isSpecified;
    QName attName;
    // for each attribute use
    for (int i = 0; i < useCount; i++) {

      currUse = (XSAttributeUseImpl) attrUses.item(i);
      currDecl = currUse.fAttrDecl;
      // get value constraint
      constType = currUse.fConstraintType;
      defaultValue = currUse.fDefault;
      if (constType == XSConstants.VC_NONE) {
        constType = currDecl.getConstraintType();
        defaultValue = currDecl.fDefault;
      }
      // whether this attribute is specified
      isSpecified = attributes.getValue(currDecl.fTargetNamespace, currDecl.fName) != null;

      // Element Locally Valid (Complex Type)
      // 4 The {attribute declaration} of each attribute use in the {attribute uses} whose
      // {required} is true matches one of the attribute information items in the element
      // information item's [attributes] as per clause 3.1 above.
      if (currUse.fUse == SchemaSymbols.USE_REQUIRED) {
        if (!isSpecified)
          reportSchemaError(
            "cvc-complex-type.4",
            new Object[] { element.rawname, currDecl.fName });
      }
      // if the attribute is not specified, then apply the value constraint
      if (!isSpecified && constType != XSConstants.VC_NONE) {
        attName =
          new QName(null, currDecl.fName, currDecl.fName, currDecl.fTargetNamespace);
        String normalized = (defaultValue != null) ? defaultValue.stringValue() : "";
        int attrIndex = attributes.addAttribute(attName, "CDATA", normalized);
        if (attributes instanceof XMLAttributesImpl) {
          XMLAttributesImpl attrs = (XMLAttributesImpl) attributes;
          boolean schemaId =
            defaultValue != null
View Full Code Here

            errorArgs = new Object[]{typeName, attrDecl.fName,
                         "derivation-ok-restriction.2.1.3.a"};
            return errorArgs;
                    } else {
                        // check the values are the same.
                        ValidatedInfo baseFixedValue=(baseAttrUse.fDefault!=null ?
                                                      baseAttrUse.fDefault: baseAttrDecl.fDefault);
                        ValidatedInfo thisFixedValue=(attrUse.fDefault!=null ?
                                                      attrUse.fDefault: attrDecl.fDefault);
                        if (!baseFixedValue.actualValue.equals(thisFixedValue.actualValue)) {
              errorArgs = new Object[]{typeName, attrDecl.fName, thisFixedValue.stringValue(),
                           baseFixedValue.stringValue(), "derivation-ok-restriction.2.1.3.b"};
              return errorArgs;
                        }

                    }
View Full Code Here

        if (abstractAtt != null && abstractAtt.booleanValue())
            element.setIsAbstract();

        // get 'value constraint'
        if (fixedAtt != null) {
            element.fDefault = new ValidatedInfo();
            element.fDefault.normalizedValue = fixedAtt;
            element.setConstraintType(XSConstants.VC_FIXED);
        } else if (defaultAtt != null) {
            element.fDefault = new ValidatedInfo();
            element.fDefault.normalizedValue = defaultAtt;
            element.setConstraintType(XSConstants.VC_DEFAULT);
        } else {
            element.setConstraintType(XSConstants.VC_NONE);
        }
View Full Code Here

*/
public ValidatedInfo validateString(String content, XSSimpleType simpleType){

    //create an instance of 'ValidatedInfo' to get back information (like actual value,
    //normalizedValue etc..)after content is validated.
    ValidatedInfo validatedInfo = new ValidatedInfo();

        //get proper validation context , this is very important we need to get appropriate validation context while validating content
        //validation context passed is generally different while validating content and  creating simple type (applyFacets)
        ValidationContext validationState = getValidationContext();

View Full Code Here

        if (abstractAtt != null && abstractAtt.booleanValue())
            element.setIsAbstract();
       
        // get 'value constraint'
        if (fixedAtt != null) {
            element.fDefault = new ValidatedInfo();
            element.fDefault.normalizedValue = fixedAtt;
            element.setConstraintType(XSConstants.VC_FIXED);
        } else if (defaultAtt != null) {
            element.fDefault = new ValidatedInfo();
            element.fDefault.normalizedValue = defaultAtt;
            element.setConstraintType(XSConstants.VC_DEFAULT);
        } else {
            element.setConstraintType(XSConstants.VC_NONE);
        }
View Full Code Here

            }
            attrUse.fAttrDecl = attribute;
            attrUse.fUse = useAtt.shortValue();
            attrUse.fConstraintType = consType;
            if (defaultAtt != null) {
                attrUse.fDefault = new ValidatedInfo();
                attrUse.fDefault.normalizedValue = defaultAtt;
            }
            // Get the annotation associated witht the local attr decl
            if (attrDecl.getAttributeNode(SchemaSymbols.ATT_REF) == null) {
                attrUse.fAnnotations = attribute.getAnnotations();
View Full Code Here

                tnsAtt = schemaDoc.fTargetNamespace;
            }
        }
        // get 'value constraint'
        // for local named attribute, value constraint is absent
        ValidatedInfo attDefault = null;
        short constraintType = XSConstants.VC_NONE;
        if (isGlobal) {
            if (fixedAtt != null) {
                attDefault = new ValidatedInfo();
                attDefault.normalizedValue = fixedAtt;
                constraintType = XSConstants.VC_FIXED;
            } else if (defaultAtt != null) {
                attDefault = new ValidatedInfo();
                attDefault.normalizedValue = defaultAtt;
                constraintType = XSConstants.VC_DEFAULT;
            }
        }
       
View Full Code Here

            errorArgs = new Object[]{typeName, attrDecl.fName,
                         "derivation-ok-restriction.2.1.3.a"};
            return errorArgs;
                    } else {
                        // check the values are the same.
                        ValidatedInfo baseFixedValue=(baseAttrUse.fDefault!=null ?
                                                      baseAttrUse.fDefault: baseAttrDecl.fDefault);
                        ValidatedInfo thisFixedValue=(attrUse.fDefault!=null ?
                                                      attrUse.fDefault: attrDecl.fDefault);
                        if (!baseFixedValue.actualValue.equals(thisFixedValue.actualValue)) {
              errorArgs = new Object[]{typeName, attrDecl.fName, thisFixedValue.stringValue(),
                           baseFixedValue.stringValue(), "derivation-ok-restriction.2.1.3.b"};
              return errorArgs;
                        }

                    }
View Full Code Here

TOP

Related Classes of org.apache.xerces.impl.dv.ValidatedInfo

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.