public XmlSchemaElement getElementByName(QName name) { return (XmlSchemaElement)elements.getItem(name); }
public XmlSchemaType getTypeByName(QName name) { return (XmlSchemaType)schemaTypes.getItem(name); }
/** * Get name for item from another schema. * * @param table the other schema table * @param xsdObject the object for which we seek a name * @return the name */ protected static QName getName(final XmlSchemaObjectTable table, final XmlSchemaObject xsdObject) { for (Iterator < ? > it = table.getNames(); it.hasNext();) { QName name = (QName) it.next(); if (xsdObject == table.getItem(name)) { return name; } } return null; }
} else { XmlSchemaAttribute attribute = (XmlSchemaAttribute) attributes .getItem(name); if (deep) { if (attribute == null) {
XmlSchemaType type = (XmlSchemaType) schemaTypes.getItem(name);
} else { XmlSchemaElement element = (XmlSchemaElement) elements .getItem(name); if (deep) { if (element == null) {
} else { XmlSchemaAttribute attribute = (XmlSchemaAttribute) attributes .getItem(name); if (deep) { if (attribute == null) {
} else { XmlSchemaElement element = (XmlSchemaElement) elements .getItem(name); if (deep) { if (element == null) {
XmlSchemaType type = (XmlSchemaType) schemaTypes.getItem(name);
ed.setSystem(typeSystemURI); ed.setContentModel(Constants.API_APACHE_WS_XS); ed.setContent(elementTable.getItem(xseQN)); fDesc.addElementDeclaration(ed);
td.setSystem(typeSystemURI); td.setContentModel(Constants.API_APACHE_WS_XS); td.setContent(typeTable.getItem(xstQN)); fDesc.addTypeDefinition(td);
/** * Take all elements from a collection and process them. * * @param items the parent collection * @param level the current level in the elements hierarchy. * @throws XsdMappingException if processing fails */ protected void processCollectionElements( final XmlSchemaObjectCollection items, final int level) throws XsdMappingException { /* Process each element in the collection */ for (int i = 0; i < items.getCount(); i++) { XmlSchemaObject element = items.getItem(i); if (element instanceof XmlSchemaElement) { processElement((XmlSchemaElement) element, level); } else if (element instanceof XmlSchemaGroupRef) { /* This is a reference to a group so we fetch the group */ XmlSchemaGroupRef groupRef = (XmlSchemaGroupRef) element; XmlSchemaGroup group = (XmlSchemaGroup) _schema.getGroups() .getItem(groupRef.getRefName()); processParticle(group.getName(), group.getParticle(), level); } } }
/** * Take all elements from a collection and process them. * * @param schema the XML Schema * @param jaxbNamespace the JAXB namespace * @param jaxbNamespacePrefix the JAXB namespace prefix * @param items the parent collection */ protected void processCollectionElements(final XmlSchema schema, final String jaxbNamespace, final String jaxbNamespacePrefix, final XmlSchemaObjectCollection items) { for (int i = 0; i < items.getCount(); i++) { XmlSchemaObject element = items.getItem(i); if (element instanceof XmlSchemaElement) { processElement(schema, jaxbNamespace, jaxbNamespacePrefix, (XmlSchemaElement) element); } else if (element instanceof XmlSchemaGroupRef) { XmlSchemaGroupRef groupRef = (XmlSchemaGroupRef) element; XmlSchemaGroup group = (XmlSchemaGroup) schema.getGroups() .getItem(groupRef.getRefName()); processParticle(schema, jaxbNamespace, jaxbNamespacePrefix, group.getName(), group.getParticle()); } } }