for (Iterator e = schema.getElementDeclarations().iterator(); e.hasNext(); ) { XSDElementDeclaration element = (XSDElementDeclaration) e.next(); if (ft.getName().equals(element.getName())) {
private static boolean hasNoElementsNorTypes(XSDSchema schema) { if (schema == null) { return false; } return schema.getElementDeclarations().isEmpty() && schema.getTypeDefinitions().isEmpty(); }
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 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; }
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; }
List elements = schema.getElementDeclarations(); for (Iterator itr = elements.iterator(); itr.hasNext();) { XSDElementDeclaration element = (XSDElementDeclaration)itr.next();
List elements = schema.getElementDeclarations();
for ( Iterator e = schema.getElementDeclarations().iterator(); e.hasNext(); ) { XSDElementDeclaration element = (XSDElementDeclaration ) e.next(); if ( element.getAnonymousTypeDefinition() != null ) {
resolvedSchema.getReferencingDirectives().remove(directive); for (XSDElementDeclaration dec : resolvedSchema.getElementDeclarations()) { if (dec == null) { continue;
} else { for (Iterator e = type.getSchema().getElementDeclarations().iterator(); e.hasNext(); ) { XSDElementDeclaration element = (XSDElementDeclaration) e.next();
private List getUsedElementNames() { List usedNames = new ArrayList(); if (schema != null ) { List elementsList = schema.getElementDeclarations(); Iterator elements = elementsList.iterator(); while (elements.hasNext()) { usedNames.add(((XSDElementDeclaration) elements.next()).getName()); } } return usedNames; } }
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); } } }
public void visitXSDSchema(XSDSchema xsdSchema) { indent += 2; for (Iterator iterator = xsdSchema.getElementDeclarations().iterator(); iterator.hasNext(); ) { visitXSDObject(iterator.next()); } indent -= 2; }
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 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); } } }
public List getGlobalElements(XSDSchema schema, boolean showFromIncludes) { List elements = schema.getElementDeclarations(); List list = new ArrayList(); for (Iterator i = elements.iterator(); i.hasNext();) { XSDElementDeclaration elem = (XSDElementDeclaration) i.next(); if (isSameNamespace(elem.getTargetNamespace(),schema.getTargetNamespace()) && (elem.getRootContainer() == schema || showFromIncludes)) { list.add(elem); } } List adapterList = new ArrayList(); populateAdapterList(list, adapterList); return adapterList; }
private void setup() { if (schema != null) { List usedNames = getUsedElementNames(); setUsedNames(usedNames); setDefaultName(XSDCommonUIUtils.createUniqueElementName("NewElement", schema.getElementDeclarations())); } }
protected XSDElementDeclaration createGlobalXSDElementDeclaration() { ensureSchemaElement(xsdSchema); XSDSimpleTypeDefinition type = xsdSchema.getSchemaForSchema().resolveSimpleTypeDefinition("string"); //$NON-NLS-1$ XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory(); XSDElementDeclaration element = factory.createXSDElementDeclaration(); element.setName(XSDCommonUIUtils.createUniqueElementName( nameToAdd == null ? "NewElement" : nameToAdd , xsdSchema.getElementDeclarations())); //$NON-NLS-1$ element.setTypeDefinition(type); return element; }