com.softwareag.centrasite.appl.framework.types.impl
Class AttributeDescriptionImpl

java.lang.Object
  extended by com.softwareag.centrasite.appl.framework.types.impl.AttributeDescriptionImpl
All Implemented Interfaces:
AttributeDescription
Direct Known Subclasses:
ClassificationAttributeDescriptionImpl, FileAttributeDescriptionImpl, RelationshipAttributeDescriptionImpl, SlotAttributeDescriptionImpl

public class AttributeDescriptionImpl
extends java.lang.Object
implements AttributeDescription


Field Summary
 
Fields inherited from interface com.softwareag.centrasite.appl.framework.types.AttributeDescription
MAXOCCURS_1, MAXOCCURS_UNBOUNDED, MINOCCURS_0, MINOCCURS_1, TYPE_ANY_SIMPLE_TYPE, TYPE_BOOLEAN, TYPE_DATE, TYPE_DATE_TIME, TYPE_DECIMAL, TYPE_DOUBLE, TYPE_DURATION, TYPE_NUMBER, TYPE_STRING, TYPE_TIME, TYPE_URL
 
Constructor Summary
AttributeDescriptionImpl(com.centrasite.jaxr.type.CentraSiteAttribute csAttribute)
          Creates an AttributeDescription using the provided CentraSiteAttribute
 
Method Summary
 com.centrasite.jaxr.type.CentraSiteAttribute getCentraSiteAttribute()
           
 com.centrasite.jaxr.type.CentraSiteAttribute getCsAttribute()
          Returns the CentraSiteAttribute object associated with the AttributeDescription
 java.lang.String getDataType()
          Get the data type of the attribute.
 java.lang.Object getDefaultValue()
          The default value for this attribute.
 java.lang.String getDescription()
          Get the attribute description.
 java.lang.String getDisplayName()
          Get the attribute's display name.
 java.lang.String[] getEnumValues()
          Retrieves the enumeration values for string attribute.
 java.lang.String getLocalName()
          Derive local part from complete name.
 java.lang.String getMaxOccurs()
          
 java.lang.String getMinOccurs()
          
 java.lang.String getName()
          Get the attribute name.
 int getPrecision()
          Get the precision for a "number" attribute.
 AttributeType getType()
          Get the attribute type.
 java.lang.String getUnitLabel()
          Return this slot's unit label.
 boolean isIndexed()
          Checks whether a database index is defined for this attribute.
 boolean isPrefix()
          Return whether this slot's unit label is a prefix or suffix value.
 boolean isReadOnly()
          Checks whether the attribute value can be edited in an object.
 boolean isSystemDefined()
          Tells whether the attribute is system defined or not
 boolean isUsed()
          Checks if this attribute is being used in object instance.
 void setCsAttribute(com.centrasite.jaxr.type.CentraSiteAttribute csAttribute)
          Sets the CentraSiteAttribute object associated with the AttributeDescription
 void setDefaultValue(java.lang.Object value)
          Default value for object properties represented by this attribute.
 void setDescription(java.lang.String description)
          Set the attribute description.
 void setEnumValues(java.lang.String[] enumValues)
          Set the enumeration values for this attribute, in case it is of type string.
 void setIndexed(boolean indexed)
          Sets whether a database index should be defined for this attribute.
 void setMaxOccurs(java.lang.String maxOccurs)
          
 void setMinOccurs(java.lang.String minOccurs)
          
 void setName(java.lang.String name)
          Set the attribute name.
 void setPrecision(int precision)
          Set the precision for a "number" attribute.
 void setPrefix(boolean prefix)
          Specify whether this slot's unit label is to be a prefix or suffix value.
 void setReadOnly(boolean readOnly)
          Sets whether the attribute value can be edited in an object
 void setUnitLabel(java.lang.String unitLabel)
          Set this slot's unit label.
 java.lang.String toXML()
          Return the XML representation of this attribute.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeDescriptionImpl

public AttributeDescriptionImpl(com.centrasite.jaxr.type.CentraSiteAttribute csAttribute)
Creates an AttributeDescription using the provided CentraSiteAttribute

Parameters:
csAttribute -
Method Detail

getCsAttribute

public com.centrasite.jaxr.type.CentraSiteAttribute getCsAttribute()
Returns the CentraSiteAttribute object associated with the AttributeDescription

Returns:
CentraSiteAttribute

setCsAttribute

public void setCsAttribute(com.centrasite.jaxr.type.CentraSiteAttribute csAttribute)
Sets the CentraSiteAttribute object associated with the AttributeDescription


getDataType

public java.lang.String getDataType()
Get the data type of the attribute.

Specified by:
getDataType in interface AttributeDescription
Returns:
data type

getDefaultValue

public java.lang.Object getDefaultValue()
                                 throws CSAppFrameworkException
The default value for this attribute.

Specified by:
getDefaultValue in interface AttributeDescription
Returns:
default value
Throws:
CSAppFrameworkException

getDescription

public java.lang.String getDescription()
                                throws CSAppFrameworkException
Get the attribute description.

Specified by:
getDescription in interface AttributeDescription
Returns:
description
Throws:
CSAppFrameworkException

getEnumValues

public java.lang.String[] getEnumValues()
                                 throws CSAppFrameworkException
Retrieves the enumeration values for string attribute.

Specified by:
getEnumValues in interface AttributeDescription
Returns:
enumeration values
Throws:
CSAppFrameworkException

getLocalName

public java.lang.String getLocalName()
                              throws CSAppFrameworkException
Derive local part from complete name.

Specified by:
getLocalName in interface AttributeDescription
Returns:
local part
Throws:
CSAppFrameworkException

getMaxOccurs

public java.lang.String getMaxOccurs()
                              throws CSAppFrameworkException

Specified by:
getMaxOccurs in interface AttributeDescription
Returns:
max occurs
Throws:
CSAppFrameworkException

getMinOccurs

public java.lang.String getMinOccurs()
                              throws CSAppFrameworkException

Specified by:
getMinOccurs in interface AttributeDescription
Returns:
min occurs
Throws:
CSAppFrameworkException

getName

public java.lang.String getName()
                         throws CSAppFrameworkException
Get the attribute name.

Specified by:
getName in interface AttributeDescription
Returns:
name name in the form "{uri}local-name".
Throws:
CSAppFrameworkException

getDisplayName

public java.lang.String getDisplayName()
                                throws CSAppFrameworkException
Get the attribute's display name. If there is no explicit display name return the name. base class implementation, might be overwritten by sub-classes

Specified by:
getDisplayName in interface AttributeDescription
Returns:
the attribute's display name
Throws:
CSAppFrameworkException

isReadOnly

public boolean isReadOnly()
                   throws CSAppFrameworkException
Checks whether the attribute value can be edited in an object.

Specified by:
isReadOnly in interface AttributeDescription
Returns:
true if the attribute value is editable, false otherwise.
Throws:
CSAppFrameworkException

isUsed

public boolean isUsed()
               throws CSAppFrameworkException
Checks if this attribute is being used in object instance.

Specified by:
isUsed in interface AttributeDescription
Returns:
whether the attribute is being used
Throws:
CSAppFrameworkException

setDefaultValue

public void setDefaultValue(java.lang.Object value)
                     throws java.lang.Exception
Default value for object properties represented by this attribute. This value must from the attribute type.

Specified by:
setDefaultValue in interface AttributeDescription
Throws:
java.lang.Exception

setDescription

public void setDescription(java.lang.String description)
                    throws CSAppFrameworkException
Set the attribute description.

Specified by:
setDescription in interface AttributeDescription
Throws:
CSAppFrameworkException

setEnumValues

public void setEnumValues(java.lang.String[] enumValues)
                   throws CSAppFrameworkException
Description copied from interface: AttributeDescription
Set the enumeration values for this attribute, in case it is of type string.

Specified by:
setEnumValues in interface AttributeDescription
Throws:
CSAppFrameworkException

setMaxOccurs

public void setMaxOccurs(java.lang.String maxOccurs)
                  throws CSAppFrameworkException

Specified by:
setMaxOccurs in interface AttributeDescription
Throws:
CSAppFrameworkException

setMinOccurs

public void setMinOccurs(java.lang.String minOccurs)
                  throws CSAppFrameworkException

Specified by:
setMinOccurs in interface AttributeDescription
Throws:
CSAppFrameworkException

setName

public void setName(java.lang.String name)
             throws CSAppFrameworkException
Set the attribute name.

Specified by:
setName in interface AttributeDescription
Parameters:
name - name in the form "{uri}local-name".
Throws:
CSAppFrameworkException

setReadOnly

public void setReadOnly(boolean readOnly)
                 throws CSAppFrameworkException
Sets whether the attribute value can be edited in an object

Specified by:
setReadOnly in interface AttributeDescription
Throws:
CSAppFrameworkException

getType

public AttributeType getType()
Get the attribute type.

Specified by:
getType in interface AttributeDescription
Returns:
type.

isIndexed

public boolean isIndexed()
Checks whether a database index is defined for this attribute. Only attributes of type AttributeType.SLOT can be indexed.

Specified by:
isIndexed in interface AttributeDescription
Returns:
true if the attribute is of type AttributeType.SLOT and a database index is defined for it

setIndexed

public void setIndexed(boolean indexed)
Sets whether a database index should be defined for this attribute. Only attributes of type AttributeType.SLOT can be indexed.

Specified by:
setIndexed in interface AttributeDescription

getCentraSiteAttribute

public com.centrasite.jaxr.type.CentraSiteAttribute getCentraSiteAttribute()

getPrecision

public int getPrecision()
                 throws CSAppFrameworkException
Description copied from interface: AttributeDescription
Get the precision for a "number" attribute.

Specified by:
getPrecision in interface AttributeDescription
Returns:
the precision
Throws:
CSAppFrameworkException

getUnitLabel

public java.lang.String getUnitLabel()
Description copied from interface: AttributeDescription
Return this slot's unit label.

Specified by:
getUnitLabel in interface AttributeDescription
Returns:
the unit label. May be null.

isPrefix

public boolean isPrefix()
Description copied from interface: AttributeDescription
Return whether this slot's unit label is a prefix or suffix value.

Specified by:
isPrefix in interface AttributeDescription
Returns:
true if the unit label is a prefix, false for suffix.

isSystemDefined

public boolean isSystemDefined()
                        throws CSAppFrameworkException
Description copied from interface: AttributeDescription
Tells whether the attribute is system defined or not

Specified by:
isSystemDefined in interface AttributeDescription
Returns:
boolean
Throws:
CSAppFrameworkException

setPrecision

public void setPrecision(int precision)
                  throws CSAppFrameworkException
Description copied from interface: AttributeDescription
Set the precision for a "number" attribute.

Specified by:
setPrecision in interface AttributeDescription
Parameters:
precision - the precision
Throws:
CSAppFrameworkException

setPrefix

public void setPrefix(boolean prefix)
Description copied from interface: AttributeDescription
Specify whether this slot's unit label is to be a prefix or suffix value.

Specified by:
setPrefix in interface AttributeDescription
Parameters:
prefix - true if the unit label is a prefix, false for suffix.

setUnitLabel

public void setUnitLabel(java.lang.String unitLabel)
Description copied from interface: AttributeDescription
Set this slot's unit label. By default this is a prefix value.

Specified by:
setUnitLabel in interface AttributeDescription
Parameters:
unitLabel - the unit label

toXML

public java.lang.String toXML()
                       throws CSAppFrameworkException
Description copied from interface: AttributeDescription
Return the XML representation of this attribute.

Specified by:
toXML in interface AttributeDescription
Returns:
the XML representation of this attribute
Throws:
CSAppFrameworkException