本文整理汇总了Java中org.apache.xerces.impl.xs.XSComplexTypeDecl类的典型用法代码示例。如果您正苦于以下问题:Java XSComplexTypeDecl类的具体用法?Java XSComplexTypeDecl怎么用?Java XSComplexTypeDecl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XSComplexTypeDecl类属于org.apache.xerces.impl.xs包,在下文中一共展示了XSComplexTypeDecl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkComplexType
import org.apache.xerces.impl.xs.XSComplexTypeDecl; //导入依赖的package包/类
public static boolean checkComplexType(XSTypeDefinition td) {
if (td.getTypeCategory() != XSTypeDefinition.COMPLEX_TYPE) {
return false;
}
XSComplexTypeDefinition ctd = (XSComplexTypeDefinition) td;
if (ctd.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_ELEMENT) {
return true;
}
if ((td instanceof XSComplexTypeDecl) && ((XSComplexTypeDecl) td).getAbstract()) {
return true;
}
if (TEXT_ELEMENTS_ARE_COMPLEX) {
return true;
}
if (ctd.getAttributeUses() != null) {
for (int i = 0; i < ctd.getAttributeUses().getLength(); i++) {
XSSimpleTypeDefinition xsstd = ((XSAttributeUse) ctd.getAttributeUses().item(i)).getAttrDeclaration()
.getTypeDefinition();
if ("ID".equals(xsstd.getName())) {
continue;
}
return true;
}
}
return false;
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:27,代码来源:XSDModelLoader.java
示例2: checkComplexType
import org.apache.xerces.impl.xs.XSComplexTypeDecl; //导入依赖的package包/类
public static boolean checkComplexType(XSTypeDefinition td) {
if (td.getTypeCategory() != XSTypeDefinition.COMPLEX_TYPE) return false;
XSComplexTypeDefinition ctd = (XSComplexTypeDefinition) td;
if (ctd.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_ELEMENT) {
return true;
}
if ((td instanceof XSComplexTypeDecl) && ((XSComplexTypeDecl) td).getAbstract()) return true;
if (TEXT_ELEMENTS_ARE_COMPLEX) return true;
if (ctd.getAttributeUses() != null) {
for (int i = 0; i < ctd.getAttributeUses().getLength(); i++) {
XSSimpleTypeDefinition xsstd = ((XSAttributeUse) ctd.getAttributeUses().item(i)).getAttrDeclaration().getTypeDefinition();
if ("ID".equals(xsstd.getName())) continue;
return true;
}
}
return false;
}
示例3: isDerivedFrom
import org.apache.xerces.impl.xs.XSComplexTypeDecl; //导入依赖的package包/类
/**
* Introduced in DOM Level 2. <p>
* Checks if a type is derived from another by restriction. See:
* http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-isDerivedFrom
*
* @param typeNamespaceArg
* The namspace of the ancestor type declaration
* @param typeNameArg
* The name of the ancestor type declaration
* @param derivationMethod
* The derivation method
*
* @return boolean True if the type is derived by restriciton for the
* reference type
*/
public boolean isDerivedFrom(String typeNamespaceArg, String typeNameArg,
int derivationMethod) {
if(needsSyncData()) {
synchronizeData();
}
if (type != null) {
if (type instanceof XSSimpleTypeDecl) {
return ((XSSimpleTypeDecl) type).isDOMDerivedFrom(
typeNamespaceArg, typeNameArg, derivationMethod);
} else if (type instanceof XSComplexTypeDecl) {
return ((XSComplexTypeDecl) type).isDOMDerivedFrom(
typeNamespaceArg, typeNameArg, derivationMethod);
}
}
return false;
}
示例4: traverseLocal
import org.apache.xerces.impl.xs.XSComplexTypeDecl; //导入依赖的package包/类
/**
* Traverse local complexType declarations
*
* @param Element
* @param XSDocumentInfo
* @param SchemaGrammar
* @return XSComplexTypeDecl
*/
XSComplexTypeDecl traverseLocal(Element complexTypeNode,
XSDocumentInfo schemaDoc,
SchemaGrammar grammar) {
Object[] attrValues = fAttrChecker.checkAttributes(complexTypeNode, false,
schemaDoc);
String complexTypeName = genAnonTypeName(complexTypeNode);
contentBackup();
XSComplexTypeDecl type = traverseComplexTypeDecl (complexTypeNode,
complexTypeName, attrValues, schemaDoc, grammar);
contentRestore();
// need to add the type to the grammar for later constraint checking
grammar.addComplexTypeDecl(type, fSchemaHandler.element2Locator(complexTypeNode));
type.setIsAnonymous();
fAttrChecker.returnAttrArray(attrValues, schemaDoc);
return type;
}
示例5: handleComplexTypeError
import org.apache.xerces.impl.xs.XSComplexTypeDecl; //导入依赖的package包/类
private void handleComplexTypeError(String messageId,Object[] args,
Element e) {
if (messageId!=null) {
reportSchemaError(messageId, args, e);
}
//
// Mock up the typeInfo structure so that there won't be problems during
// validation
//
fBaseType = SchemaGrammar.fAnyType;
fContentType = XSComplexTypeDecl.CONTENTTYPE_MIXED;
fXSSimpleType = null;
fParticle = getErrorContent();
// REVISIT: do we need to remove all attribute uses already added into
// the attribute group? maybe it's ok to leave them there. -SG
fAttrGrp.fAttributeWC = getErrorWildcard();
return;
}
示例6: contentRestore
import org.apache.xerces.impl.xs.XSComplexTypeDecl; //导入依赖的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];
}
示例7: toString
import org.apache.xerces.impl.xs.XSComplexTypeDecl; //导入依赖的package包/类
@Override
public String toString()
{
StringBuffer rtBuffer=new StringBuffer();
if (getCoreObject()==null)
return null;
if (getCoreObject().getNamespace()!=null)
rtBuffer.append(getCoreObject().getNamespace()+":");
rtBuffer.append(getCoreObject().getName());
if (getCoreObject() instanceof XSElementDecl)
rtBuffer.append(" (Element)");
else if (getCoreObject() instanceof XSComplexTypeDecl)
rtBuffer.append(" (Complex Type)");
else if (getCoreObject() instanceof XSSimpleTypeDecl)
rtBuffer.append(" (Smple Type)");
else
rtBuffer.append(" (Unknown)");
return rtBuffer.toString();
}
示例8: testXercesGrammar
import org.apache.xerces.impl.xs.XSComplexTypeDecl; //导入依赖的package包/类
public void testXercesGrammar() throws Exception {
XSModel xsModel = getXSModel("test.xml", "test.xsd");
XSElementDeclaration elementDeclaration = xsModel.getElementDeclaration("a", "");
XSComplexTypeDefinition typeDefinition = (XSComplexTypeDefinition)elementDeclaration.getTypeDefinition();
CMBuilder cmBuilder = new CMBuilder(new CMNodeFactory());
XSCMValidator validator = cmBuilder.getContentModel((XSComplexTypeDecl)typeDefinition, true);
int[] ints = validator.startContentModel();
Vector vector = validator.whatCanGoHere(ints);
XSElementDecl o = (XSElementDecl)vector.get(0);
assertEquals("b", o.getName());
}
示例9: testXercesIncomplete
import org.apache.xerces.impl.xs.XSComplexTypeDecl; //导入依赖的package包/类
public void testXercesIncomplete() throws Exception {
XSModel xsModel = getXSModel("testIncomplete.xml", "test.xsd");
XSElementDeclaration elementDeclaration = xsModel.getElementDeclaration("a", "");
XSComplexTypeDefinition typeDefinition = (XSComplexTypeDefinition)elementDeclaration.getTypeDefinition();
CMBuilder cmBuilder = new CMBuilder(new CMNodeFactory());
XSCMValidator validator = cmBuilder.getContentModel((XSComplexTypeDecl)typeDefinition, true);
int[] ints = validator.startContentModel();
Vector vector = validator.whatCanGoHere(ints);
XSElementDecl o = (XSElementDecl)vector.get(0);
assertEquals("b", o.getName());
}
示例10: manageComplexTypeElement
import org.apache.xerces.impl.xs.XSComplexTypeDecl; //导入依赖的package包/类
private void manageComplexTypeElement(IXSDNode currentNode, XSParticleDecl fatherParticle, XSElementDecl currentElementDeclaration) {
if (logger.isDebugEnabled()) logger.debug("Found a complex type: " + currentElementDeclaration.getName());
setCardinality(currentNode, fatherParticle);
XSComplexTypeDecl complexTypeDefinition = (XSComplexTypeDecl) currentElementDeclaration.getTypeDefinition();
if (checkContentTypeMixed(complexTypeDefinition)) {
currentNode.setMixedContent(true);
if (logger.isDebugEnabled()) logger.debug("Current node: " + currentNode + " with father particle: " + fatherParticle + " and current element declaration: " + currentElementDeclaration);
}
XSParticleDecl currentParticle = (XSParticleDecl) complexTypeDefinition.getParticle();
analyzeAttributes(currentNode, currentElementDeclaration);
if (currentParticle == null){
return;
}
analyzeParticle(currentNode, fatherParticle, currentParticle);
}
示例11: checkContentTypeMixed
import org.apache.xerces.impl.xs.XSComplexTypeDecl; //导入依赖的package包/类
private boolean checkContentTypeMixed(XSComplexTypeDecl complexTypeDefinition){
if (logger.isDebugEnabled()) logger.debug("ContentType = " + complexTypeDefinition.getContentType());
if(complexTypeDefinition.getContentType() == XSComplexTypeDecl.CONTENTTYPE_MIXED){
return true;
} else{
return false;
}
}
示例12: getTypeName
import org.apache.xerces.impl.xs.XSComplexTypeDecl; //导入依赖的package包/类
/**
* @see org.w3c.dom.TypeInfo#getTypeName()
*/
public String getTypeName() {
if (type !=null){
if (type instanceof XSSimpleTypeDecl) {
return ((XSSimpleTypeDecl) type).getTypeName();
} else if (type instanceof XSComplexTypeDecl) {
return ((XSComplexTypeDecl) type).getTypeName();
}
}
return null;
}
示例13: expandRelatedTypeComponents
import org.apache.xerces.impl.xs.XSComplexTypeDecl; //导入依赖的package包/类
private void expandRelatedTypeComponents(XSTypeDefinition type, Vector componentList, String namespace, Hashtable dependencies) {
if (type instanceof XSComplexTypeDecl) {
expandRelatedComplexTypeComponents((XSComplexTypeDecl) type, componentList, namespace, dependencies);
}
else if (type instanceof XSSimpleTypeDecl) {
expandRelatedSimpleTypeComponents((XSSimpleTypeDefinition) type, componentList, namespace, dependencies);
}
}
示例14: expandRelatedComplexTypeComponents
import org.apache.xerces.impl.xs.XSComplexTypeDecl; //导入依赖的package包/类
private void expandRelatedComplexTypeComponents(XSComplexTypeDecl type, Vector componentList, String namespace, Hashtable dependencies) {
addRelatedType(type.getBaseType(), componentList, namespace, dependencies);
expandRelatedAttributeUsesComponents(type.getAttributeUses(), componentList, namespace, dependencies);
final XSParticle particle = type.getParticle();
if (particle != null) {
expandRelatedParticleComponents(particle, componentList, namespace, dependencies);
}
}
示例15: traverseLocalElements
import org.apache.xerces.impl.xs.XSComplexTypeDecl; //导入依赖的package包/类
/**
* Traverse all the deferred local elements. This method should be called
* by traverseSchemas after we've done with all the global declarations.
*/
void traverseLocalElements() {
fElementTraverser.fDeferTraversingLocalElements = false;
for (int i = 0; i < fLocalElemStackPos; i++) {
Element currElem = fLocalElementDecl[i];
//XSDocumentInfo currSchema = (XSDocumentInfo)fDoc2XSDocumentMap.get(DOMUtil.getDocument(currElem));
//XSDocumentInfo currSchema = (XSDocumentInfo)fDoc2XSDocumentMap.get(DOMUtil.getRoot(DOMUtil.getDocument(currElem)));
XSDocumentInfo currSchema = fLocalElementDecl_schema[i];
SchemaGrammar currGrammar = fGrammarBucket.getGrammar(currSchema.fTargetNamespace);
fElementTraverser.traverseLocal (fParticle[i], currElem, currSchema, currGrammar, fAllContext[i], fParent[i], fLocalElemNamespaceContext[i]);
// If it's an empty particle, remove it from the containing component.
if (fParticle[i].fType == XSParticleDecl.PARTICLE_EMPTY) {
XSModelGroupImpl group = null;
if (fParent[i] instanceof XSComplexTypeDecl) {
XSParticle p = ((XSComplexTypeDecl)fParent[i]).getParticle();
if (p != null)
group = (XSModelGroupImpl)p.getTerm();
}
else {
group = ((XSGroupDecl)fParent[i]).fModelGroup;
}
if (group != null)
removeParticle(group, fParticle[i]);
}
}
}