Class XmlSchemaNamedImpl

java.lang.Object
org.apache.ws.commons.schema.utils.XmlSchemaNamedImpl
All Implemented Interfaces:
XmlSchemaNamed, XmlSchemaObjectBase
Direct Known Subclasses:
XmlSchemaNamedWithFormImpl

public class XmlSchemaNamedImpl extends Object implements XmlSchemaNamed
Common class of all of the named objects in the XML Schema model. Because 'being named' is not part of the XML Schema logical object hierarchy, this is used as a delegate, not as a base class. By definition, all of these objects live in some particular (parent) schema. The parent is intentionally immutable; there's no good reason to move an object from one schema to another, and this simplifies some of the book-keeping.
  • Field Details

    • parentSchema

      protected XmlSchema parentSchema
    • refTwin

      protected XmlSchemaRefBase refTwin
    • qname

      private QName qname
    • topLevel

      private boolean topLevel
  • Constructor Details

    • XmlSchemaNamedImpl

      public XmlSchemaNamedImpl(XmlSchema parent, boolean topLevel)
      Create a new named object.
      Parameters:
      parent - the parent schema.
  • Method Details

    • equals

      public boolean equals(Object what)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • setRefObject

      public void setRefObject(XmlSchemaRefBase refBase)
      If the named object also implements ref=, it should pass the reference object here for some error checking.
      Parameters:
      refBase -
    • getName

      public String getName()
      Retrieve the name.
      Specified by:
      getName in interface XmlSchemaNamed
      Returns:
      the local name of this object within its schema.
    • isAnonymous

      public boolean isAnonymous()
      Specified by:
      isAnonymous in interface XmlSchemaNamed
      Returns:
      true if this object has no name.
    • setName

      public void setName(String name)
      Set the name. Set to null to render the object anonymous, or to prepare to change it to refer to some other object.
      Specified by:
      setName in interface XmlSchemaNamed
      Parameters:
      name - the name.
    • getParent

      public XmlSchema getParent()
      Retrieve the parent schema.
      Specified by:
      getParent in interface XmlSchemaNamed
      Returns:
      the containing schema.
    • getQName

      public QName getQName()
      Get the QName for this object. This is always the formal name that identifies this item in the schema. If the item has a form (an element or attribute), and the form is 'unqualified', this is not the appropriate QName in an instance document. For those items, the getWiredName method returns the appropriate QName for an instance document.
      Specified by:
      getQName in interface XmlSchemaNamed
      Returns:
      The qualified name of this object.
      See Also:
    • isTopLevel

      public boolean isTopLevel()
      Specified by:
      isTopLevel in interface XmlSchemaNamed
      Returns:
      true if this item is a top-level item of the schema; false if this item is nested inside of some other schema object.