本文整理汇总了Java中com.sun.org.apache.xerces.internal.xs.XSTypeDefinition类的典型用法代码示例。如果您正苦于以下问题:Java XSTypeDefinition类的具体用法?Java XSTypeDefinition怎么用?Java XSTypeDefinition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XSTypeDefinition类属于com.sun.org.apache.xerces.internal.xs包,在下文中一共展示了XSTypeDefinition类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: endElement
import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition; //导入依赖的package包/类
public void endElement(QName element, Augmentations augs)
throws XNIException {
final Node currentElement = fDOMValidatorHelper.getCurrentElement();
// Write type information to this element
if (augs != null && fDocumentImpl != null) {
ElementPSVI elementPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
if (elementPSVI != null) {
if (fStorePSVI) {
((PSVIElementNSImpl) currentElement).setPSVI(elementPSVI);
}
XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
if (type == null) {
type = elementPSVI.getTypeDefinition();
}
((ElementNSImpl) currentElement).setType(type);
}
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:DOMResultAugmentor.java
示例2: endElement
import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition; //导入依赖的package包/类
public void endElement(QName element, Augmentations augs)
throws XNIException {
// write type information to this element
if (augs != null && fDocumentImpl != null) {
ElementPSVI elementPSVI = (ElementPSVI)augs.getItem(Constants.ELEMENT_PSVI);
if (elementPSVI != null) {
if (fStorePSVI) {
((PSVIElementNSImpl)fCurrentNode).setPSVI(elementPSVI);
}
XSTypeDefinition type = elementPSVI.getMemberTypeDefinition();
if (type == null) {
type = elementPSVI.getTypeDefinition();
}
((ElementNSImpl)fCurrentNode).setType(type);
}
}
// adjust current node reference
if (fCurrentNode == fFragmentRoot) {
fCurrentNode = null;
fFragmentRoot = null;
return;
}
fCurrentNode = fCurrentNode.getParentNode();
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:DOMResultBuilder.java
示例3: isDerivedByRestriction
import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition; //导入依赖的package包/类
/**
* DOM Level 3
* Checks if a type is derived from another by restriction. See:
* http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#TypeInfo-isDerivedFrom
*
* @param ancestorNS
* The namspace of the ancestor type declaration
* @param ancestorName
* The name of the ancestor type declaration
* @param type
* The reference type definition
*
* @return boolean True if the type is derived by restriciton for the
* reference type
*/
private boolean isDerivedByRestriction (String ancestorNS, String ancestorName, XSTypeDefinition type) {
XSTypeDefinition oldType = null;
while (type != null && type != oldType) {
if ((ancestorName.equals(type.getName()))
&& ((ancestorNS != null && ancestorNS.equals(type.getNamespace()))
|| (type.getNamespace() == null && ancestorNS == null))) {
return true;
}
oldType = type;
type = type.getBaseType();
}
return false;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:31,代码来源:XSSimpleTypeDecl.java
示例4: isDerivedByList
import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition; //导入依赖的package包/类
/**
* Checks if a type is derived from another by list. See:
* http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#TypeInfo-isDerivedFrom
*
* @param ancestorNS
* The namspace of the ancestor type declaration
* @param ancestorName
* The name of the ancestor type declaration
* @param type
* The reference type definition
*
* @return boolean True if the type is derived by list for the reference type
*/
private boolean isDerivedByList (String ancestorNS, String ancestorName, XSTypeDefinition type) {
// If the variety is union
if (type !=null && ((XSSimpleTypeDefinition)type).getVariety() == VARIETY_LIST) {
// get the {item type}
XSTypeDefinition itemType = ((XSSimpleTypeDefinition)type).getItemType();
// T2 is the {item type definition}
if (itemType != null) {
// T2 is derived from the other type definition by DERIVATION_RESTRICTION
if (isDerivedByRestriction(ancestorNS, ancestorName, itemType)) {
return true;
}
}
}
return false;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:32,代码来源:XSSimpleTypeDecl.java
示例5: isDerivedByUnion
import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition; //导入依赖的package包/类
/**
* Checks if a type is derived from another by union. See:
* http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#TypeInfo-isDerivedFrom
*
* @param ancestorNS
* The namspace of the ancestor type declaration
* @param ancestorName
* The name of the ancestor type declaration
* @param type
* The reference type definition
*
* @return boolean True if the type is derived by union for the reference type
*/
private boolean isDerivedByUnion (String ancestorNS, String ancestorName, XSTypeDefinition type) {
// If the variety is union
if (type !=null && ((XSSimpleTypeDefinition)type).getVariety() == VARIETY_UNION) {
// get member types
XSObjectList memberTypes = ((XSSimpleTypeDefinition)type).getMemberTypes();
for (int i = 0; i < memberTypes.getLength(); i++) {
// One of the {member type definitions} is T2.
if (memberTypes.item(i) != null) {
// T2 is derived from the other type definition by DERIVATION_RESTRICTION
if (isDerivedByRestriction(ancestorNS, ancestorName,(XSSimpleTypeDefinition)memberTypes.item(i))) {
return true;
}
}
}
}
return false;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:34,代码来源:XSSimpleTypeDecl.java
示例6: expandRelatedComponents
import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition; //导入依赖的package包/类
private void expandRelatedComponents(XSObject component, Vector componentList, Map<String, Vector> dependencies) {
short componentType = component.getType();
switch (componentType) {
case XSConstants.TYPE_DEFINITION :
expandRelatedTypeComponents((XSTypeDefinition) component, componentList, component.getNamespace(), dependencies);
break;
case XSConstants.ATTRIBUTE_DECLARATION :
expandRelatedAttributeComponents((XSAttributeDeclaration) component, componentList, component.getNamespace(), dependencies);
break;
case XSConstants.ATTRIBUTE_GROUP :
expandRelatedAttributeGroupComponents((XSAttributeGroupDefinition) component, componentList, component.getNamespace(), dependencies);
case XSConstants.ELEMENT_DECLARATION :
expandRelatedElementComponents((XSElementDeclaration) component, componentList, component.getNamespace(), dependencies);
break;
case XSConstants.MODEL_GROUP_DEFINITION :
expandRelatedModelGroupDefinitionComponents((XSModelGroupDefinition) component, componentList, component.getNamespace(), dependencies);
case XSConstants.ATTRIBUTE_USE :
//expandRelatedAttributeUseComponents((XSAttributeUse)component, componentList, dependencies);
case XSConstants.NOTATION_DECLARATION :
case XSConstants.IDENTITY_CONSTRAINT :
default :
break;
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:XSDHandler.java
示例7: expandRelatedSimpleTypeComponents
import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition; //导入依赖的package包/类
private void expandRelatedSimpleTypeComponents(XSSimpleTypeDefinition type, Vector componentList, String namespace, Map<String, Vector> dependencies) {
final XSTypeDefinition baseType = type.getBaseType();
if (baseType != null) {
addRelatedType(baseType, componentList, namespace, dependencies);
}
final XSTypeDefinition itemType = type.getItemType();
if (itemType != null) {
addRelatedType(itemType, componentList, namespace, dependencies);
}
final XSTypeDefinition primitiveType = type.getPrimitiveType();
if (primitiveType != null) {
addRelatedType(primitiveType, componentList, namespace, dependencies);
}
final XSObjectList memberTypes = type.getMemberTypes();
if (memberTypes.size() > 0) {
for (int i=0; i<memberTypes.size(); i++) {
addRelatedType((XSTypeDefinition)memberTypes.item(i), componentList, namespace, dependencies);
}
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:XSDHandler.java
示例8: contentRestore
import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition; //导入依赖的package包/类
private void contentRestore() {
fAnnotations = (XSAnnotationImpl [])fGlobalStore[--fGlobalStorePos];
fXSSimpleType = (XSSimpleType)fGlobalStore[--fGlobalStorePos];
fParticle = (XSParticleDecl)fGlobalStore[--fGlobalStorePos];
fAttrGrp = (XSAttributeGroupDecl)fGlobalStore[--fGlobalStorePos];
fBaseType = (XSTypeDefinition)fGlobalStore[--fGlobalStorePos];
int i = ((Integer)(fGlobalStore[--fGlobalStorePos])).intValue();
fBlock = (short)(i >> 16);
fContentType = (short)i;
i = ((Integer)(fGlobalStore[--fGlobalStorePos])).intValue();
fDerivedBy = (short)(i >> 16);
fFinal = (short)i;
fTargetNamespace = (String)fGlobalStore[--fGlobalStorePos];
fName = (String)fGlobalStore[--fGlobalStorePos];
fIsAbstract = ((Boolean)fGlobalStore[--fGlobalStorePos]).booleanValue();
fComplexTypeDecl = (XSComplexTypeDecl)fGlobalStore[--fGlobalStorePos];
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:XSDComplexTypeTraverser.java
示例9: handleContent
import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition; //导入依赖的package包/类
protected void handleContent(XSTypeDefinition type, boolean nillable, Object actualValue, short valueType, ShortList itemValueType) {
if (type == null ||
type.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE &&
((XSComplexTypeDefinition) type).getContentType()
!= XSComplexTypeDefinition.CONTENTTYPE_SIMPLE) {
// the content must be simpleType content
fStore.reportError( "cvc-id.3", new Object[] {
fIdentityConstraint.getName(),
fIdentityConstraint.getElementName()});
}
fMatchedString = actualValue;
matched(fMatchedString, valueType, itemValueType, nillable);
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:16,代码来源:Field.java
示例10: checkSimpleDerivationOk
import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition; //导入依赖的package包/类
/**
* check whether simple type derived is valid derived from base,
* given a subset of {restriction, extension}.
*/
public static boolean checkSimpleDerivationOk(XSSimpleType derived, XSTypeDefinition base, short block) {
// if derived is anySimpleType, then it's valid only if the base
// is ur-type
if (derived == SchemaGrammar.fAnySimpleType) {
return (base == SchemaGrammar.fAnyType ||
base == SchemaGrammar.fAnySimpleType);
}
// if base is complex type
if (base.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE) {
// if base is anyType, change base to anySimpleType,
// otherwise, not valid
if (base == SchemaGrammar.fAnyType)
base = SchemaGrammar.fAnySimpleType;
else
return false;
}
return checkSimpleDerivation((XSSimpleType)derived,
(XSSimpleType)base, block);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:XSConstraints.java
示例11: getDBMethods
import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition; //导入依赖的package包/类
private boolean getDBMethods(XSTypeDefinition typed, XSTypeDefinition typeb,
OneSubGroup methods) {
short dMethod = 0, bMethod = 0;
while (typed != typeb && typed != SchemaGrammar.fAnyType) {
if (typed.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE)
dMethod |= ((XSComplexTypeDecl)typed).fDerivedBy;
else
dMethod |= XSConstants.DERIVATION_RESTRICTION;
typed = typed.getBaseType();
// type == null means the current type is anySimpleType,
// whose base type should be anyType
if (typed == null)
typed = SchemaGrammar.fAnyType;
if (typed.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE)
bMethod |= ((XSComplexTypeDecl)typed).fBlock;
}
// No derivation relation, or blocked, return false
if (typed != typeb || (dMethod & bMethod) != 0)
return false;
// Remember the derivation methods and blocks, return true.
methods.dMethod = dMethod;
methods.bMethod = bMethod;
return true;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:SubstitutionGroupHandler.java
示例12: contentRestore
import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition; //导入依赖的package包/类
private void contentRestore() {
fAnnotations = (XSAnnotationImpl [])fGlobalStore[--fGlobalStorePos];
fXSSimpleType = (XSSimpleType)fGlobalStore[--fGlobalStorePos];
fParticle = (XSParticleDecl)fGlobalStore[--fGlobalStorePos];
fAttrGrp = (XSAttributeGroupDecl)fGlobalStore[--fGlobalStorePos];
fBaseType = (XSTypeDefinition)fGlobalStore[--fGlobalStorePos];
int i = ((Integer)(fGlobalStore[--fGlobalStorePos]));
fBlock = (short)(i >> 16);
fContentType = (short)i;
i = ((Integer)(fGlobalStore[--fGlobalStorePos]));
fDerivedBy = (short)(i >> 16);
fFinal = (short)i;
fTargetNamespace = (String)fGlobalStore[--fGlobalStorePos];
fName = (String)fGlobalStore[--fGlobalStorePos];
fIsAbstract = ((Boolean)fGlobalStore[--fGlobalStorePos]);
fComplexTypeDecl = (XSComplexTypeDecl)fGlobalStore[--fGlobalStorePos];
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:XSDComplexTypeTraverser.java
示例13: characterData
import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition; //导入依赖的package包/类
public boolean characterData(String data, Augmentations augs) {
fSawText = fSawText || data.length() > 0;
// REVISIT: this methods basically duplicates implementation of
// handleCharacters(). We should be able to reuse some code
// if whitespace == -1 skip normalization, because it is a complexType
// or a union type.
if (fNormalizeData && fWhiteSpace != -1 && fWhiteSpace != XSSimpleType.WS_PRESERVE) {
// normalize data
normalizeWhitespace(data, fWhiteSpace == XSSimpleType.WS_COLLAPSE);
fBuffer.append(fNormalizedStr.ch, fNormalizedStr.offset, fNormalizedStr.length);
} else {
if (fAppendBuffer)
fBuffer.append(data);
}
// When it's a complex type with element-only content, we need to
// find out whether the content contains any non-whitespace character.
boolean allWhiteSpace = true;
if (fCurrentType != null
&& fCurrentType.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE) {
XSComplexTypeDecl ctype = (XSComplexTypeDecl) fCurrentType;
if (ctype.fContentType == XSComplexTypeDecl.CONTENTTYPE_ELEMENT) {
// data outside of element content
for (int i = 0; i < data.length(); i++) {
if (!XMLChar.isSpace(data.charAt(i))) {
allWhiteSpace = false;
fSawCharacters = true;
break;
}
}
}
}
return allWhiteSpace;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:39,代码来源:XMLSchemaValidator.java
示例14: addGlobalTypeDecl
import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition; //导入依赖的package包/类
void addGlobalTypeDecl(XSTypeDefinition decl) {
final String namespace = decl.getNamespace();
final String declKey = (namespace == null || namespace.length() == 0)
? "," + decl.getName() : namespace + "," + decl.getName();
if (fGlobalTypeDecls.get(declKey) == null) {
fGlobalTypeDecls.put(declKey, decl);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:XSDHandler.java
示例15: expandRelatedTypeComponents
import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition; //导入依赖的package包/类
private void expandRelatedTypeComponents(XSTypeDefinition type, Vector componentList, String namespace, Map<String, Vector> dependencies) {
if (type instanceof XSComplexTypeDecl) {
expandRelatedComplexTypeComponents((XSComplexTypeDecl) type, componentList, namespace, dependencies);
}
else if (type instanceof XSSimpleTypeDecl) {
expandRelatedSimpleTypeComponents((XSSimpleTypeDefinition) type, componentList, namespace, dependencies);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:XSDHandler.java
示例16: addRelatedType
import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition; //导入依赖的package包/类
private void addRelatedType(XSTypeDefinition type, Vector componentList, String namespace, Map<String, Vector> dependencies) {
if (!type.getAnonymous()) {
if (!type.getNamespace().equals(SchemaSymbols.URI_SCHEMAFORSCHEMA)) { //REVISIT - do we use == instead
if (!componentList.contains(type)) {
final Vector importedNamespaces = findDependentNamespaces(namespace, dependencies);
addNamespaceDependency(namespace, type.getNamespace(), importedNamespaces);
componentList.add(type);
}
}
}
else {
expandRelatedTypeComponents(type, componentList, namespace, dependencies);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:XSDHandler.java
示例17: checkNotationType
import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition; //导入依赖的package包/类
/**
* Element/Attribute traversers call this method to check whether
* the type is NOTATION without enumeration facet
*/
void checkNotationType(String refName, XSTypeDefinition typeDecl, Element elem) {
if (typeDecl.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE &&
((XSSimpleType)typeDecl).getVariety() == XSSimpleType.VARIETY_ATOMIC &&
((XSSimpleType)typeDecl).getPrimitiveKind() == XSSimpleType.PRIMITIVE_NOTATION) {
if ((((XSSimpleType)typeDecl).getDefinedFacets() & XSSimpleType.FACET_ENUMERATION) == 0) {
reportSchemaError("enumeration-required-notation", new Object[]{typeDecl.getName(), refName, DOMUtil.getLocalName(elem)}, elem);
}
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:XSDAbstractTraverser.java
示例18: getSchemaDeterminedID
import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition; //导入依赖的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
示例19: addGlobalTypeDecl
import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition; //导入依赖的package包/类
public void addGlobalTypeDecl(XSTypeDefinition decl, String location) {
fGlobalTypeDeclsExt.put(((location!=null) ? location : "") + "," + decl.getName(), decl);
if (decl.getNamespaceItem() == null) {
if (decl instanceof XSComplexTypeDecl) {
((XSComplexTypeDecl) decl).setNamespaceItem(this);
}
else if (decl instanceof XSSimpleTypeDecl) {
((XSSimpleTypeDecl) decl).setNamespaceItem(this);
}
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:SchemaGrammar.java
示例20: setValues
import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition; //导入依赖的package包/类
public void setValues(String name, String targetNamespace,
XSTypeDefinition baseType, short derivedBy, short schemaFinal,
short block, short contentType,
boolean isAbstract, XSAttributeGroupDecl attrGrp,
XSSimpleType simpleType, XSParticleDecl particle) {
// don't allow this.
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:SchemaGrammar.java
注:本文中的com.sun.org.apache.xerces.internal.xs.XSTypeDefinition类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论