Package org.apache.xerces.xni

Examples of org.apache.xerces.xni.Augmentations


        String wildcardIDName = null;

        // for each present attribute
        int attCount = attributes.getLength();

        Augmentations augs = null;
        AttributePSVImpl attrPSVI = null;

        boolean isSimple = fCurrentType == null ||
                           fCurrentType.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE;
       
        XSObjectList attrUses = null;
        int useCount = 0;
        XSWildcardDecl attrWildcard = null;
        if (!isSimple) {
            attrUses = attrGrp.getAttributeUses();
            useCount = attrUses.getLength();
            attrWildcard = attrGrp.fAttributeWC;
        }

        // Element Locally Valid (Complex Type)
        // 3 For each attribute information item in the element information item's [attributes] excepting those whose [namespace name] is identical to http://www.w3.org/2001/XMLSchema-instance and whose [local name] is one of type, nil, schemaLocation or noNamespaceSchemaLocation, the appropriate case among the following must be true:
        // get the corresponding attribute decl
        for (int index = 0; index < attCount; index++) {

            attributes.getName(index, fTempQName);

            if (DEBUG) {
                System.out.println("==>process attribute: "+fTempQName);
            }

            if (fAugPSVI) {
                augs = attributes.getAugmentations(index);
                attrPSVI = (AttributePSVImpl) augs.getItem(Constants.ATTRIBUTE_PSVI);
                if (attrPSVI != null) {
                    attrPSVI.reset();
                } else {
                    attrPSVI= new AttributePSVImpl();
                    augs.putItem(Constants.ATTRIBUTE_PSVI, attrPSVI);
                }
                // PSVI attribute: validation context
                attrPSVI.fValidationContext = fValidationRoot;
            }
View Full Code Here


                   
                if (fAugPSVI) {
                   
                    // PSVI: attribute is "schema" specified
                    Augmentations augs = attributes.getAugmentations(attrIndex);
                    AttributePSVImpl attrPSVI = new AttributePSVImpl();
                    augs.putItem(Constants.ATTRIBUTE_PSVI, attrPSVI);

                    attrPSVI.fDeclaration = currDecl;
                    attrPSVI.fTypeDecl = currDecl.fType;
                    attrPSVI.fMemberType = defaultValue.memberType;
                    attrPSVI.fNormalizedValue = normalized;
View Full Code Here

     * @param attrIndex The attribute index.
     */
    public void removeAttributeAt(int attrIndex) {
        if (attrIndex < fLength - 1) {
            Attribute removedAttr = fAttributes[attrIndex];
            Augmentations removedAug = fAugmentations[attrIndex];
            System.arraycopy(fAttributes, attrIndex + 1,
                             fAttributes, attrIndex, fLength - attrIndex - 1);

            System.arraycopy(fAugmentations, attrIndex + 1,
                 fAugmentations, attrIndex, fLength - attrIndex - 1);
View Full Code Here

                }
                attributes.getName(i, fQName);
                String attrType = attributes.getType(i);
                String attrValue = attributes.getValue(i);
                String attrNonNormalizedValue = attributes.getNonNormalizedValue(i);
                Augmentations augs = attributes.getAugmentations(i);
                fOut.print("name=");
                fOut.print('{');
                fOut.print("prefix=");
                printQuotedString(fQName.prefix);
                fOut.print(',');
View Full Code Here

     * @param attrIndex The attribute index.
     */
    public void removeAttributeAt(int attrIndex) {
        if (attrIndex < fLength - 1) {
            Attribute removedAttr = fAttributes[attrIndex];
            Augmentations removedAug = fAugmentations[attrIndex];
            System.arraycopy(fAttributes, attrIndex + 1,
                             fAttributes, attrIndex, fLength - attrIndex - 1);

            System.arraycopy(fAugmentations, attrIndex + 1,
                 fAugmentations, attrIndex, fLength - attrIndex - 1);
View Full Code Here

        // REVISIT: should we assume that XMLAttributeImpl removes
        //          all augmentations from Augmentations? if yes.. we loose objects
        //         if no - we always produce attribute psvi objects which may not be filled in
        //         in this case we need to create/reset here all objects
        Augmentations augs = null;
        AttributePSVImpl attrPSVI = null;
        for (int k=0;k<attributes.getLength();k++) {
            augs = attributes.getAugmentations(k);
            attrPSVI = (AttributePSVImpl) augs.getItem(ATTR_PSVI);
            if (attrPSVI != null) {
                attrPSVI.reset();
            } else {
                attrPSVI= new AttributePSVImpl();
                augs.putItem(ATTR_PSVI, attrPSVI);
            }
            // PSVI attribute: validation context
            attrPSVI.fValidationContext = element.rawname;
        }
View Full Code Here

                String type = (currDecl.fType.isIDType())?"ID":"CDATA";

                int attrIndex = attributes.addAttribute(attName, type, (defaultValue!=null)?defaultValue.normalizedValue:"");

                // PSVI: attribute is "schema" specified
                Augmentations augs = attributes.getAugmentations(attrIndex);

                AttributePSVImpl attrPSVI = (AttributePSVImpl)augs.getItem(ATTR_PSVI);

                // check if PSVIAttribute was added to Augmentations.
                // it is possible that we just created new chunck of attributes
                // in this case PSVI attribute are not there.
                if (attrPSVI != null) {
                    attrPSVI.reset();
                } else {
                    attrPSVI = new AttributePSVImpl();
                    augs.putItem(ATTR_PSVI, attrPSVI);
                }

                attrPSVI.fSpecified = false;
                // PSVI attribute: validation context
                attrPSVI.fValidationContext = element.rawname;
View Full Code Here

            // call handler
            if (fDocumentHandler != null) {
                if (fNotifyCharRefs) {
                    fDocumentHandler.startGeneralEntity(fCharRefLiteral, null, null, null);
                }
                Augmentations augs = new AugmentationsImpl();
                augs.putItem(CHAR_REF, Boolean.TRUE);
                fDocumentHandler.characters(fStringBuffer2, augs);
                if (fNotifyCharRefs) {
                    fDocumentHandler.endGeneralEntity(fCharRefLiteral, null);
                }
            }
View Full Code Here

   * @throws XNIException Thrown by handler to signal an error.
   */
  public void startElement(QName element, XMLAttributes attributes, Augmentations augs)
    throws XNIException {

    Augmentations modifiedAugs = handleStartElement(element, attributes, augs);
    // call handlers
    if (fDocumentHandler != null) {
      fDocumentHandler.startElement(element, attributes, modifiedAugs);
    }

View Full Code Here

   * @throws XNIException Thrown by handler to signal an error.
   */
  public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs)
    throws XNIException {

    Augmentations modifiedAugs = handleStartElement(element, attributes, augs);

    // in the case where there is a {value constraint}, and the element
    // doesn't have any text content, change emptyElement call to
    // start + characters + end
    fDefaultValue = null;
View Full Code Here

TOP

Related Classes of org.apache.xerces.xni.Augmentations

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.