private boolean isCycle( XSComplexTypeDefinition typeDef, List<XSElementDeclaration> parentEls, List<XSComplexTypeDefinition> parentCTs ) { if ( typeDef.getName() != null ) { for ( XSComplexTypeDefinition ct : parentCTs ) { if ( ct.getName() != null ) { if ( typeDef.getName().equals( ct.getName() ) && typeDef.getNamespace().equals( ct.getNamespace() ) ) { handleCycle( parentEls, parentCTs ); return true; } } } } return false; }
private void export( XMLStreamWriter writer, CustomPropertyType pt ) throws XMLStreamException { XSComplexTypeDefinition xsTypeDef = pt.getXSDValueType(); if ( xsTypeDef == null ) { LOG.warn( "Type definition null inside " + pt.getName() + " property type." ); } else { if ( !xsTypeDef.getAnonymous() ) { QName qName = new QName( xsTypeDef.getNamespace(), xsTypeDef.getName() ); writer.writeAttribute( "type", getPrefixedName( qName ) ); } else { LOG.debug( "Exporting anonymous type " + xsTypeDef ); exportType( writer, xsTypeDef ); } } }
public int getCorrespondingGmlGeometryTypeCode() { XSComplexTypeDefinition type = (XSComplexTypeDefinition) getElementDecl() .getTypeDefinition(); if (type == null) { type = getElementDecl().getEnclosingCTDefinition(); } while ((type.getNamespace() == null) || (!type.getNamespace().equals("http://www.opengis.net/gml"))) { type = (XSComplexTypeDefinition) type.getBaseType(); } int geomCode = GmlConstantUtils.getGmlGeometryCode(type.getName()); return geomCode; } }
public int getCorrespondingGmlTopologyTypeCode() { XSComplexTypeDefinition type = (XSComplexTypeDefinition) getElementDecl() .getTypeDefinition(); if (type == null) { type = getElementDecl().getEnclosingCTDefinition(); } while ((type.getNamespace() == null) || (!type.getNamespace().equals("http://www.opengis.net/gml"))) { type = (XSComplexTypeDefinition) type.getBaseType(); } int topoCode = GmlConstantUtils.getGmlTopologyCode(type.getName()); return topoCode; } }
public QName getGeometryType(XSComplexTypeDefinition type) { String namespaceUri = type.getNamespace(); String localName = type.getName(); QName typeName = new QName(namespaceUri, localName); if (this.gmlConstantUtils_.isGeometryType(typeName)) { return typeName; } XSComplexTypeDefinition parent = (XSComplexTypeDefinition) type .getBaseType(); if ((parent == type) || (parent == null)) { return null; } return getGeometryType(type); }
private PropertyType buildPropertyType( XSElementDeclaration elementDecl, XSComplexTypeDefinition typeDef, int minOccurs, int maxOccurs, List<PropertyType> ptSubstitutions ) { PropertyType pt = null; QName ptName = createQName( elementDecl.getNamespace(), elementDecl.getName() ); LOG.trace( "- Property definition '" + ptName + "' uses a complex type for content definition." ); // check for well known GML property declarations first if ( typeDef.getName() != null ) { QName typeName = createQName( typeDef.getNamespace(), typeDef.getName() ); if ( typeName.equals( new QName( gmlSchema.getVersion().getNamespace(), "BoundingShapeType" ) ) ) { LOG.trace( "Identified an EnvelopePropertyType." ); pt = new EnvelopePropertyType( ptName, minOccurs, maxOccurs, elementDecl, ptSubstitutions ); } else if ( typeName.equals( new QName( gmlSchema.getVersion().getNamespace(), "FeatureArrayPropertyType" ) ) ) { LOG.trace( "Identified a FeatureArrayPropertyType" ); pt = new ArrayPropertyType( ptName, minOccurs, maxOccurs, elementDecl, ptSubstitutions ); } } // no success -> check if it is a GML object property declaration (feature, geometry, ...) if ( pt == null ) { pt = gmlSchema.getGMLPropertyDecl( elementDecl, ptName, minOccurs, maxOccurs, ptSubstitutions ); } // no success -> build custom property declaration if ( pt == null ) { pt = new CustomPropertyType( ptName, minOccurs, maxOccurs, elementDecl, ptSubstitutions ); } return pt; }
continue; final String key = ctd.getName() + "," + ctd.getNamespace(); types.put(key, ctd); final String key = o.getName() + "," + o.getNamespace(); if (!types.containsKey(key)) { Util.log(" adding " + o.getName() + "," + o.getNamespace()); types.put(key, o); it.add(o);
public JBossXSComplexTypeDefinition(XSComplexTypeDefinition xc) { super(xc.getName(),xc.getNamespace()); setAnonymous(xc.getAnonymous()); xspart = xc.getParticle(); xsSimple = xc.getSimpleType(); deriveMethod = xc.getDerivationMethod(); this.baseType = new JBossXSTypeDefinition(xc.getBaseType()); }
if(generatedPrefix != null) String typeNsWithGeneratedPrefix = type.getNamespace(); declareNs(attrs, generatedPrefix, typeNsWithGeneratedPrefix); declareNamespace(generatedPrefix, typeNsWithGeneratedPrefix);
ArrayList<XSComplexTypeDefinition> toAdd ) throws Exception { if (!nsdMap.containsKey(def.getNamespace())) { Util.log("Namespace desc not found for: " + def); td = new TypeDesc(def.getName(), def.getNamespace(), typeName, TypeDesc.TypeEnum.CLASS); "Type " + def.getNamespace() + ":" + def.getName() + " documentation", anns != null && anns.getLength() > 0 ? ((XSAnnotation) anns.item(0)).getAnnotationString() : null ); if ((tdBase = jtMap.get(model.toJavaQualifiedTypeName(base, nsdMap, false))) == null) { tdBase = new TypeDesc(base.getName(), base.getNamespace(), typeNameBase, TypeDesc.TypeEnum.CLASS); jtMap.put(model.toJavaQualifiedTypeName(base, nsdMap, false), tdBase);
: null); documentation = parseAnnotationString( "Type " + ct.getNamespace() + ":" + ct.getName() + " documentation", ann != null ? ann.getAnnotationString() : null );
XSComplexTypeDefinition elemType = (XSComplexTypeDefinition) elem1.getTypeDefinition(); if (elemType.getAbstract()) { doc.addAttribute(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI, "type", doc.toQName(complexType.getNamespace(), complexType.getName()));
String toString( XSComplexTypeDefinition complexType ) { String s = "\n - complex type: '" + complexType.getName() + "' (" + complexType.getNamespace() + ")"; XSObjectList attributeUses = complexType.getAttributeUses(); for ( int i = 0; i < attributeUses.getLength(); i++ ) {
private TypeBinding bindComplexType(XSComplexTypeDefinition type) QName typeName = type.getName() == null ? null : new QName(type.getNamespace(), type.getName()); TypeBinding binding = typeName == null ? null : schema.getType(typeName); if(binding != null)