Class SchemasByNamespace

java.lang.Object
org.apache.ws.commons.schema.walker.SchemasByNamespace

class SchemasByNamespace extends Object
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 Details

  • Constructor Details

    • SchemasByNamespace

      SchemasByNamespace()
  • Method Details

    • addSchema

      public void addSchema(String aNamespace, XmlSchema aSchema)
      Associates an XmlSchema with a namespace
      Parameters:
      aNamespace - the namespace in question
      aSchema - a schema with aNamespace as its target
    • getSchemas

      public XmlSchema[] getSchemas(String aNamespace)
      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

      public XmlSchemaType getTypeByName(QName aTypeName)
      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

      public XmlSchemaGroup getGroupByName(QName aGroupName)
      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

      public XmlSchemaAttribute getAttributeByName(QName aAttName)
      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

      public XmlSchemaAttributeGroup getAttributeGroupByName(QName aAGName)
      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

      public XmlSchemaElement getElementByName(QName aElementName)
      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

      public XmlSchema getSchemaDefiningElement(QName aElementName)
      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

      public XmlSchema getSchemaDefiningAttribute(QName aAttName)
      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

      public XmlSchema getFirstSchema(String aNamespace)
      Returns the first XmlSchema added with the given namespace, using addSchema(...)
      Parameters:
      aNamespace - the namespace in question
      Returns:
      the XmlSchema first added with aNamespace