org.apache.ws.commons.schema.utils
Class XmlSchemaNamedImpl

java.lang.Object
  extended by 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 Summary
protected  XmlSchema parentSchema
           
protected  XmlSchemaRefBase refTwin
           
 
Constructor Summary
XmlSchemaNamedImpl(XmlSchema parent, boolean topLevel)
          Create a new named object.
 
Method Summary
 boolean equals(Object what)
           
 String getName()
          Retrieve the name.
 XmlSchema getParent()
          Retrieve the parent schema.
 QName getQName()
          Get the QName for this object.
 int hashCode()
           
 boolean isAnonymous()
          
 boolean isTopLevel()
          
 void setName(String name)
          Set the name.
 void setRefObject(XmlSchemaRefBase refBase)
          If the named object also implements ref=, it should pass the reference object here for some error checking.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parentSchema

protected XmlSchema parentSchema

refTwin

protected XmlSchemaRefBase refTwin
Constructor Detail

XmlSchemaNamedImpl

public XmlSchemaNamedImpl(XmlSchema parent,
                          boolean topLevel)
Create a new named object.

Parameters:
parent - the parent schema.
Method Detail

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:
XmlSchemaNamedWithForm.getWireName()

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.


Copyright © 2004-2015 The Apache Software Foundation. All Rights Reserved.