本文整理汇总了Java中org.apache.xerces.xs.XSConstants.SCOPE_GLOBAL属性的典型用法代码示例。如果您正苦于以下问题:Java XSConstants.SCOPE_GLOBAL属性的具体用法?Java XSConstants.SCOPE_GLOBAL怎么用?Java XSConstants.SCOPE_GLOBAL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.xerces.xs.XSConstants
的用法示例。
在下文中一共展示了XSConstants.SCOPE_GLOBAL属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: analyzeElement
private void analyzeElement(IXSDNode currentNode, XSParticleDecl fatherParticle, XSElementDecl elementDeclaration) {
if (logger.isDebugEnabled()) logger.debug("analyzeElement: " + elementDeclaration.getName());
String elementName = elementDeclaration.getName();
IXSDNode element = null;
if (elementDeclaration.getScope() == XSConstants.SCOPE_GLOBAL) {
if (logger.isDebugEnabled()) logger.debug(elementName + " has GLOBAL SCOPE");
element = globalElements.get(elementName);
if (element == null) {
element = createNewElement(elementDeclaration);
globalElements.put(elementName, element);
analyzeType(element, fatherParticle, elementDeclaration);
} else {
element.setNested(true);
element = element.clone();
setCardinality(element, fatherParticle);
}
} else {
element = createNewElement(elementDeclaration);
analyzeType(element, fatherParticle, elementDeclaration);
}
if (currentNode != null) {
currentNode.addChild(element);
}
}
示例2: getMatchingElemDecl
public XSElementDecl getMatchingElemDecl(QName element, XSElementDecl exemplar) {
if (element.localpart == exemplar.fName &&
element.uri == exemplar.fTargetNamespace) {
return exemplar;
}
// if the exemplar is not a global element decl, then it's not possible
// to be substituted by another element.
if (exemplar.fScope != XSConstants.SCOPE_GLOBAL) {
return null;
}
// if the decl blocks substitution, return false
if ((exemplar.fBlock & XSConstants.DERIVATION_SUBSTITUTION) != 0) {
return null;
}
// get the decl for the element
XSElementDecl eDecl = fXSElementDeclHelper.getGlobalElementDecl(element);
if (eDecl == null) {
return null;
}
// and check by using substitutionGroup information
if (substitutionGroupOK(eDecl, exemplar, exemplar.fBlock)) {
return eDecl;
}
return null;
}
示例3: addRelatedElement
private void addRelatedElement(XSElementDeclaration decl, Vector componentList, String namespace, Hashtable dependencies) {
if (decl.getScope() == XSConstants.SCOPE_GLOBAL) {
if (!componentList.contains(decl)) {
Vector importedNamespaces = findDependentNamespaces(namespace, dependencies);
addNamespaceDependency(namespace, decl.getNamespace(), importedNamespaces);
componentList.add(decl);
}
}
else {
expandRelatedElementComponents(decl, componentList, namespace, dependencies);
}
}
示例4: addRelatedAttribute
private void addRelatedAttribute(XSAttributeDeclaration decl, Vector componentList, String namespace, Hashtable dependencies) {
if (decl.getScope() == XSConstants.SCOPE_GLOBAL) {
if (!componentList.contains(decl)) {
Vector importedNamespaces = findDependentNamespaces(namespace, dependencies);
addNamespaceDependency(namespace, decl.getNamespace(), importedNamespaces);
componentList.add(decl);
}
}
else {
expandRelatedAttributeComponents(decl, componentList, namespace, dependencies);
}
}
示例5: checkElementDeclsConsistent
public static void checkElementDeclsConsistent(XSComplexTypeDecl type,
XSParticleDecl particle,
SymbolHash elemDeclHash,
SubstitutionGroupHandler sgHandler)
throws XMLSchemaException {
// check for elements in the tree with the same name and namespace
int pType = particle.fType;
if (pType == XSParticleDecl.PARTICLE_WILDCARD)
return;
if (pType == XSParticleDecl.PARTICLE_ELEMENT) {
XSElementDecl elem = (XSElementDecl)(particle.fValue);
findElemInTable(type, elem, elemDeclHash);
if (elem.fScope == XSConstants.SCOPE_GLOBAL) {
// Check for subsitution groups.
XSElementDecl[] subGroup = sgHandler.getSubstitutionGroup(elem);
for (int i = 0; i < subGroup.length; i++) {
findElemInTable(type, subGroup[i], elemDeclHash);
}
}
return;
}
XSModelGroupImpl group = (XSModelGroupImpl)particle.fValue;
for (int i = 0; i < group.fParticleCount; i++)
checkElementDeclsConsistent(type, group.fParticles[i], elemDeclHash, sgHandler);
}
示例6: processPSVIAttributeDeclarationOrRef
private void processPSVIAttributeDeclarationOrRef(XSAttributeDeclaration att) {
if (att == null)
return;
// for global attributes, and attributes that have already been printed,
// we always want to print references
if (att.getScope() == XSConstants.SCOPE_GLOBAL
|| fDefined.contains(this.getID(att))) {
processPSVIAttributeDeclarationRef(att);
}
else {
processPSVIAttributeDeclaration(att);
}
}
示例7: processPSVIElementDeclarationOrRef
private void processPSVIElementDeclarationOrRef(XSElementDeclaration elem) {
if (elem == null)
return;
// for global attributes, and attributes that have already been printed,
// we always want to print references
if (elem.getScope() == XSConstants.SCOPE_GLOBAL
|| fDefined.contains(this.getID(elem))) {
processPSVIElementDeclarationRef(elem);
}
else {
processPSVIElementDeclaration(elem);
}
}
示例8: processPSVIScope
private void processPSVIScope(
String enclose,
XSComplexTypeDefinition enclosingCTD,
short scope) {
if (scope == XSConstants.SCOPE_ABSENT || scope == XSConstants.SCOPE_GLOBAL) {
sendElementEvent(enclose, this.translateScope(scope));
} else { // XSConstants.SCOPE_LOCAL
processPSVITypeDefinitionRef(enclose, enclosingCTD);
}
}
示例9: translateScope
private String translateScope(short scope) {
switch (scope) {
case XSConstants.SCOPE_ABSENT :
return null;
case XSConstants.SCOPE_GLOBAL :
return "global";
case XSConstants.SCOPE_LOCAL :
return "local";
default :
return "unknown";
}
}