org.jlf.dataMap
Class DataAttributeDescriptor

java.lang.Object
  |
  +--org.jlf.dataMap.DataAttributeDescriptor

public class DataAttributeDescriptor
extends java.lang.Object

This class is an abstract base class to help describe a relational database relationship. This relationship helps tie different business objects together in a manner where coders can simply describe the relationship instead of having to figure out how to hand-code each one.

See Also:
DataMappedObject, DataAttribute

Field Summary
protected  java.lang.Class attributeClass
          The DataAttribute subclass.
protected  java.lang.String attributeName
          The name of the attribute so accessors can conveniently refer to the attribute.
protected  boolean canBeNull
          When reading the attribute from a data source or writing the attribute to a data source, can the attribute be null?
protected  boolean isKeyField
          Is the attribute a key field? The default is false.
protected  int maximumLength
          Maximum length of the attribute.
 
Constructor Summary
protected DataAttributeDescriptor()
          Protect the default constructor, please use a paramterized constructor instead!
  DataAttributeDescriptor(java.lang.String attributeName, java.lang.Class attributeClass, boolean canBeNull)
          Constructs a new instance of the descriptor given required information for creating an attribute.
 
Method Summary
 boolean canBeNull()
          Returns if the attribute can be null.
 java.lang.Class getAttributeClass()
          Getter for the attributeClass.
 java.lang.String getAttributeName()
          Getter for the attributeName.
 int getMaximumLength()
          Returns the maximum length of the attribute, zero if unlimited.
 DataAttribute getNewAttributeInstance()
          Creates a new instance of an attribute given the characteristics in this attribute descriptor.
 boolean isKeyField()
          Returns if the attribute is a key field.
 void setIsKeyField(boolean isKeyField)
          Sets whether the attribute is a key field.
 void setMaximumLength(int maximumLength)
          Sets the maximum length of the attribute, zero if unlimited.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

attributeName

protected java.lang.String attributeName
The name of the attribute so accessors can conveniently refer to the attribute.


attributeClass

protected java.lang.Class attributeClass
The DataAttribute subclass.


canBeNull

protected boolean canBeNull
When reading the attribute from a data source or writing the attribute to a data source, can the attribute be null?


isKeyField

protected boolean isKeyField
Is the attribute a key field? The default is false.


maximumLength

protected int maximumLength
Maximum length of the attribute. Zero means unlimited.

Constructor Detail

DataAttributeDescriptor

protected DataAttributeDescriptor()
Protect the default constructor, please use a paramterized constructor instead!


DataAttributeDescriptor

public DataAttributeDescriptor(java.lang.String attributeName,
                               java.lang.Class attributeClass,
                               boolean canBeNull)
Constructs a new instance of the descriptor given required information for creating an attribute.

Method Detail

getAttributeName

public java.lang.String getAttributeName()
Getter for the attributeName.

Returns:
The attributeName instance variable

getAttributeClass

public java.lang.Class getAttributeClass()
Getter for the attributeClass.

Returns:
The attribute's class, generally a subclass of DataAttribute.

canBeNull

public boolean canBeNull()
Returns if the attribute can be null.


isKeyField

public boolean isKeyField()
Returns if the attribute is a key field.


setIsKeyField

public void setIsKeyField(boolean isKeyField)
Sets whether the attribute is a key field.


getMaximumLength

public int getMaximumLength()
Returns the maximum length of the attribute, zero if unlimited.


setMaximumLength

public void setMaximumLength(int maximumLength)
Sets the maximum length of the attribute, zero if unlimited.


getNewAttributeInstance

public DataAttribute getNewAttributeInstance()
Creates a new instance of an attribute given the characteristics in this attribute descriptor.