for (Iterator t = schema.getTypeDefinitions().iterator(); t.hasNext(); ) { XSDTypeDefinition typedef = (XSDTypeDefinition) t.next(); if ((ft.getName() + "_Type").equals(typedef.getName())) {
private static boolean hasNoElementsNorTypes(XSDSchema schema) { if (schema == null) { return false; } return schema.getElementDeclarations().isEmpty() && schema.getTypeDefinitions().isEmpty(); }
protected void buildComplexTypeIndex() { complexTypeIndex = new HashMap(); for (int i = 0; i < schemas.length; i++) { XSDSchema schema = schemas[i]; for (Iterator t = schema.getTypeDefinitions().iterator(); t.hasNext(); ) { XSDTypeDefinition type = (XSDTypeDefinition) t.next(); if (type instanceof XSDComplexTypeDefinition) { QName qName = new QName(type.getTargetNamespace(), type.getName()); complexTypeIndex.put(qName, type); } } } }
protected void buildSimpleTypeIndex() { simpleTypeIndex = new HashMap(); for (int i = 0; i < schemas.length; i++) { XSDSchema schema = schemas[i]; for (Iterator t = schema.getTypeDefinitions().iterator(); t.hasNext(); ) { XSDTypeDefinition type = (XSDTypeDefinition) t.next(); if (type instanceof XSDSimpleTypeDefinition) { QName qName = new QName(type.getTargetNamespace(), type.getName()); simpleTypeIndex.put(qName, type); } } } }
protected final AttributeType xsAnyType() { XSDSchema schema = XSDUtil.getSchemaForSchema(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001); for ( Iterator i = schema.getTypeDefinitions().iterator(); i.hasNext(); ) { XSDTypeDefinition t = (XSDTypeDefinition) i.next(); if ( XS.ANYTYPE.getLocalPart().equals( t.getName() ) ) { return findType(t); } } throw new IllegalStateException("XS schema not present"); }
/** * Provide an explicit mapping from an XSD type * @param namespace * @param name */ public void addTypeMapping(String namespace, String name, AttributeType gtType) { if (namespace == null) { namespace = schema.getTargetNamespace(); } assert name != null; //find the type in the xsd schema List typeDefs = schema.getTypeDefinitions(); for (Iterator itr = typeDefs.iterator(); itr.hasNext();) { XSDTypeDefinition xsdType = (XSDTypeDefinition) itr.next(); String tns = xsdType.getTargetNamespace(); String tn = xsdType.getName(); if (namespace.equals(tns) && name.equals(tn)) { types.put(xsdType, gtType); return; } } throw new IllegalArgumentException("Type: [" + namespace + "," + name + "] not found"); }
public void testGML() throws Exception { XSDSchema gml = GML.getInstance().getSchema(); assertFalse(gml.getTypeDefinitions().isEmpty()); }
List types = new ArrayList( schema.getTypeDefinitions() );
private List getUsedTypeNames() { List usedNames = new ArrayList(); if (schema != null) { List typesList = schema.getTypeDefinitions(); Iterator types = typesList.iterator(); while (types.hasNext()) { usedNames.add(((XSDTypeDefinition) types.next()).getName()); } } return usedNames; } }
protected void buildComplexTypeIndex() { complexTypeIndex = new HashMap(); for (int i = 0; i < schemas.length; i++) { XSDSchema schema = schemas[i]; for (Iterator t = schema.getTypeDefinitions().iterator(); t.hasNext();) { XSDTypeDefinition type = (XSDTypeDefinition) t.next(); if (type instanceof XSDComplexTypeDefinition) { QName qName = new QName(type.getTargetNamespace(), type.getName()); complexTypeIndex.put(qName, type); } } } }
protected void buildSimpleTypeIndex() { simpleTypeIndex = new HashMap(); for (int i = 0; i < schemas.length; i++) { XSDSchema schema = schemas[i]; for (Iterator t = schema.getTypeDefinitions().iterator(); t.hasNext();) { XSDTypeDefinition type = (XSDTypeDefinition) t.next(); if (type instanceof XSDSimpleTypeDefinition) { QName qName = new QName(type.getTargetNamespace(), type.getName()); simpleTypeIndex.put(qName, type); } } } }
protected void buildComplexTypeIndex() { complexTypeIndex = new HashMap(); for (int i = 0; i < schemas.length; i++) { XSDSchema schema = schemas[i]; for (Iterator t = schema.getTypeDefinitions().iterator(); t.hasNext();) { XSDTypeDefinition type = (XSDTypeDefinition) t.next(); if (type instanceof XSDComplexTypeDefinition) { QName qName = new QName(type.getTargetNamespace(), type.getName()); complexTypeIndex.put(qName, type); } } } }
protected void buildSimpleTypeIndex() { simpleTypeIndex = new HashMap(); for (int i = 0; i < schemas.length; i++) { XSDSchema schema = schemas[i]; for (Iterator t = schema.getTypeDefinitions().iterator(); t.hasNext();) { XSDTypeDefinition type = (XSDTypeDefinition) t.next(); if (type instanceof XSDSimpleTypeDefinition) { QName qName = new QName(type.getTargetNamespace(), type.getName()); simpleTypeIndex.put(qName, type); } } } }
protected void buildComplexTypeIndex() { complexTypeIndex = new HashMap(); for (int i = 0; i < schemas.length; i++) { XSDSchema schema = schemas[i]; for (Iterator t = schema.getTypeDefinitions().iterator(); t.hasNext();) { XSDTypeDefinition type = (XSDTypeDefinition) t.next(); if (type instanceof XSDComplexTypeDefinition) { QName qName = new QName(type.getTargetNamespace(), type.getName()); complexTypeIndex.put(qName, type); } } } }
protected void buildSimpleTypeIndex() { simpleTypeIndex = new HashMap(); for (int i = 0; i < schemas.length; i++) { XSDSchema schema = schemas[i]; for (Iterator t = schema.getTypeDefinitions().iterator(); t.hasNext();) { XSDTypeDefinition type = (XSDTypeDefinition) t.next(); if (type instanceof XSDSimpleTypeDefinition) { QName qName = new QName(type.getTargetNamespace(), type.getName()); simpleTypeIndex.put(qName, type); } } } }
public java.util.List getUserSimpleTypeNamesList() { Vector items = new Vector(); if (xsdSchema != null) { updateExternalImportGlobals(); Iterator i = xsdSchema.getTypeDefinitions().iterator(); while (i.hasNext()) { XSDTypeDefinition typeDefinition = (XSDTypeDefinition) i.next(); if (typeDefinition instanceof XSDSimpleTypeDefinition) { items.addAll(getPrefixedNames(typeDefinition.getTargetNamespace(), typeDefinition.getName())); } } items = (Vector) sortList(items); } return items; }
private void setup() { if (schema != null) { List usedNames = getUsedTypeNames(); setUsedNames(usedNames); setDefaultName(XSDCommonUIUtils.createUniqueElementName(name, schema.getTypeDefinitions())); } }
XSDTypeDefinition resolveTypeInSchema(XSDSchema schema, Name typeName) { XSDTypeDefinition type = null; for (XSDTypeDefinition td : (schema.getTypeDefinitions())) { if (typeName.getNamespaceURI().equals(td.getTargetNamespace()) && typeName.getLocalPart().equals(td.getName())) { type = td; break; } } if (type == null) { type = schema.resolveTypeDefinition( typeName.getNamespaceURI(), typeName.getLocalPart()); } return type; }
public void propogateComponents(XSDSchema otherXSDSchema) { otherXSDSchema.getAnnotations().addAll(getAnnotations()); XSDNamedComponentImpl.mergeToSortedList (otherXSDSchema.getAttributeDeclarations(), getAttributeDeclarations()); XSDNamedComponentImpl.mergeToSortedList (otherXSDSchema.getAttributeGroupDefinitions(), getAttributeGroupDefinitions()); XSDNamedComponentImpl.mergeToSortedList (otherXSDSchema.getElementDeclarations(), getElementDeclarations()); XSDNamedComponentImpl.mergeToSortedList (otherXSDSchema.getModelGroupDefinitions(), getModelGroupDefinitions()); XSDNamedComponentImpl.mergeToSortedList (otherXSDSchema.getTypeDefinitions(), getTypeDefinitions()); XSDNamedComponentImpl.mergeToSortedList (otherXSDSchema.getNotationDeclarations(), getNotationDeclarations()); XSDNamedComponentImpl.mergeToSortedList (otherXSDSchema.getIdentityConstraintDefinitions(), getIdentityConstraintDefinitions()); }
public void propogateComponents(XSDSchema otherXSDSchema) { otherXSDSchema.getAnnotations().addAll(getAnnotations()); XSDNamedComponentImpl.mergeToSortedList (otherXSDSchema.getAttributeDeclarations(), getAttributeDeclarations()); XSDNamedComponentImpl.mergeToSortedList (otherXSDSchema.getAttributeGroupDefinitions(), getAttributeGroupDefinitions()); XSDNamedComponentImpl.mergeToSortedList (otherXSDSchema.getElementDeclarations(), getElementDeclarations()); XSDNamedComponentImpl.mergeToSortedList (otherXSDSchema.getModelGroupDefinitions(), getModelGroupDefinitions()); XSDNamedComponentImpl.mergeToSortedList (otherXSDSchema.getTypeDefinitions(), getTypeDefinitions()); XSDNamedComponentImpl.mergeToSortedList (otherXSDSchema.getNotationDeclarations(), getNotationDeclarations()); XSDNamedComponentImpl.mergeToSortedList (otherXSDSchema.getIdentityConstraintDefinitions(), getIdentityConstraintDefinitions()); }