|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.data.mif.MIFValueSetter
Utility class for setting object values from strings and vice-versa.
The main use of this class is building a schema-dependent array of "parsers" which speed up the process of reading text lines and converting them into features.
Field Summary | |
protected java.lang.Object |
objValue
|
protected java.lang.String |
strValue
|
Constructor Summary | |
MIFValueSetter(java.lang.String defa)
The constructor accepts a default value for the ValueSetter. |
Method Summary | |
java.lang.String |
getError()
Gets and resets the current error message. |
java.lang.String |
getString()
Returns the string value. |
java.lang.Object |
getValue()
Gets the object value. |
boolean |
setString(java.lang.String value)
Sets the value as a String. |
void |
setValue(java.lang.Object value)
Sets the object value, and calculates the String value. |
protected abstract void |
stringToValue()
This method must be overridden by descendants in order to implement the correct conversion between strings and object values. |
protected void |
valueToString()
Converts an object value to string - the default implementation uses toString for non-null values. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String strValue
protected java.lang.Object objValue
Constructor Detail |
public MIFValueSetter(java.lang.String defa)
The constructor accepts a default value for the ValueSetter.
defa
- String representation of the default valueMethod Detail |
public final boolean setString(java.lang.String value)
Sets the value as a String. After a setString call, getValue() can be used to access the converted value.
value
- String representation of the object value
public final java.lang.String getString()
Returns the string value.
public final void setValue(java.lang.Object value)
Sets the object value, and calculates the String value.
value
- The Object valuepublic final java.lang.Object getValue()
Gets the object value.
public final java.lang.String getError()
Gets and resets the current error message.
protected void valueToString()
Converts an object value to string - the default implementation uses toString for non-null values.
protected abstract void stringToValue() throws java.lang.Exception
This method must be overridden by descendants in order to implement the
correct conversion between strings and object values.
Must throw an exception if conversion failed
java.lang.Exception
- if value conversion failed
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |