protected final XSDTypeDefinition findGlobalElementXSDType(XSDElementDeclaration element) { for (Iterator i = schema.getElementDeclarations().iterator(); i.hasNext();) { XSDElementDeclaration e = (XSDElementDeclaration) i.next(); if (element.getName().equals( e.getName() ) && (element.getTargetNamespace() == null || element.getTargetNamespace().equals( e.getTargetNamespace() ) ) ) { return e.getType(); } } return null; }
public ElementEncodeExecutor( Object object, XSDElementDeclaration element, Document document, Logger logger, NamespaceSupport namespaces) { this.object = object; this.element = element; this.document = document; this.logger = logger; this.namespaces = namespaces; // if ( element.getTargetNamespace() != null ) { encoding = document.createElementNS(element.getTargetNamespace(), element.getName()); // } // else { // encoding = document.createElementNS( // element.getSchema().getTargetNamespace(), element.getName() // ); // } }
protected void buildElementIndex() { elementIndex = new HashMap(); for (int i = 0; i < schemas.length; i++) { XSDSchema schema = schemas[i]; for (Iterator e = schema.getElementDeclarations().iterator(); e.hasNext(); ) { XSDElementDeclaration element = (XSDElementDeclaration) e.next(); QName qName = new QName(element.getTargetNamespace(), element.getName()); elementIndex.put(qName, element); } } }
/** * Searches <code>schema</code> for an element which matches <code>name</code>. * * @param schema The schema * @param name The element to search for * @return The element declaration, or null if it could not be found. */ public static XSDElementDeclaration getElementDeclaration(XSDSchema schema, QName name) { for (Iterator e = schema.getElementDeclarations().iterator(); e.hasNext(); ) { XSDElementDeclaration element = (XSDElementDeclaration) e.next(); if (element.getTargetNamespace().equals(name.getNamespaceURI())) { if (element.getName().equals(name.getLocalPart())) { return element; } } } return null; }
/** Returns the name of the element represented by the particle as a QName. */ public static QName getParticleName(XSDParticle particle) { XSDElementDeclaration content = (XSDElementDeclaration) particle.getContent(); if (content.isElementDeclarationReference()) { content = content.getResolvedElementDeclaration(); } return new QName(content.getTargetNamespace(), content.getName()); }
&& (child.getTargetNamespace() == null ? partContent.getTargetNamespace() == null : child.getTargetNamespace() .equals(partContent.getTargetNamespace()))) { notFound = false; break;
XSDElementDeclaration element = (XSDElementDeclaration)itr.next(); if (element.getName() == null) continue; if (!ns.equals(element.getTargetNamespace())) continue;
if (child.getTargetNamespace() != null) { childName = new QName(child.getTargetNamespace(), child.getName()); } else if (parent.getTargetNamespace() != null) { childName = new QName(parent.getTargetNamespace(), child.getName()); } else if (parent.getType().getTargetNamespace() != null) { childName =
(XSDElementDeclaration) e.getSubstitutionGroup().get(i); if (se == null || (Utilities.equals(el.getTargetNamespace(), se.getTargetNamespace()) && Utilities.equals(el.getName(), se.getName()))) { toremove.add(i);
private AttributeDescriptor createAttributeDescriptor( final XSDElementDeclaration elemDecl, int minOccurs, int maxOccurs, CoordinateReferenceSystem crs) { String targetNamespace = elemDecl.getTargetNamespace(); String name = elemDecl.getName(); Name elemName = Types.typeName(targetNamespace, name); AttributeType type = getTypeOf(elemDecl, crs); boolean nillable = elemDecl.isNillable(); Object defaultValue = null; AttributeDescriptor descriptor = createAttributeDescriptor( type, crs, elemName, minOccurs, maxOccurs, nillable, defaultValue); descriptor.getUserData().put(XSDElementDeclaration.class, elemDecl); return descriptor; }
namespace = element.getTargetNamespace(); if (GML.NAMESPACE.equals(attribute.getTargetNamespace())) { continue;
@Override public Object apply(Object particle) { XSDElementDeclaration attr = (XSDElementDeclaration) ((XSDParticle) particle) .getContent(); if (attr .isElementDeclarationReference()) { attr = attr .getResolvedElementDeclaration(); } return new NameImpl( attr.getTargetNamespace(), attr.getName()); } })
String prefix = namespaces.getPrefix(content.getTargetNamespace()); QualifiedName contentName; if (prefix != null) { contentName = QualifiedName.build( content.getTargetNamespace(), content.getName(), prefix); } else { contentName = new QualifiedName(content.getTargetNamespace(), content.getName());
sub = (XSDElementDeclaration) substitutions.next(); if (!(sub.getName().equals(elemDecl.getName())) || !(sub.getTargetNamespace().equals(elemDecl.getTargetNamespace()))) { Name elemName = Types.typeName(sub.getTargetNamespace(), sub.getName()); AttributeType type = getTypeOf(sub, crs); if (type != null) { && desc.getName() .getNamespaceURI() .equals(element.getTargetNamespace())) { childDesc = desc; break;
SimpleFeatureTypeBuilder ftBuilder = new SimpleFeatureTypeBuilder(); ftBuilder.setName(element.getName()); ftBuilder.setNamespaceURI(element.getTargetNamespace()); final String propNamespace = property.getTargetNamespace(); if (Geometry.class.isAssignableFrom(theClass) && (propNamespace == null || !propNamespace.startsWith(GML.NAMESPACE))) {
String msg = "Failed to create descriptor for '" + childDecl.getTargetNamespace() + "#" + childDecl.getName() && desc.getName() .getNamespaceURI() .equals(elemDecl.getTargetNamespace())) { att = desc; break;
QName subQName = new QName(sub.getTargetNamespace(), sub.getName()); Handler handler = getChildHandlerInternal(subQName);
Types.typeName(elemDecl.getTargetNamespace(), elemDecl.getName())); for (SchemaIndex schemaIndex : schemas) { elemDecl = schemaIndex.getElementDeclaration(qname); String msg = "The element declaration " + elemDecl.getTargetNamespace() + "#" + elemDecl.getName() String targetNamespace = elemDecl.getTargetNamespace(); Name overrideName = Types.typeName(targetNamespace, name); type = createType(overrideName, typeDefinition, crs, true);
new NameImpl(element.getTargetNamespace(), element.getName()), minOccurs, maxOccurs, isNillable, null); properties.add(ad);
fType = ftCache.get(new NameImpl(decl.getTargetNamespace(), decl.getName()));