Class SchemasByNamespace
java.lang.Object
org.apache.ws.commons.schema.walker.SchemasByNamespace
A class that allows XmlSchemas to be stored, indexed by a String which is the schema's target namespace.
Multiple schemas are allowed for each namespace.
It provides methods that allow all schemas for a given namespace to be searched, for example when the caller
wishes to find an xsd type defined for a particular namespace.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAssociates an XmlSchema with a namespacegetAttributeByName(QName aAttName) Returns an XmlSchemaAttribute with the given QName.getAttributeGroupByName(QName aAGName) Returns an XmlSchemaAttributeGroup with the given QName.getElementByName(QName aElementName) Returns an XmlSchemaElement with the given QName.getFirstSchema(String aNamespace) Returns the first XmlSchema added with the given namespace, using addSchema(...)getGroupByName(QName aGroupName) Returns an XmlSchemaGroup with the given QName.getSchemaDefiningAttribute(QName aAttName) Returns an XmlSchema which includes an attribute with the given QName.getSchemaDefiningElement(QName aElementName) Returns an XmlSchema which includes an element with the given QName.getSchemas(String aNamespace) Returns a List of XmlSchemas that have been associated with the given namespace using addSchema(...).getTypeByName(QName aTypeName) Returns an XmlSchemaType with the given QName.
-
Field Details
-
mData
the map of namespaces to a list of XmlSchemas
-
-
Constructor Details
-
SchemasByNamespace
SchemasByNamespace()
-
-
Method Details
-
addSchema
Associates an XmlSchema with a namespace- Parameters:
aNamespace- the namespace in questionaSchema- a schema with aNamespace as its target
-
getSchemas
Returns a List of XmlSchemas that have been associated with the given namespace using addSchema(...).- Parameters:
aNamespace- the namespace in question- Returns:
- a List of XmlSchemas which target aNamespace
-
getTypeByName
Returns an XmlSchemaType with the given QName. The namespace defined by the name is used to find the schema in which the type is defined, and thus the type itself.- Parameters:
aTypeName- the name of the type, which must return the correct value for aTypeName.getNamespaceURI().- Returns:
- the XmlSchemaType with name aTypeName or null if no such type is found
-
getGroupByName
Returns an XmlSchemaGroup with the given QName. The namespace defined by the name is used to find the schema in which the group is defined, and thus the group itself.- Parameters:
aGroupName- the name of the group, which must return the correct value for aGroupName.getNamespaceURI().- Returns:
- the XmlSchemaGroup with name aGroupName or null if no such group is found
-
getAttributeByName
Returns an XmlSchemaAttribute with the given QName. The namespace defined by the name is used to find the schema in which the attribute is defined, and thus the attribute itself.- Parameters:
aAttName- the name of the attribute, which must return the correct value for aAttName.getNamespaceURI().- Returns:
- the XmlSchemaAttribute with name aAttName or null if no such attribute is found
-
getAttributeGroupByName
Returns an XmlSchemaAttributeGroup with the given QName. The namespace defined by the name is used to find the schema in which the attribute group is defined, and thus the attribute group itself.- Parameters:
aAGName- the name of the attribute group, which must return the correct value for aAGName.getNamespaceURI().- Returns:
- the XmlSchemaAttributeGroup with name aAGName or null if no such attribute group is found
-
getElementByName
Returns an XmlSchemaElement with the given QName. The namespace defined by the name is used to find the schema in which the element is defined, and thus the element itself.- Parameters:
aElementName- the name of the element, which must return the correct value for aElementName.getNamespaceURI().- Returns:
- the XmlSchemaElement with name aElementName or null if no such element is found
-
getSchemaDefiningElement
Returns an XmlSchema which includes an element with the given QName. The namespace defined by the name is used to find the schema in which the element is defined.- Parameters:
aElementName- the name of the element, which must return the correct value for aElementName.getNamespaceURI().- Returns:
- the XmlSchema which includes the element with name aElementName or null if no such schema is found
-
getSchemaDefiningAttribute
Returns an XmlSchema which includes an attribute with the given QName. The namespace defined by the name is used to find the schema in which the attribute is defined.- Parameters:
aAttName- the name of the attribute, which must return the correct value for aAttName.getNamespaceURI().- Returns:
- the XmlSchema which includes the attribute with name aAttName or null if no such schema is found
-
getFirstSchema
Returns the first XmlSchema added with the given namespace, using addSchema(...)- Parameters:
aNamespace- the namespace in question- Returns:
- the XmlSchema first added with aNamespace
-