for (Iterator e = schema.getElementDeclarations().iterator(); e.hasNext(); ) { XSDElementDeclaration element = (XSDElementDeclaration) e.next(); if (ft.getName().equals(element.getName())) { type = element.getTypeDefinition(); break; for (Iterator c = children.iterator(); c.hasNext(); ) { XSDElementDeclaration ce = (XSDElementDeclaration) c.next(); if (at.getName().equals(ce.getName())) { found = true; if (ce.getContainer() instanceof XSDParticle) {
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); } } }
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; }
/** * 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 particle for an element declaration that is part of a type. * * @param type The type definition. * @param name The naem of the child element declaration. * @param includeParents Flag to control wether parent types are included. * @return The particle representing the element declaration, or <code>null</code> if it could * not be found. */ public static final XSDParticle getChildElementParticle( XSDTypeDefinition type, String name, boolean includeParents) { List particles = getChildElementParticles(type, includeParents); for (Iterator p = particles.iterator(); p.hasNext(); ) { XSDParticle particle = (XSDParticle) p.next(); XSDElementDeclaration element = (XSDElementDeclaration) particle.getContent(); if (element.isElementDeclarationReference()) { element.getResolvedElementDeclaration(); } if (name.equals(element.getName())) { return particle; } } 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()); }
for (Iterator itr = elements.iterator(); itr.hasNext();) { XSDElementDeclaration element = (XSDElementDeclaration)itr.next(); if (element.getName() == null) continue; if (!ns.equals(element.getTargetNamespace())) continue; stringBuffer.append(element.getName()); stringBuffer.append(TEXT_18); stringBuffer.append(ns); stringBuffer.append(TEXT_19); stringBuffer.append(element.getName()); stringBuffer.append(TEXT_20);
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 = new QName( parent.getType().getTargetNamespace(), child.getName()); } else { childName = new QName(null, child.getName());
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; }
XSDElementDeclaration element = (XSDElementDeclaration ) e.next(); if ( element.getAnonymousTypeDefinition() != null ) { element.getAnonymousTypeDefinition().setName( "_" + element.getName() ); anonymous.add( element.getAnonymousTypeDefinition() ); element.getAnonymousTypeDefinition().setName( type.getName() + "_" + element.getName() ); anonymous.add( element.getAnonymousTypeDefinition() );
contentName = QualifiedName.build( content.getTargetNamespace(), content.getName(), prefix); } else { contentName = new QualifiedName(content.getTargetNamespace(), content.getName()); int idx = getNameIndex(content.getName(), attributeDescriptors); attribute.attributeIndex = idx; if (idx != -1) { if (contentType == null || content.getName() == null) { throw new IllegalArgumentException("Could not find non annonymous type");
@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()); } })
QName subQName = new QName(sub.getTargetNamespace(), sub.getName()); Handler handler = getChildHandlerInternal(subQName);
new NameImpl(element.getTargetNamespace(), element.getName()), minOccurs, maxOccurs, isNillable, null); properties.add(ad);
fType = ftCache.get(new NameImpl(decl.getTargetNamespace(), decl.getName()));
throw (IOException) e; String msg = "Error parsing feature type for " + elementDecl.getName(); throw (IOException) new IOException(msg).initCause(e);