当前位置: 首页>>代码示例>>Java>>正文


Java AttributePSVI.getTypeDefinition方法代码示例

本文整理汇总了Java中com.sun.org.apache.xerces.internal.xs.AttributePSVI.getTypeDefinition方法的典型用法代码示例。如果您正苦于以下问题:Java AttributePSVI.getTypeDefinition方法的具体用法?Java AttributePSVI.getTypeDefinition怎么用?Java AttributePSVI.getTypeDefinition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.org.apache.xerces.internal.xs.AttributePSVI的用法示例。


在下文中一共展示了AttributePSVI.getTypeDefinition方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processAttributePSVI

import com.sun.org.apache.xerces.internal.xs.AttributePSVI; //导入方法依赖的package包/类
/** Returns whether the given attribute is an ID type. **/
private boolean processAttributePSVI(AttrImpl attr, AttributePSVI attrPSVI) {
    if (fStorePSVI) {
        ((PSVIAttrNSImpl) attr).setPSVI (attrPSVI);
    }
    Object type = attrPSVI.getMemberTypeDefinition ();
    if (type == null) {
        type = attrPSVI.getTypeDefinition ();
        if (type != null) {
            attr.setType(type);
            return ((XSSimpleType) type).isIDType();
        }
    }
    else {
        attr.setType(type);
        return ((XSSimpleType) type).isIDType();
    }
    return false;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:DOMResultAugmentor.java

示例2: setPSVI

import com.sun.org.apache.xerces.internal.xs.AttributePSVI; //导入方法依赖的package包/类
/**
 * Copy PSVI properties from another psvi item.
 *
 * @param attr  the source of attribute PSVI items
 */
public void setPSVI(AttributePSVI attr) {
    this.fDeclaration = attr.getAttributeDeclaration();
    this.fValidationContext = attr.getValidationContext();
    this.fValidity = attr.getValidity();
    this.fValidationAttempted = attr.getValidationAttempted();
    this.fErrorCodes = attr.getErrorCodes();
    this.fNormalizedValue = attr.getSchemaNormalizedValue();
    this.fActualValue = attr.getActualNormalizedValue();
    this.fActualValueType = attr.getActualNormalizedValueType();
    this.fItemValueTypes = attr.getItemValueTypes();
    this.fTypeDecl = attr.getTypeDefinition();
    this.fMemberType = attr.getMemberTypeDefinition();
    this.fSpecified = attr.getIsSchemaSpecified();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:PSVIAttrNSImpl.java

示例3: getSchemaDeterminedID

import com.sun.org.apache.xerces.internal.xs.AttributePSVI; //导入方法依赖的package包/类
/**
 * Returns the schema-determined-ID.
 *
 *
 * @param attributes
 * @param index
 * @return A String containing the schema-determined ID.
 * @throws XNIException
 */
public String getSchemaDeterminedID(XMLAttributes attributes, int index)
throws XNIException {
    Augmentations augs = attributes.getAugmentations(index);
    AttributePSVI attrPSVI = (AttributePSVI) augs
    .getItem(Constants.ATTRIBUTE_PSVI);

    if (attrPSVI != null) {
        // An element or attribute information item is a schema-determined
        // ID if and only if one of the following is true:]

        // 1. It has a [member type definition] or [type definition] property
        // whose value in turn has [name] equal to ID and [target namespace]
        // equal to http://www.w3.org/2001/XMLSchema;

        // 2. It has a [base type definition] whose value has that [name] and [target namespace];

        // 3. It has a [base type definition] whose value has a [base type definition]
        // whose value has that [name] and [target namespace], and so on following
        // the [base type definition] property recursively;

        XSTypeDefinition typeDef = attrPSVI.getMemberTypeDefinition();
        if (typeDef != null) {
            typeDef = attrPSVI.getTypeDefinition();
        }

        //
        if (typeDef != null && ((XSSimpleType) typeDef).isIDType()) {
            return attrPSVI.getSchemaNormalizedValue();
        }

        // 4 & 5 NA
    }

    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:45,代码来源:ShortHandPointer.java

示例4: setPSVI

import com.sun.org.apache.xerces.internal.xs.AttributePSVI; //导入方法依赖的package包/类
/**
 * Copy PSVI properties from another psvi item.
 *
 * @param attr  the source of attribute PSVI items
 */
public void setPSVI(AttributePSVI attr) {
    this.fDeclaration = attr.getAttributeDeclaration();
    this.fValidationContext = attr.getValidationContext();
    this.fValidity = attr.getValidity();
    this.fValidationAttempted = attr.getValidationAttempted();
    this.fErrorCodes = attr.getErrorCodes();
    this.fErrorMessages = attr.getErrorMessages();
    this.fValue.copyFrom(attr.getSchemaValue());
    this.fTypeDecl = attr.getTypeDefinition();
    this.fSpecified = attr.getIsSchemaSpecified();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:PSVIAttrNSImpl.java

示例5: AttributePSVImpl

import com.sun.org.apache.xerces.internal.xs.AttributePSVI; //导入方法依赖的package包/类
public AttributePSVImpl(boolean isConstant, AttributePSVI attrPSVI) {
    fDeclaration = attrPSVI.getAttributeDeclaration();
    fTypeDecl = attrPSVI.getTypeDefinition();
    fSpecified = attrPSVI.getIsSchemaSpecified();
    fValue.copyFrom(attrPSVI.getSchemaValue());
    fValidationAttempted = attrPSVI.getValidationAttempted();
    fValidity = attrPSVI.getValidity();
    if (attrPSVI instanceof AttributePSVImpl) {
        final AttributePSVImpl attrPSVIImpl = (AttributePSVImpl) attrPSVI;
        fErrors = (attrPSVIImpl.fErrors != null) ?
                (String[]) attrPSVIImpl.fErrors.clone() : null;
    }
    else {
        final StringList errorCodes = attrPSVI.getErrorCodes();
        final int length = errorCodes.getLength();
        if (length > 0) {
            final StringList errorMessages = attrPSVI.getErrorMessages();
            final String[] errors = new String[length << 1];
            for (int i = 0, j = 0; i < length; ++i) {
                errors[j++] = errorCodes.item(i);
                errors[j++] = errorMessages.item(i);
            }
            fErrors = errors;
        }
    }
    fValidationContext = attrPSVI.getValidationContext();
    fIsConstant = isConstant;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:29,代码来源:AttributePSVImpl.java

示例6: getSchemaDeterminedID

import com.sun.org.apache.xerces.internal.xs.AttributePSVI; //导入方法依赖的package包/类
/**
 * Returns the schema-determined-ID.
 *
 *
 * @param attributes
 * @param index
 * @return A String containing the schema-determined ID.
 * @throws XNIException
 */
public String getSchemaDeterminedID(XMLAttributes attributes, int index)
throws XNIException {
    Augmentations augs = attributes.getAugmentations(index);
    AttributePSVI attrPSVI = (AttributePSVI) augs
    .getItem(Constants.ATTRIBUTE_PSVI);

    if (attrPSVI != null) {
        // An element or attribute information item is a schema-determined
        // ID if and only if one of the following is true:]

        // 1. It has a [member type definition] or [type definition] property
        // whose value in turn has [name] equal to ID and [target namespace]
        // equal to http://www.w3.org/2001/XMLSchema;

        // 2. It has a [base type definition] whose value has that [name] and [target namespace];

        // 3. It has a [base type definition] whose value has a [base type definition]
        // whose value has that [name] and [target namespace], and so on following
        // the [base type definition] property recursively;

        XSTypeDefinition typeDef = attrPSVI.getMemberTypeDefinition();
        if (typeDef != null) {
            typeDef = attrPSVI.getTypeDefinition();
        }

        //
        if (typeDef != null && ((XSSimpleType) typeDef).isIDType()) {
            return attrPSVI.getSchemaValue().getNormalizedValue();
        }

        // 4 & 5 NA
    }

    return null;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:45,代码来源:ShortHandPointer.java

示例7: startElement

import com.sun.org.apache.xerces.internal.xs.AttributePSVI; //导入方法依赖的package包/类
/**
* The start of an element.
*
* @param element    The name of the element.
* @param attributes The element attributes.
* @param augs       Additional information that may include infoset augmentations
*
* @exception XNIException
*                   Thrown by handler to signal an error.
*/
   public void startElement(QName element, XMLAttributes attributes, Augmentations augs)
           throws XNIException {
           Element currentElement = (Element) fCurrentNode;
           int attrCount = attributes.getLength();
   if (DEBUG_EVENTS) {
       System.out.println("==>startElement: " +element+
       " attrs.length="+attrCount);
   }

           for (int i = 0; i < attrCount; i++) {
                   attributes.getName(i, fAttrQName);
                   Attr attr = null;

                   attr = currentElement.getAttributeNodeNS(fAttrQName.uri, fAttrQName.localpart);
       AttributePSVI attrPSVI =
                           (AttributePSVI) attributes.getAugmentations(i).getItem(Constants.ATTRIBUTE_PSVI);

                   if (attrPSVI != null) {
           //REVISIT: instead we should be using augmentations:
           // to set/retrieve Id attributes
           XSTypeDefinition decl = attrPSVI.getMemberTypeDefinition();
           boolean id = false;
           if (decl != null){
               id = ((XSSimpleType)decl).isIDType();
           } else{
               decl = attrPSVI.getTypeDefinition();
               if (decl !=null){
                  id = ((XSSimpleType)decl).isIDType();
               }
           }
           if (id){
               ((ElementImpl)currentElement).setIdAttributeNode(attr, true);
           }

                           if (fPSVI) {
                                   ((PSVIAttrNSImpl) attr).setPSVI(attrPSVI);
                           }
                           if ((fConfiguration.features & DOMConfigurationImpl.DTNORMALIZATION) != 0) {
                                   // datatype-normalization
                                   // NOTE: The specified value MUST be set after we set
                                   //       the node value because that turns the "specified"
                                   //       flag to "true" which may overwrite a "false"
                                   //       value from the attribute list.
                                   boolean specified = attr.getSpecified();
                                   attr.setValue(attrPSVI.getSchemaNormalizedValue());
                                   if (!specified) {
                                           ((AttrImpl) attr).setSpecified(specified);
                                   }
                           }
                   }
           }
   }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:63,代码来源:DOMNormalizer.java

示例8: startElement

import com.sun.org.apache.xerces.internal.xs.AttributePSVI; //导入方法依赖的package包/类
public void startElement(QName element, XMLAttributes attributes,
        Augmentations augs) throws XNIException {
    Element elem;
    int attrCount = attributes.getLength();
    if (fDocumentImpl == null) {
        elem = fDocument.createElementNS(element.uri, element.rawname);
        for (int i = 0; i < attrCount; ++i) {
            attributes.getName(i, fAttributeQName);
            elem.setAttributeNS(fAttributeQName.uri, fAttributeQName.rawname, attributes.getValue(i));
        }
    }
    // If it's a Xerces DOM store type information for attributes, set idness, etc..
    else {
        elem = fDocumentImpl.createElementNS(element.uri, element.rawname, element.localpart);
        for (int i = 0; i < attrCount; ++i) {
            attributes.getName(i, fAttributeQName);
            AttrImpl attr = (AttrImpl) fDocumentImpl.createAttributeNS(fAttributeQName.uri,
                    fAttributeQName.rawname, fAttributeQName.localpart);
            attr.setValue(attributes.getValue(i));

            // write type information to this attribute
            AttributePSVI attrPSVI = (AttributePSVI) attributes.getAugmentations(i).getItem (Constants.ATTRIBUTE_PSVI);
            if (attrPSVI != null) {
                if (fStorePSVI) {
                    ((PSVIAttrNSImpl) attr).setPSVI(attrPSVI);
                }
                Object type = attrPSVI.getMemberTypeDefinition();
                if (type == null) {
                    type = attrPSVI.getTypeDefinition();
                    if (type != null) {
                        attr.setType (type);
                        if (((XSSimpleType) type).isIDType()) {
                            ((ElementImpl) elem).setIdAttributeNode (attr, true);
                        }
                    }
                }
                else {
                    attr.setType (type);
                    if (((XSSimpleType) type).isIDType()) {
                        ((ElementImpl) elem).setIdAttributeNode (attr, true);
                    }
                }
            }
            attr.setSpecified(attributes.isSpecified(i));
            elem.setAttributeNode(attr);
        }
    }
    append(elem);
    fCurrentNode = elem;
    if (fFragmentRoot == null) {
        fFragmentRoot = elem;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:54,代码来源:DOMResultBuilder.java

示例9: startElement

import com.sun.org.apache.xerces.internal.xs.AttributePSVI; //导入方法依赖的package包/类
/**
* The start of an element.
*
* @param element    The name of the element.
* @param attributes The element attributes.
* @param augs       Additional information that may include infoset augmentations
*
* @exception XNIException
*                   Thrown by handler to signal an error.
*/
   public void startElement(QName element, XMLAttributes attributes, Augmentations augs)
           throws XNIException {
           Element currentElement = (Element) fCurrentNode;
           int attrCount = attributes.getLength();
   if (DEBUG_EVENTS) {
       System.out.println("==>startElement: " +element+
       " attrs.length="+attrCount);
   }

           for (int i = 0; i < attrCount; i++) {
                   attributes.getName(i, fAttrQName);
                   Attr attr = null;

                   attr = currentElement.getAttributeNodeNS(fAttrQName.uri, fAttrQName.localpart);
       AttributePSVI attrPSVI =
                           (AttributePSVI) attributes.getAugmentations(i).getItem(Constants.ATTRIBUTE_PSVI);

                   if (attrPSVI != null) {
           //REVISIT: instead we should be using augmentations:
           // to set/retrieve Id attributes
           XSTypeDefinition decl = attrPSVI.getMemberTypeDefinition();
           boolean id = false;
           if (decl != null){
               id = ((XSSimpleType)decl).isIDType();
           } else{
               decl = attrPSVI.getTypeDefinition();
               if (decl !=null){
                  id = ((XSSimpleType)decl).isIDType();
               }
           }
           if (id){
               ((ElementImpl)currentElement).setIdAttributeNode(attr, true);
           }

                           if (fPSVI) {
                                   ((PSVIAttrNSImpl) attr).setPSVI(attrPSVI);
                           }
                           if ((fConfiguration.features & DOMConfigurationImpl.DTNORMALIZATION) != 0) {
                                   // datatype-normalization
                                   // NOTE: The specified value MUST be set after we set
                                   //       the node value because that turns the "specified"
                                   //       flag to "true" which may overwrite a "false"
                                   //       value from the attribute list.
                                   boolean specified = attr.getSpecified();
                                   attr.setValue(attrPSVI.getSchemaValue().getNormalizedValue());
                                   if (!specified) {
                                           ((AttrImpl) attr).setSpecified(specified);
                                   }
                           }
                   }
           }
   }
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:63,代码来源:DOMNormalizer.java


注:本文中的com.sun.org.apache.xerces.internal.xs.AttributePSVI.getTypeDefinition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。