childElement = childElement.getResolvedElementDeclaration(); if (childElement .getType() .getName() .equals(complex.getType().getName().getLocalPart())) {
/** * Returns a list of all child element declarations of the specified element, no order is * guaranteed. * * @param element The parent element. * @return A list of @link XSDElementDeclaration objects, one for each child element. * @deprecated use {@link #getChildElementDeclarations(XSDTypeDefinition)} */ public static final List getChildElementDeclarations(XSDElementDeclaration element) { return getChildElementDeclarations(element.getType()); }
/** * Returns a list of all child element declarations of the specified element. * * <p>The <code>includeParents</code> flag controls if this method should returns those elements * defined on parent types. * * @param element The parent element. * @param includeParents Flag indicating if parent types should be processed. * @return A list of @link XSDElementDeclaration objects, one for each child element. * @deprecated use {@link #getChildElementDeclarations(XSDTypeDefinition, boolean)} */ public static final List getChildElementDeclarations( XSDElementDeclaration element, boolean includeParents) { return getChildElementDeclarations(element.getType(), includeParents); }
/** * Returns a list of all attribute declarations declared in the type (or any base type) of the * specified element. * * <p>This method is just a shortcut for {@link #getAttributeDeclarations(XSDTypeDefinition) * getAttributeDeclarations(element.getType()} * * @param element The element. * @return A list of @link XSDAttributeDeclaration objects, one for each attribute of the * element. */ public static final List getAttributeDeclarations(XSDElementDeclaration element) { return getAttributeDeclarations(element.getType()); }
/** * Determines if the type of an element is a sub-type of another element. * * @param e1 The element. * @param e2 The element to be tested as a base type. * @since 2.5 */ public static final boolean isBaseType(XSDElementDeclaration e1, XSDElementDeclaration e2) { XSDTypeDefinition type = e1.getType(); while (type != null) { if (type.equals(e2.getType())) { return true; } if (type.equals(type.getBaseType())) { break; } type = type.getBaseType(); } return false; } /**
/** * Returns a list of all top level elements that are of a type derived from the type of the * specified element. * * @param element The element. * @return All elements which are of a type derived from the type of the specified element. */ public static final List getDerivedElementDeclarations(XSDElementDeclaration element) { List elements = element.getSchema().getElementDeclarations(); List derived = new ArrayList(); for (Iterator itr = elements.iterator(); itr.hasNext(); ) { XSDElementDeclaration derivee = (XSDElementDeclaration) itr.next(); if (derivee.equals(element)) { continue; // same element } XSDTypeDefinition type = derivee.getType(); while (true) { if (type.equals(element.getType())) { derived.add(derivee); break; } if (type.equals(type.getBaseType())) { break; } type = type.getBaseType(); } } return derived; }
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; }
Schemas.getChildElementParticles(parent.getType(), true) .iterator(); i.hasNext(); ) { } 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());
List children = Schemas.getChildElementParticles(element.getType(), true);
XSDTypeDefinition typeDef = elemDecl.getType();
public void testElement() { ElementInstance element = element(" hello world ", XS.ANYSIMPLETYPE); assertEquals(" hello world ", element.getText()); assertEquals( xsdSimple(XS.ANYSIMPLETYPE.getLocalPart()), element.getElementDeclaration().getType()); }
/** * Returns a list of all child element declarations of the specified * element, no order is guaranteed. * * @param element The parent element. * * @return A list of @link XSDElementDeclaration objects, one for each * child element. * * @deprecated use {@link #getChildElementDeclarations(XSDTypeDefinition)} */ public static final List getChildElementDeclarations(XSDElementDeclaration element) { return getChildElementDeclarations(element.getType()); }
/** * Returns a list of all child element declarations of the specified * element, no order is guaranteed. * * @param element The parent element. * * @return A list of @link XSDElementDeclaration objects, one for each * child element. * * @deprecated use {@link #getChildElementDeclarations(XSDTypeDefinition)} */ public static final List getChildElementDeclarations(XSDElementDeclaration element) { return getChildElementDeclarations(element.getType()); }
/** * Returns a list of all child element declarations of the specified * element, no order is guaranteed. * * @param element The parent element. * * @return A list of @link XSDElementDeclaration objects, one for each * child element. * * @deprecated use {@link #getChildElementDeclarations(XSDTypeDefinition)} */ public static final List getChildElementDeclarations( XSDElementDeclaration element) { return getChildElementDeclarations(element.getType()); }
/** * Returns a list of all attribute declarations declared in the type (or * any base type) of the specified element. * * <p> * This method is just a shortcut for {@link #getAttributeDeclarations(XSDTypeDefinition) getAttributeDeclarations(element.getType()} * </p> * * @param element The element. * * @return A list of @link XSDAttributeDeclaration objects, one for each * attribute of the element. */ public static final List getAttributeDeclarations(XSDElementDeclaration element) { return getAttributeDeclarations(element.getType()); }
/** * Returns a list of all attribute declarations declared in the type (or * any base type) of the specified element. * * <p> * This method is just a shortcut for {@link #getAttributeDeclarations(XSDTypeDefinition) getAttributeDeclarations(element.getType()} * </p> * * @param element The element. * * @return A list of @link XSDAttributeDeclaration objects, one for each * attribute of the element. */ public static final List getAttributeDeclarations(XSDElementDeclaration element) { return getAttributeDeclarations(element.getType()); }
/** * Returns a list of all attribute declarations declared in the type (or * any base type) of the specified element. * * <p> * This method is just a shortcut for {@link #getAttributeDeclarations(XSDTypeDefinition) getAttributeDeclarations(element.getType()} * </p> * * @param element The element. * * @return A list of @link XSDAttributeDeclaration objects, one for each * attribute of the element. */ public static final List getAttributeDeclarations( XSDElementDeclaration element) { return getAttributeDeclarations(element.getType()); }