/** * Construct an XSNamedMap implementation one namespace from an array * * @param array containing all components * @param length number of components */ public XSNamedMapImpl(XSObject[] array, int length) { if (length == 0) { fNamespaces = null; fMaps = null; fNSNum = 0; fArray = array; fLength = 0; return; } // because all components are from the same target namesapce, // get the namespace from the first one. fNamespaces = new String[]{array[0].getNamespace()}; fMaps = null; fNSNum = 1; // copy elements to the Vector fArray = array; fLength = length; }
private static boolean matches(XSObject aObject, QName aQName) { return aObject.getName().equals(aQName.getLocalPart()) && aObject.getNamespace().equals(aQName.getNamespaceURI()); } }
/** * Retrieves an <code>XSObject</code> specified by local name and * namespace URI. * <br>Per XML Namespaces, applications must use the value <code>null</code> as the * <code>namespace</code> parameter for methods if they wish to specify * no namespace. * @param namespace The namespace URI of the <code>XSObject</code> to * retrieve, or <code>null</code> if the <code>XSObject</code> has no * namespace. * @param localName The local name of the <code>XSObject</code> to * retrieve. * @return A <code>XSObject</code> (of any type) with the specified local * name and namespace URI, or <code>null</code> if they do not * identify any object in this map. */ public XSObject itemByName(String namespace, String localName) { XSObject xso = null; //Since our list may contain types from xerces implementation for(XSObject obj: list) { if(localName.equals(obj.getName()) && namespace.equals(obj.getNamespace())) return obj; } return xso; }
private void expandRelatedComponents(XSObject component, Vector componentList, Hashtable dependencies) { short componentType = component.getType(); switch (componentType) { case XSConstants.TYPE_DEFINITION : expandRelatedTypeComponents((XSTypeDefinition) component, componentList, component.getNamespace(), dependencies); break; case XSConstants.ATTRIBUTE_DECLARATION : expandRelatedAttributeComponents((XSAttributeDeclaration) component, componentList, component.getNamespace(), dependencies); break; case XSConstants.ATTRIBUTE_GROUP : expandRelatedAttributeGroupComponents((XSAttributeGroupDefinition) component, componentList, component.getNamespace(), dependencies); case XSConstants.ELEMENT_DECLARATION : expandRelatedElementComponents((XSElementDeclaration) component, componentList, component.getNamespace(), dependencies); break; case XSConstants.MODEL_GROUP_DEFINITION : expandRelatedModelGroupDefinitionComponents((XSModelGroupDefinition) component, componentList, component.getNamespace(), dependencies); case XSConstants.ATTRIBUTE_USE : //expandRelatedAttributeUseComponents((XSAttributeUse)component, componentList, dependencies); case XSConstants.NOTATION_DECLARATION : case XSConstants.IDENTITY_CONSTRAINT : default : break; } }
public String toJavaTypeName(XSObject xs, Map<String, NamespaceDesc> nsdMap) { String name = xs.getName(); if (name == null) { if (xs instanceof TypeInfo) { name = ((TypeInfo) xs).getTypeName(); if (name != null && name.startsWith("#")) { name = name.substring(1); } } } return model.toJavaTypeName(name, xs.getNamespace()); }
public String toJavaQualifiedTypeName(XSObject xs, Map<String, NamespaceDesc> nsdMap, boolean isEnum) { String typeName = toJavaTypeName(xs.getName(), xs.getNamespace()); return getNSDPrefix(xs.getNamespace(), xs.getName(), isEnum) + typeName; }
private static QName getQName(XSModel xsModel, String root) { String namespace = null; XSNamedMap m1 = xsModel.getComponents(XSConstants.ELEMENT_DECLARATION); if (m1 != null) { for (int i = 0; i < m1.getLength(); i++) { XSObject o = m1.item(i); if (root.equals(o.getName())) { namespace = o.getNamespace(); } } } return new QName(namespace, root); }
} else { String localPart = component.getName(); String uri = component.getNamespace(); if (uri != null && localPart != null) { // .../schemaElement::p:item if (uri.equals(nameTest.uri)
for (int i = 0; i < length; ++i) { XSObject xso = item(i); entries[i] = new XSNamedMapEntry(new QName(xso.getNamespace(), xso.getName()), xso);
XSTypeDefinition xsType = elem.getTypeDefinition(); if (WSIConstants.NS_URI_SWA_REF.equals(xsType.getNamespace()) && WSIConstants.SCHEMA_TYPE_SWA_REF.equals(xsType.getName())) new QName(elem.getNamespace(), elem.getName()));
if (id.getNamespace().getDecoded().equals(item.getNamespace())) { result.add(item.getName());
for (int i = 0; i < components.getLength(); i++) { XSObject obj = components.item(i); QName qname = new QName(obj.getNamespace(), obj.getName()); String file = this.model.qname2FileMap.get(qname); this.model.qname2FileMap.put(qname, (file == null ? "" : file + ";") + schemaFile.getName()); for (int i = 0; i < components.getLength(); i++) { XSObject obj = components.item(i); QName qname = new QName(obj.getNamespace(), obj.getName()); String file = this.model.qname2FileMap.get(qname); this.model.qname2FileMap.put(qname, (file == null ? "" : file) + ":" + schemaFile.getName() + ":");
xsType.getNamespace())) new QName(elem.getNamespace(), elem.getName()));
if(!Constants.NS_XML_SCHEMA.equals(type.getNamespace())) typeNames.add(new QName(type.getNamespace(), type.getName()));
if (xsSimpleType.getNamespace().equals(WSIConstants.NS_URI_SWA_REF) && xsSimpleType.getName().equals(WSIConstants.SCHEMA_TYPE_SWA_REF))
roots += "{" + xsObject.getNamespace() + "}" + xsObject.getName();
addGlobalComponents(expandedComponents, importDependencies); if (referType == XSDDescription.CONTEXT_PREPARSE) { desc.setTargetNamespace(components[0].getNamespace());
private boolean canAddComponent(XSObject component, XSDDescription desc) { desc.setNamespace(component.getNamespace());
model.qname2FileMap.get(new QName(o.getNamespace(), o.getName())) ); return ctd;
private void addGlobalComponent(XSObject component, XSDDescription desc) { final String namespace = component.getNamespace();