Refine search
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 void complexType(XSComplexType type) { if (shouldWalk && visited.add(type.getContentType())) { type.getContentType().visit(this); for (XSAttributeUse u : type.getAttributeUses()) if (shouldWalk && visited.add(u)) attributeUse(u); } }
@Override public QName complexType(final XSComplexType type) { if (type.getName() == null) { return new QName(type.getTargetNamespace(), "anonymousComplexType"); } else { return new QName(type.getTargetNamespace(), type.getName()); } } };
public boolean isApplicable(XSComplexType ct) { XSType baseType = ct.getBaseType(); return baseType!=schemas.getAnyType() && baseType.isComplexType() && ct.getDerivationMethod()==XSType.EXTENSION; }
public void complexType( XSComplexType type ) { println(MessageFormat.format("<complexType{0}>", type.isLocal()?"":" name=\""+type.getName()+'\"')); indent++; if(type.getContentType().asSimpleType()!=null) { XSType baseType = type.getBaseType(); if(type.getDerivationMethod()==XSType.RESTRICTION) { if( type.isGlobal() && type.getTargetNamespace().equals(baseType.getTargetNamespace()) && type.getName().equals(baseType.getName())) { indent++; println("<redefine>"); XSComplexType baseType = type.getBaseType().asComplexType(); if(type.getDerivationMethod()==XSType.RESTRICTION) { baseType.getTargetNamespace(), baseType.getName())); indent++; type.getContentType().visit(this); dumpComplexTypeAttribute(type); baseType.getTargetNamespace(), baseType.getName())); if( type.isGlobal()
public boolean isApplicable(XSComplexType ct) { XSType bt = ct.getBaseType(); if(bt ==schemas.getAnyType() && ct.isMixed()) return true; // fresh mixed complex type // there's no complex type in the inheritance tree yet if (bt.isComplexType() && !bt.asComplexType().isMixed() && ct.isMixed() && ct.getDerivationMethod() == XSType.EXTENSION) { if (!bgmBuilder.isGenerateMixedExtensions() && (ct.getContentType().asParticle() == null)) { return false; } return true; } return false; }
if (complex.isGlobal()) { complexClass = ontology.createClass(getURI(mainURI, complex)); if (parentURI != null) { } else if (complex.isLocal()) { complexClass = ontology.createClass(parentURI); XSType baseType = complex.getBaseType(); String baseURI = getURI(mainURI, baseType); Iterator<? extends XSAttributeUse> attributeUses = complex.getAttributeUses().iterator(); while (attributeUses.hasNext()) { XSAttributeUse attributeUse = (XSAttributeUse) attributeUses.next(); if (complex.getDerivationMethod() == XSType.EXTENSION) { complexClass.addSuperClass(ontology.createClass(baseURI)); XSContentType expl = complex.getExplicitContent(); if (expl != null) { XSParticle particle = expl.asParticle(); if (particle != null) { XSTerm term = particle.getTerm(); } else if (complex.getDerivationMethod() == XSType.RESTRICTION && baseURI.equals("http://www.w3.org/2001/XMLSchema#anyType")) { XSParticle particle = complex.getContentType().asParticle(); if (particle != null) { XSTerm term = particle.getTerm();
public void run() throws SAXException { XSType t = baseType.getType(); if (t.isComplexType() && t.asComplexType().getContentType().asParticle()!=null) { $runtime.reportError( Messages.format(Messages.ERR_SIMPLE_CONTENT_EXPECTED, t.getTargetNamespace(), t.getName()), loc); } } });
public void build(XSComplexType ct) { XSComplexType baseType = ct.getBaseType().asComplexType(); // build the base class CClass baseClass = selector.bindToType(baseType, ct, true); assert baseClass != null; // global complex type must map to a class if (!checkIfExtensionSafe(baseType, ct)) { // error. We can't handle any further extension errorReceiver.error(ct.getLocator(), Messages.ERR_NO_FURTHER_EXTENSION.format( baseType.getName(), ct.getName() ) ); return; } selector.getCurrentBean().setBaseClass(baseClass); builder.recordBindingMode(ct, ComplexTypeBindingMode.FALLBACK_EXTENSION); BIProperty prop = BIProperty.getCustomization(ct); CPropertyInfo p; RawTypeSet ts = RawTypeSetBuilder.build(ct.getContentType().asParticle(), false); p = prop.createDummyExtendedMixedReferenceProperty("contentOverrideFor" + ct.getName(), ct, ts); selector.getCurrentBean().addProperty(p); // adds attributes and we are through. green.attContainer(ct); }
XSComplexType baseType = ct.getBaseType().asComplexType(); assert baseClass!=null; // global complex type must map to a class selector.getCurrentBean().setBaseClass(baseClass); boolean forceFallbackInExtension = baseType.isMixed() && ct.isMixed() && (ct.getExplicitContent() != null) && bgmBuilder.inExtensionMode; if (forceFallbackInExtension) { CPropertyInfo p; XSParticle particle = ct.getContentType().asParticle(); if (particle != null) { RawTypeSet ts = RawTypeSetBuilder.build(particle, false); p = prop.createDummyExtendedMixedReferenceProperty("Content", ct, ts); selector.getCurrentBean().addProperty(p);
Struct st = null; XSType parent; String typeName = cType.getName(); String nameSpace = cType.getTargetNamespace(); if (typeName == null) { typeName = elementName != null ? elementName + "Type" while (parent != sset.getAnyType()) { if (parent.isComplexType()) { write(st, parent.asComplexType(), true, sset); parent = parent.getBaseType(); st.setParent(cType.getBaseType().getName());
public boolean isApplicable(XSComplexType ct) { if( !bgmBuilder.getGlobalBinding().isChoiceContentPropertyEnabled() ) return false; if( ct.getBaseType()!=schemas.getAnyType() ) // My reading of the spec is that if a complex type is // derived from another complex type by extension, // its top level model group is always a sequence // that combines the base type content model and // the extension defined in the new complex type. return false; XSParticle p = ct.getContentType().asParticle(); if(p==null) return false; XSModelGroup mg = getTopLevelModelGroup(p); if( mg.getCompositor()!=XSModelGroup.CHOICE ) return false; if( p.isRepeated() ) return false; return true; }
public void complexType(XSComplexType ct) { if(!visited.add(ct)) return; refer(ct,ct.getBaseType()); ct.getBaseType().visit(this); ct.getContentType().visit(this); }
/** * @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 CElement complexType(XSComplexType type) { CElement ci = allow(type,type.getName()); if(ci!=null) return ci; if(type.isGlobal()) { QName tagName = null; String className = deriveName(type); Locator loc = type.getLocator(); JPackage pkg = selector.getPackage(type.getTargetNamespace()); return new CClassInfo(model,pkg,className, loc,getTypeName(type),tagName,type,bi.toCustomizationList()); } else { XSElementDecl element = type.getScope(); return new CClassInfo( model, selector.getClassScope(), deriveName(element), element.getLocator(), null, getName(element), element, bi.toCustomizationList() ); type.getOwnerSchema() ).get(BISchemaBinding.class); if(sb!=null) className = sb.mangleAnonymousTypeClassName(className); scope = selector.getClassScope(); return new CClassInfo(model, scope, className, type.getLocator(), null, null, type, bi.toCustomizationList() );
public void build(XSComplexType ct) { assert ct.getDerivationMethod()==XSType.EXTENSION; // base type is a simple type XSSimpleType baseType = ct.getBaseType().asSimpleType(); // determine the binding of this complex type. builder.recordBindingMode(ct,ComplexTypeBindingMode.NORMAL); simpleTypeBuilder.refererStack.push(ct); TypeUse use = simpleTypeBuilder.build(baseType); simpleTypeBuilder.refererStack.pop(); BIProperty prop = BIProperty.getCustomization(ct); CPropertyInfo p = prop.createValueProperty("Value",false,baseType,use, BGMBuilder.getName(baseType)); selector.getCurrentBean().addProperty(p); // adds attributes and we are through. green.attContainer(ct); }
private boolean containingChoice(CClassInfo typeBean) { XSComponent component = typeBean.getSchemaComponent(); if (component instanceof XSComplexType) { XSContentType contentType = ((XSComplexType) component).getContentType(); XSParticle particle = contentType.asParticle(); if (particle != null) { XSTerm term = particle.getTerm(); XSModelGroup modelGroup = term.asModelGroup(); if (modelGroup != null) { return (modelGroup.getCompositor() == XSModelGroup.Compositor.CHOICE); } } } return false; }
public void build(XSComplexType ct) { XSContentType contentType = ct.getContentType(); builder.recordBindingMode(ct, FALLBACK_CONTENT); BIProperty prop = BIProperty.getCustomization(ct); CPropertyInfo p; if(contentType.asEmpty()!=null) { p = prop.createValueProperty("Content",false,ct,CBuiltinLeafInfo.STRING,null); } else { RawTypeSet ts = RawTypeSetBuilder.build(contentType.asParticle(),false); p = prop.createReferenceProperty("Content", false, ct, ts, true, false, true, false); } selector.getCurrentBean().addProperty(p); // adds attributes and we are through. green.attContainer(ct); }
/** * 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 ); } }
protected void processComplexType(XSComplexType complexType, ParseContext parseContext) throws Exception { XSParticle particle = complexType.getContentType().asParticle(); if (particle != null) { processParticle(particle, parseContext); } XSSimpleType xsSimpleType = complexType.getContentType().asSimpleType(); if (xsSimpleType != null) { processText("value", xsSimpleType, parseContext); } Collection<? extends XSAttributeUse> c = complexType.getAttributeUses(); Iterator<? extends XSAttributeUse> i = c.iterator(); while(i.hasNext()) { XSAttributeUse attUse = i.next(); processAttribute(attUse, parseContext); } }