|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.revusky.oreo.metadata.Field
abstract base class for objects that represent the metadata relating to a record field. This object knows how to set itself up from a DOM element.
Field Summary | |
protected java.lang.String |
defaultValueString
|
protected java.util.Properties |
properties
|
protected java.lang.String |
sqlType
|
Constructor Summary | |
Field()
|
Method Summary | |
void |
checkValidValue(Record rec,
java.lang.Object o)
Check whether this object is a valid value for this field of the given record. |
java.lang.Object |
convertFromJDBC(java.lang.Object o)
Method to support slurping records from a JDBC result set. |
java.lang.Object |
defaultValue()
returns this field's "default value". |
java.lang.Object |
getCopy(java.lang.Object o)
Used when encapsulation requires Record::getFieldValue() to return a clone of an object. |
java.lang.Class |
getJavaType()
The kind of java object that can live in this record field. |
java.lang.String |
getLocalizedName(java.util.Locale locale)
|
java.lang.String |
getName()
A unique name that identifies the field |
java.lang.String |
getProperty(java.lang.String propertyName)
a hook so that implementors can add other properties |
java.lang.String |
getSQLType()
|
int |
hashCode()
|
protected void |
init(org.w3c.dom.Element element)
If you extend this class and override this method, do make sure to call the super.init() at some point. |
boolean |
isFieldOf(Record rec)
Does this FieldDescriptor describe a field of the Record? Useful for sanity checks. |
boolean |
isRequired()
Used in the core validity checks. |
java.lang.String |
normalize(java.lang.String s)
"normalize" the string passed in. |
protected void |
processDefaultValue()
|
protected void |
processNormalization(org.w3c.dom.Element elem)
|
protected void |
processProperties()
|
protected void |
setDefaultValue(java.lang.Object o)
|
java.lang.String |
toString()
|
java.lang.String |
valueToString(java.lang.Object val)
returns the preferred the String representation of the object in question. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.revusky.oreo.FieldDescriptor |
getObjectFromString |
Field Detail |
protected java.lang.String sqlType
protected java.lang.String defaultValueString
protected java.util.Properties properties
Constructor Detail |
public Field()
Method Detail |
protected void init(org.w3c.dom.Element element) throws org.xml.sax.SAXException
protected void processDefaultValue() throws java.io.IOException
protected void processProperties() throws org.xml.sax.SAXException
protected void processNormalization(org.w3c.dom.Element elem)
public java.lang.Object getCopy(java.lang.Object o)
FieldDescriptor
getCopy
in interface FieldDescriptor
com.revusky.oreo.FieldDescriptor
public final java.lang.String getName()
FieldDescriptor
getName
in interface FieldDescriptor
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean isRequired()
FieldDescriptor
isRequired
in interface FieldDescriptor
public java.lang.String valueToString(java.lang.Object val)
FieldDescriptor
valueToString
in interface FieldDescriptor
public java.lang.Class getJavaType()
FieldDescriptor
getJavaType
in interface FieldDescriptor
public java.lang.String getSQLType()
getSQLType
in interface FieldDescriptor
com.revusky.oreo.FieldDescriptor
UnsupportedOperationException
- public void checkValidValue(Record rec, java.lang.Object o) throws java.io.IOException
FieldDescriptor
checkValidValue
in interface FieldDescriptor
com.revusky.oreo.FieldDescriptor
java.io.IOException
- Description of Exceptionpublic final boolean isFieldOf(Record rec)
FieldDescriptor
isFieldOf
in interface FieldDescriptor
public java.lang.Object defaultValue()
FieldDescriptor
defaultValue
in interface FieldDescriptor
public java.lang.String getLocalizedName(java.util.Locale locale)
getLocalizedName
in interface FieldDescriptor
com.revusky.oreo.FieldDescriptor
protected void setDefaultValue(java.lang.Object o)
public java.lang.String normalize(java.lang.String s)
FieldDescriptor
normalize
in interface FieldDescriptor
com.revusky.oreo.FieldDescriptor
public java.lang.Object convertFromJDBC(java.lang.Object o)
FieldDescriptor
convertFromJDBC
in interface FieldDescriptor
public java.lang.String getProperty(java.lang.String propertyName)
FieldDescriptor
getProperty
in interface FieldDescriptor
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |