|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.revusky.oreo.metadata.Field | +--com.revusky.oreo.metadata.StringField
Field metadata that represents a field with a string value. The string may be "normalized" to all caps, all lower case, etc. Also, a regular expression pattern may be specified to validate against.
Field Summary | |
protected gnu.regexp.RE |
regexp
The regexp that expresses a constraint that the field must satisfy. |
protected java.lang.String |
regexpString
|
Fields inherited from class com.revusky.oreo.metadata.Field |
defaultValueString, properties, sqlType |
Constructor Summary | |
StringField()
|
Method Summary | |
void |
checkValidValue(Record rec,
java.lang.Object value)
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. |
protected java.lang.String |
decodeMultiLineString(java.lang.String input)
Deal with a string with embedded \n literals for newlines. |
protected java.lang.String |
encodeMultiLineString(java.lang.String input)
routine that encodes a string so that it can be all on one line in a key=value storage scheme. |
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.Object |
getObjectFromString(Record rec,
java.lang.String s)
Given the string representation of a field, return its internal java object representation. |
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. |
java.lang.String |
normalize(java.lang.String s)
"normalize" the string passed in. |
protected void |
processProperties()
|
java.lang.String |
valueToString(java.lang.Object o)
returns the preferred the String representation of the object in question. |
Methods inherited from class com.revusky.oreo.metadata.Field |
defaultValue, getLocalizedName, getName, getProperty, getSQLType, hashCode, isFieldOf, isRequired, processDefaultValue, processNormalization, setDefaultValue, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected transient gnu.regexp.RE regexp
protected java.lang.String regexpString
Constructor Detail |
public StringField()
Method Detail |
protected void init(org.w3c.dom.Element element) throws org.xml.sax.SAXException
Field
init
in class Field
protected void processProperties() throws org.xml.sax.SAXException
processProperties
in class Field
public java.lang.Class getJavaType()
FieldDescriptor
getJavaType
in class Field
public java.lang.Object getObjectFromString(Record rec, java.lang.String s) throws MangledDataException
FieldDescriptor
public java.lang.String normalize(java.lang.String s)
FieldDescriptor
normalize
in class Field
com.revusky.oreo.FieldDescriptor
public java.lang.String valueToString(java.lang.Object o)
FieldDescriptor
valueToString
in class Field
public void checkValidValue(Record rec, java.lang.Object value) throws java.io.IOException
FieldDescriptor
checkValidValue
in class Field
com.revusky.oreo.FieldDescriptor
java.io.IOException
- Description of Exceptionprotected java.lang.String encodeMultiLineString(java.lang.String input)
protected java.lang.String decodeMultiLineString(java.lang.String input)
public java.lang.Object convertFromJDBC(java.lang.Object o)
FieldDescriptor
convertFromJDBC
in class Field
public java.lang.Object getCopy(java.lang.Object o)
FieldDescriptor
getCopy
in class Field
com.revusky.oreo.FieldDescriptor
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |