org.apache.ws.commons.schema
Class XmlSchemaAttribute

java.lang.Object
  extended by org.apache.ws.commons.schema.XmlSchemaObject
      extended by org.apache.ws.commons.schema.XmlSchemaAnnotated
          extended by org.apache.ws.commons.schema.XmlSchemaAttributeOrGroupRef
              extended by org.apache.ws.commons.schema.XmlSchemaAttribute
All Implemented Interfaces:
XmlSchemaNamed, XmlSchemaNamedWithForm, XmlSchemaObjectBase, XmlSchemaAttributeGroupMember, XmlSchemaItemWithRef<XmlSchemaAttribute>, XmlSchemaItemWithRefBase

public class XmlSchemaAttribute
extends XmlSchemaAttributeOrGroupRef
implements XmlSchemaNamedWithForm, XmlSchemaAttributeGroupMember, XmlSchemaItemWithRef<XmlSchemaAttribute>

Class for attributes, representing xs:attribute. This class represents both global and nested attributes.


Constructor Summary
XmlSchemaAttribute(XmlSchema schema, boolean topLevel)
          Create a new attribute.
 
Method Summary
 String getDefaultValue()
           
 String getFixedValue()
           
 XmlSchemaForm getForm()
          Get the current form, which may be inherited from the parent schema.
 String getName()
          Retrieve the name.
 XmlSchema getParent()
          Retrieve the parent schema.
 QName getQName()
          Get the QName for this object.
 XmlSchemaRef<XmlSchemaAttribute> getRef()
           
 XmlSchemaRefBase getRefBase()
           
 XmlSchemaSimpleType getSchemaType()
           
 QName getSchemaTypeName()
           
 QName getTargetQName()
           
 XmlSchemaUse getUse()
           
 QName getWireName()
          The name of this item as it is sent 'over the wire' or stored in an XML file.
 boolean isAnonymous()
           
 boolean isFormSpecified()
          True if this item has a specified form, false if it inherits from the parent schema.
 boolean isRef()
           
 boolean isTopLevel()
           
 void setDefaultValue(String defaultValue)
           
 void setFixedValue(String fixedValue)
           
 void setForm(XmlSchemaForm form)
          Set the schema form.
 void setName(String name)
          Set the name.
 void setSchemaType(XmlSchemaSimpleType schemaType)
           
 void setSchemaTypeName(QName schemaTypeName)
           
 void setUse(XmlSchemaUse use)
           
 
Methods inherited from class org.apache.ws.commons.schema.XmlSchemaAnnotated
getAnnotation, getId, getUnhandledAttributes, setAnnotation, setId, setUnhandledAttributes, toString
 
Methods inherited from class org.apache.ws.commons.schema.XmlSchemaObject
addMetaInfo, equals, getLineNumber, getLinePosition, getMetaInfoMap, getSourceURI, hashCode, setLineNumber, setLinePosition, setMetaInfoMap, setSourceURI
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XmlSchemaAttribute

public XmlSchemaAttribute(XmlSchema schema,
                          boolean topLevel)
Create a new attribute.

Parameters:
schema - containing scheme.
topLevel - true if a global attribute.
Method Detail

getDefaultValue

public String getDefaultValue()

setDefaultValue

public void setDefaultValue(String defaultValue)

getFixedValue

public String getFixedValue()

setFixedValue

public void setFixedValue(String fixedValue)

getRef

public XmlSchemaRef<XmlSchemaAttribute> getRef()
Specified by:
getRef in interface XmlSchemaItemWithRef<XmlSchemaAttribute>

getSchemaType

public XmlSchemaSimpleType getSchemaType()

setSchemaType

public void setSchemaType(XmlSchemaSimpleType schemaType)

getSchemaTypeName

public QName getSchemaTypeName()

setSchemaTypeName

public void setSchemaTypeName(QName schemaTypeName)

getUse

public XmlSchemaUse getUse()

setUse

public void setUse(XmlSchemaUse use)

getName

public String getName()
Description copied from interface: XmlSchemaNamed
Retrieve the name.

Specified by:
getName in interface XmlSchemaNamed
Returns:
the local name of this object within its schema.

getParent

public XmlSchema getParent()
Description copied from interface: XmlSchemaNamed
Retrieve the parent schema.

Specified by:
getParent in interface XmlSchemaNamed
Returns:
the containing schema.

getQName

public QName getQName()
Description copied from interface: XmlSchemaNamed
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()

isAnonymous

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

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.

setName

public void setName(String name)
Description copied from interface: XmlSchemaNamed
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.

isFormSpecified

public boolean isFormSpecified()
Description copied from interface: XmlSchemaNamedWithForm
True if this item has a specified form, false if it inherits from the parent schema.

Specified by:
isFormSpecified in interface XmlSchemaNamedWithForm
Returns:

getForm

public XmlSchemaForm getForm()
Description copied from interface: XmlSchemaNamedWithForm
Get the current form, which may be inherited from the parent schema. This will never return XmlSchemaForm.NONE.

Specified by:
getForm in interface XmlSchemaNamedWithForm
Returns:

setForm

public void setForm(XmlSchemaForm form)
Description copied from interface: XmlSchemaNamedWithForm
Set the schema form.

Specified by:
setForm in interface XmlSchemaNamedWithForm
Parameters:
form - Schema form. Pass in XmlSchemaForm.NONE to inherit from the parent schema.

getWireName

public QName getWireName()
Description copied from interface: XmlSchemaNamedWithForm
The name of this item as it is sent 'over the wire' or stored in an XML file. If the form is unqualified, this has "" for a namespaceURI. Otherwise, it is the same as getQName().

Specified by:
getWireName in interface XmlSchemaNamedWithForm
Returns:

isRef

public boolean isRef()
Specified by:
isRef in interface XmlSchemaItemWithRefBase
Returns:
true if this object has a non-null ref.

getTargetQName

public QName getTargetQName()
Specified by:
getTargetQName in interface XmlSchemaItemWithRefBase
Returns:
the Qualified Name of the target of the ref.

getRefBase

public XmlSchemaRefBase getRefBase()
Specified by:
getRefBase in interface XmlSchemaItemWithRefBase
Returns:
the non-generic reference object.


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