namespaceURI = xsdSchema.getTargetNamespace();
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 t = schema.getTypeDefinitions().iterator(); t.hasNext(); ) { XSDTypeDefinition typedef = (XSDTypeDefinition) t.next(); if ((ft.getName() + "_Type").equals(typedef.getName())) { type = typedef; 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) { XSDParticle part = (XSDParticle) ce.getContainer(); at.setMinOccurs(part.getMinOccurs()); at.setMaxOccurs(part.getMaxOccurs());
boolean forceQualified(XSDElementDeclaration e) { return namespaceAware && (e == null || e.isGlobal() || e.getSchema() == null || e.getSchema().getElementFormDefault() == XSDForm.QUALIFIED_LITERAL); }
/** 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()); }
private XSDParticle buildParticle(XSDElementDeclaration declaration) { XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle(); particle.setContent(declaration); particle.setMinOccurs(0); particle.setMaxOccurs(-1); return particle; }
boolean target(XSDNamedComponent c, XSDSchema schema) { return c.getTargetNamespace().equals(schema.getTargetNamespace()); }
private static boolean hasNoElementsNorTypes(XSDSchema schema) { if (schema == null) { return false; } return schema.getElementDeclarations().isEmpty() && schema.getTypeDefinitions().isEmpty(); }
public AttributeEncodeExecutor( Object object, XSDAttributeDeclaration attribute, Document document, Logger logger) { this.object = object; this.attribute = attribute; this.document = document; this.logger = logger; encoding = document.createAttributeNS(attribute.getTargetNamespace(), attribute.getName()); }
@Override public AttributeType buildSuper() { XSDTypeDefinition baseType = xsdType.getBaseType(); if (baseType != null && baseType.getName() != null && !baseType.equals(xsdType)) { return createType(baseType, DUMMY_DEPTH); } else { return null; } }
public int length(XSDTypeDefinition definition) { try { XSDSimpleTypeDefinition simple = definition.getSimpleType(); XSDLengthFacet facet = simple.getLengthFacet(); if (facet == null) { return Integer.MAX_VALUE; } return Integer.parseInt(facet.getLexicalValue()); } catch (NumberFormatException ignore) { return Integer.MIN_VALUE; } }
@Override public AttributeType buildSuper() { XSDTypeDefinition baseType = xsdType.getBaseType(); if (baseType != null && baseType.getName() != null && !baseType.equals(xsdType)) { return createType(baseType, Integer.MAX_VALUE); } else { return null; } } };
private boolean hasElement(XSDSchema schema, String elQName) { boolean elFound = false; EList<XSDElementDeclaration> elDeclList = schema.getElementDeclarations(); for (XSDElementDeclaration elDecl : elDeclList) { if (elQName.equals(elDecl.getQName())) { elFound = true; } } return elFound; }
public XSDTypeDefinition getTypeDefinition() { return declaration.getTypeDefinition(); }
public int length(XSDTypeDefinition definition) { try { XSDSimpleTypeDefinition simple = (XSDSimpleTypeDefinition) definition; XSDLengthFacet facet = simple.getLengthFacet(); if (facet == null) { return Integer.MAX_VALUE; } return Integer.parseInt(facet.getLexicalValue()); } catch (NumberFormatException ignore) { return Integer.MIN_VALUE; } }
/** * 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()); }
/** * Register schema * * @param schema schema to be registered */ public synchronized void register(XSDSchema schema) { schemaRegistry.put(schema.getSchemaLocation(), schema); }
protected boolean included(XSDNamedComponent c) { return included != null ? included.contains( c.getName() ) : true; } }
public XSDTypeDefinition getTypeDefinition() { return decl.getTypeDefinition(); }
public void testSchemaIdentiy() { assertNotNull(schema); assertNotNull(xsd); assertEquals("1.0", xsd.getVersion()); }