Refine search
public void schemaSet(XSSchemaSet xss) { if(!visited.add(xss)) return; for (XSSchema xs : xss.getSchemas()) { schema(xs); } }
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; }
public List<XSComplexType> getSubtypes() { ArrayList subtypeList = new ArrayList(); Iterator<XSComplexType> cTypes = getRoot().iterateComplexTypes(); while (cTypes.hasNext()) { XSComplexType cType= cTypes.next(); XSType base = cType.getBaseType(); if ((base != null) && (base.equals(this))) { subtypeList.add(cType); } } return subtypeList; }
public boolean isApplicable(XSComplexType ct) { XSType baseType = ct.getBaseType(); return baseType!=schemas.getAnyType() && baseType.isComplexType() && ct.getDerivationMethod()==XSType.EXTENSION; }
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 ClassSelector() { classBinder = new Abstractifier(new DefaultClassBinder()); Ring.add(ClassBinder.class,classBinder); classScopes.push(null); // so that the getClassFactory method returns null XSComplexType anyType = Ring.get(XSSchemaSet.class).getComplexType(WellKnownNamespace.XML_SCHEMA,"anyType"); bindMap.put(anyType,new Binding(anyType,CBuiltinLeafInfo.ANYTYPE)); }
XSElementDecl xelement = model.schemaComponent.getElementDecl(element.getNamespaceURI(), element.getLocalPart()); if (xelement!=null) if (type!=null && type.isGlobal()) QName qname = new QName(type.getTargetNamespace(), type.getName()); TypeAndAnnotation taa = s2jModel.getJavaType(qname); if (taa!=null)
/** * Runs the check. */ void run() { for( XSSchema s : Ring.get(XSSchemaSet.class).getSchemas() ) { schema(s); run( s.getAttGroupDecls() ); run( s.getAttributeDecls() ); run( s.getComplexTypes() ); run( s.getElementDecls() ); run( s.getModelGroupDecls() ); run( s.getNotations() ); run( s.getSimpleTypes() ); } }
protected Object resolveReference( UName name ) { Object o = super.schema.getSimpleType( name.getNamespaceURI(), name.getName() ); if(o!=null) return o; return super.schema.getComplexType( name.getNamespaceURI(), name.getName()); } protected String getErrorProperty() {
public boolean isApplicable(XSComplexType ct) { return ct.getBaseType()==schemas.getAnyType() && !ct.isMixed(); // not mixed }
private void interpretElement(XSElementDecl el, XSSchemaSet sset) { XSComplexType cType; XSSimpleType xs; if (el.getType() instanceof XSComplexType && el.getType() != sset.getAnyType()) { cType = (XSComplexType) el.getType(); processComplexType(cType, el.getName(), sset); } else if (el.getType() instanceof XSSimpleType && el.getType() != sset.getAnySimpleType()) { xs = el.getType().asSimpleType(); processSimpleType(xs, el.getName()); } }
/** * Evaluates the SCD against the whole schema set and * returns the matched node. * * @return * null if the SCD didn't match anything. If the SCD matched more than one node, * the first one will be returned. */ public final XSComponent selectSingle(XSSchemaSet contextNode) { Iterator<XSComponent> r = select(contextNode.iterateSchema()); if(r.hasNext()) return r.next(); return null; }
/** * Create ComplexTypeDefinitions from all top-level complexType definitions * in the XSD. * * These definitions are the reused later to fit inside PropertyContainer * definitions. * * @param set * XS Schema Set */ private void processComplexTypeDefinitions(XSSchemaSet set) throws SchemaException { Iterator<XSComplexType> iterator = set.iterateComplexTypes(); while (iterator.hasNext()) { XSComplexType complexType = iterator.next(); if (complexType.getTargetNamespace().equals(schema.getNamespace())) { LOGGER.trace("### processing CTD {} into {} [{}]", complexType, schema, shortDescription); processComplexTypeDefinition(complexType); } } }
protected Object resolveReference( UName name ) { return super.schema.getElementDecl( name.getNamespaceURI(), name.getName()); }
/** * Performs error check */ public void errorCheck() { ErrorReceiver er = Ring.get(ErrorReceiver.class); for (QName n : enumBaseTypes) { XSSchemaSet xs = Ring.get(XSSchemaSet.class); XSSimpleType st = xs.getSimpleType(n.getNamespaceURI(), n.getLocalPart()); if(st==null) { er.error(loc,Messages.ERR_UNDEFINED_SIMPLE_TYPE.format(n)); continue; } if(!SimpleTypeBuilder.canBeMappedToTypeSafeEnum(st)) { er.error(loc,Messages.ERR_CANNOT_BE_BOUND_TO_SIMPLETYPE.format(n)); continue; } } }
protected Object resolveReference( UName name ) { return super.schema.getSimpleType( name.getNamespaceURI(), name.getName()); }
private ComplexTypeDefinition getOrProcessComplexType(QName typeName) throws SchemaException { ComplexTypeDefinition complexTypeDefinition = schema.findComplexTypeDefinition(typeName); if (complexTypeDefinition != null) { return complexTypeDefinition; } // The definition is not yet processed (or does not exist). Let's try to // process it. XSComplexType complexType = xsSchemaSet.getComplexType(typeName.getNamespaceURI(), typeName.getLocalPart()); return processComplexTypeDefinition(complexType); }
protected Object resolveReference( UName name ) { return super.schema.getAttGroupDecl( name.getNamespaceURI(), name.getName()); }
protected Object resolveReference( UName name ) { return super.schema.getAttributeDecl( name.getNamespaceURI(), name.getName()); }
protected Object resolveReference( UName name ) { return super.schema.getIdentityConstraint( name.getNamespaceURI(), name.getName()); }