VdexReload 1.1.3 API

uk.ac.reload.moonunit.schema
Class ReloadSchemaAttribute

java.lang.Object
  extended byuk.ac.reload.moonunit.schema.ReloadSchemaNode
      extended byuk.ac.reload.moonunit.schema.ReloadSchemaAttribute

public class ReloadSchemaAttribute
extends ReloadSchemaNode

An Attribute node that represents an Attribute of an Element in the Schema.


Field Summary
protected  org.exolab.castor.xml.schema.AttributeDecl _attDecl
          The wrapped Castor AttributeDecl that we will interrogate
 
Fields inherited from class uk.ac.reload.moonunit.schema.ReloadSchemaNode
_parent
 
Constructor Summary
ReloadSchemaAttribute(org.exolab.castor.xml.schema.AttributeDecl attDecl)
          Constructor.
 
Method Summary
 org.jdom.Attribute createAttribute()
          Create a JDOM Attribute based upon this ReloadSchemaAttribute
 java.lang.String getAtomicBaseTypeName()
          Get the Atomic Base type name of this Attribute.
 java.lang.String getBaseTypeName()
          Get the base type name of this Attribute.
 java.lang.String getDefaultValue()
          Returns the default value of this Attribute.
 DomPath getDomPath()
          Get the path to this Attribute.
 java.lang.String getFacetValue(java.lang.String facetName)
          Get a facet value or null
 java.lang.Long getMaxLength()
          Get the max length of this Attribute.
 java.lang.Long getMinLength()
          Get the min length of this Attribute.
 java.lang.String getName()
          Get the name of the Attribute
 org.jdom.Namespace getNamespace()
          Get the namespace of this attribute
 java.lang.String getNamespacePrefix()
          Get the namespace prefix of this attribute, or "" if no prefix
 java.lang.String getTypeName()
          Get the type name of this Attribute.
 java.lang.String getUse()
          Get the use of this attribute.
 ReloadVocabularyList getVocabularyList()
          Get the inbuilt vocabulary list for this Attribute.
 
Methods inherited from class uk.ac.reload.moonunit.schema.ReloadSchemaNode
getParent, getReloadSchema, isExternalNamespace, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_attDecl

protected org.exolab.castor.xml.schema.AttributeDecl _attDecl
The wrapped Castor AttributeDecl that we will interrogate

Constructor Detail

ReloadSchemaAttribute

public ReloadSchemaAttribute(org.exolab.castor.xml.schema.AttributeDecl attDecl)
Constructor.

Parameters:
attDecl - The wrapped Castor AttributeDecl
Method Detail

getName

public java.lang.String getName()
Get the name of the Attribute

Specified by:
getName in class ReloadSchemaNode
Returns:
The Attribute Schema name

getUse

public java.lang.String getUse()
Get the use of this attribute. This can be "optional", "required" or "prohibited"

Returns:
the use of this attribute

getDefaultValue

public java.lang.String getDefaultValue()
Returns the default value of this Attribute. This method should only be called from a SchemaController

Specified by:
getDefaultValue in class ReloadSchemaNode
Returns:
the default value of this Attribute or null if no default was specified.

getNamespacePrefix

public java.lang.String getNamespacePrefix()
Get the namespace prefix of this attribute, or "" if no prefix

Specified by:
getNamespacePrefix in class ReloadSchemaNode
Returns:
the namespace prefix of this Attribute, or "" if no prefix

getNamespace

public org.jdom.Namespace getNamespace()
Get the namespace of this attribute

Specified by:
getNamespace in class ReloadSchemaNode
Returns:
the Namespace of this Attribute

getVocabularyList

public ReloadVocabularyList getVocabularyList()
Get the inbuilt vocabulary list for this Attribute. If it's a Simple type of type BOOLEAN we can return "true, false" as the list. If the Attribute has an "enumeration" facet from the Schema we return those, otherwise the caller should look in the Vocab Helper file. This method should only be called from a SchemaController.

Returns:
vocabulary list for this Attribute or null if there isn't one

getTypeName

public java.lang.String getTypeName()
Get the type name of this Attribute.

Specified by:
getTypeName in class ReloadSchemaNode
Returns:
the type name of this Attribute

getMaxLength

public java.lang.Long getMaxLength()
Get the max length of this Attribute.

Returns:
the max length of this Attribute

getMinLength

public java.lang.Long getMinLength()
Get the min length of this Attribute.

Returns:
the min length of this Attribute

getBaseTypeName

public java.lang.String getBaseTypeName()
Get the base type name of this Attribute.

Specified by:
getBaseTypeName in class ReloadSchemaNode
Returns:
the base type name of this Attribute

getAtomicBaseTypeName

public java.lang.String getAtomicBaseTypeName()
Get the Atomic Base type name of this Attribute.

Returns:
the base type name of this Attribute or the type name if there is none

getFacetValue

public java.lang.String getFacetValue(java.lang.String facetName)
Get a facet value or null

Specified by:
getFacetValue in class ReloadSchemaNode
Parameters:
facetName - the name of the facet
Returns:
a Facet Value or null

createAttribute

public org.jdom.Attribute createAttribute()
Create a JDOM Attribute based upon this ReloadSchemaAttribute

Returns:
A JDOM Attribute based upon this ReloadSchemaAttribute

getDomPath

public DomPath getDomPath()
Get the path to this Attribute. This will be the full path of all parent elements plus a "@" and this Attribute's name. For example: manifest.resources.resource@identifier

Specified by:
getDomPath in class ReloadSchemaNode
Returns:
the path for this Attribute

VdexReload 1.1.3 API