private static Collection<? extends XSDeclaration> findModelGroups(final XSComplexType complexType) { XSContentType contentType = complexType.getExplicitContent(); if (contentType == null) { contentType = complexType.getContentType(); } final XSParticle particle = contentType.asParticle(); if (particle != null && !particle.isRepeated()) { final XSTerm term = particle.getTerm(); if (term instanceof XSModelGroupDecl) { return Collections.singletonList((XSModelGroupDecl)term); } else { final XSModelGroup modelGroup = term.asModelGroup(); return modelGroup != null ? findModelGroups(modelGroup) : Collections.<XSModelGroupDecl>emptyList(); } } else { return Collections.emptyList(); } }
/** * @param name the type name (note, the type may have a null name if an anonymous type) */ protected Type loadComplexType(Schema schema, String name, XSType type) throws TypeBindingException { XSType baseType = type.getBaseType(); ComplexType superType = null; // the anyType is the basetype of itself if (baseType.getBaseType() != baseType) { // have a base type if (baseType.isComplexType()) { superType = (ComplexType) loadType(schema, baseType, name); } else { log.warn("Complex type has a non complex type super type???"); } } XSComplexType xsct = type.asComplexType(); // try to get the delta content XSContentType content = xsct.getExplicitContent(); // if none get the entire content if (content == null) { content = xsct.getContentType(); } Type ret = createComplexType(schema, superType, name, content, xsct.isAbstract()); if (ret != null && ret instanceof ComplexType) { // load attributes if any loadAttributes(schema, xsct, (ComplexType) ret); } return ret; }
public boolean isApplicable(XSComplexType ct) { if (!bgmBuilder.isGenerateMixedExtensions()) return false; XSType bt = ct.getBaseType(); if (bt.isComplexType() && bt.asComplexType().isMixed() && ct.isMixed() && ct.getDerivationMethod()==XSType.EXTENSION && ct.getContentType().asParticle() != null && ct.getExplicitContent().asEmpty() == null ) { return true; } return false; }
public boolean isApplicable(XSComplexType ct) { if (!bgmBuilder.isGenerateMixedExtensions()) return false; XSType bt = ct.getBaseType(); if (bt.isComplexType() && bt.asComplexType().isMixed() && ct.isMixed() && ct.getDerivationMethod()==XSType.EXTENSION && ct.getContentType().asParticle() != null && ct.getExplicitContent().asEmpty() == null ) { return true; } return false; }
public boolean isApplicable(XSComplexType ct) { if (!bgmBuilder.isGenerateMixedExtensions()) return false; XSType bt = ct.getBaseType(); if (bt.isComplexType() && bt.asComplexType().isMixed() && ct.isMixed() && ct.getDerivationMethod()==XSType.EXTENSION && ct.getContentType().asParticle() != null && ct.getExplicitContent().asEmpty() == null ) { return true; } return false; }
public boolean isApplicable(XSComplexType ct) { if (!bgmBuilder.isGenerateMixedExtensions()) return false; XSType bt = ct.getBaseType(); if (bt.isComplexType() && bt.asComplexType().isMixed() && ct.isMixed() && ct.getDerivationMethod()==XSType.EXTENSION && ct.getContentType().asParticle() != null && ct.getExplicitContent().asEmpty() == null ) { return true; } return false; }
public boolean isApplicable(XSComplexType ct) { if (!bgmBuilder.isGenerateMixedExtensions()) return false; XSType bt = ct.getBaseType(); if (bt.isComplexType() && bt.asComplexType().isMixed() && ct.isMixed() && ct.getDerivationMethod()==XSType.EXTENSION && ct.getContentType().asParticle() != null && ct.getExplicitContent().asEmpty() == null ) { return true; } return false; }
NameClass enc = getNameClass(thisType.getExplicitContent());
NameClass enc = getNameClass(thisType.getExplicitContent());
/** * This method converts a complex XSD type to a UML class * @param type is non-null complex type definition * @param intoClass is non-null uml class to describe the XSD type into */ private void processComplexType(XSComplexType type, Classifier intoClass) { XSContentType contentType; intoClass.setAbstract( type.isAbstract() ); assignSuperclass( type, intoClass ); // describe type as an XSAttContainer processAttributeContainer( type, intoClass ); // describe the specific contents of this type // NOTE: type.getExplicitContent() should be used but it actually misses some specific definitions // in in-lined types contentType = type.getExplicitContent(); if ( contentType == null ) { contentType = type.getContentType(); } if ( contentType instanceof XSSimpleType ) { // handle the restriction/extension as THIS type (the superclass identified here is the correct one) processSimpleContent( contentType.asSimpleType(), intoClass ); } else if ( contentType instanceof XSParticle ) { processParticleAsComplexTypeContent( contentType.asParticle(), intoClass ); } }
boolean forceFallbackInExtension = baseType.isMixed() && ct.isMixed() && (ct.getExplicitContent() != null) && bgmBuilder.inExtensionMode; if (forceFallbackInExtension) {
XSContentType explicitContent = ct.getExplicitContent();
XSContentType explicitContent = ct.getExplicitContent();
XSContentType explicitContent = ct.getExplicitContent();
XSContentType explicitContent = ct.getExplicitContent();
boolean forceFallbackInExtension = baseType.isMixed() && ct.isMixed() && (ct.getExplicitContent() != null) && bgmBuilder.inExtensionMode; if (forceFallbackInExtension) {
boolean forceFallbackInExtension = baseType.isMixed() && ct.isMixed() && (ct.getExplicitContent() != null) && bgmBuilder.inExtensionMode; if (forceFallbackInExtension) {
boolean forceFallbackInExtension = baseType.isMixed() && ct.isMixed() && (ct.getExplicitContent() != null) && bgmBuilder.inExtensionMode; if (forceFallbackInExtension) {
XSContentType explicitContent = ct.getExplicitContent();
boolean forceFallbackInExtension = baseType.isMixed() && ct.isMixed() && (ct.getExplicitContent() != null) && bgmBuilder.inExtensionMode; if (forceFallbackInExtension) {