Class XmlSchemaNamedImpl
java.lang.Object
org.apache.ws.commons.schema.utils.XmlSchemaNamedImpl
- All Implemented Interfaces:
XmlSchemaNamed,XmlSchemaObjectBase
- Direct Known Subclasses:
XmlSchemaNamedWithFormImpl
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
FieldsModifier and TypeFieldDescriptionprotected XmlSchemaprivate QNameprotected XmlSchemaRefBaseprivate boolean -
Constructor Summary
ConstructorsConstructorDescriptionXmlSchemaNamedImpl(XmlSchema parent, boolean topLevel) Create a new named object. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetName()Retrieve the name.Retrieve the parent schema.getQName()Get the QName for this object.inthashCode()booleanbooleanvoidSet the name.voidsetRefObject(XmlSchemaRefBase refBase) If the named object also implements ref=, it should pass the reference object here for some error checking.
-
Field Details
-
parentSchema
-
refTwin
-
qname
-
topLevel
private boolean topLevel
-
-
Constructor Details
-
XmlSchemaNamedImpl
Create a new named object.- Parameters:
parent- the parent schema.
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
setRefObject
If the named object also implements ref=, it should pass the reference object here for some error checking.- Parameters:
refBase-
-
getName
Retrieve the name.- Specified by:
getNamein interfaceXmlSchemaNamed- Returns:
- the local name of this object within its schema.
-
isAnonymous
public boolean isAnonymous()- Specified by:
isAnonymousin interfaceXmlSchemaNamed- Returns:
- true if this object has no name.
-
setName
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:
setNamein interfaceXmlSchemaNamed- Parameters:
name- the name.
-
getParent
Retrieve the parent schema.- Specified by:
getParentin interfaceXmlSchemaNamed- Returns:
- the containing schema.
-
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:
getQNamein interfaceXmlSchemaNamed- Returns:
- The qualified name of this object.
- See Also:
-
isTopLevel
public boolean isTopLevel()- Specified by:
isTopLevelin interfaceXmlSchemaNamed- 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.
-