O
- the type of Java object this translator instance is able to handlepublic abstract class NumericValueTranslator<O extends Number> extends SimpleValueTranslator<O>
NumberFormatException
s as
InvalidObjectSourceDataException
s.MAX_STRING_REPRESENTATION_LENGTH
Constructor and Description |
---|
NumericValueTranslator() |
Modifier and Type | Method and Description |
---|---|
protected abstract O |
parseValue(String representation,
ReaderStreamDataProvider<?> streamDataProvider) |
O |
representationToJava(String representation,
ReaderStreamDataProvider<?> streamDataProvider)
Converts the specified string representation to a new instance of the according Java object.
|
hasStringRepresentation, javaToRepresentation, readXMLRepresentation, writeXMLRepresentation
equals, hashCode
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getObjectClass
public NumericValueTranslator()
protected abstract O parseValue(String representation, ReaderStreamDataProvider<?> streamDataProvider) throws NumberFormatException
NumberFormatException
public O representationToJava(String representation, ReaderStreamDataProvider<?> streamDataProvider) throws InvalidObjectSourceDataException, UnsupportedOperationException
ObjectTranslator
If #getClass()
returns an interface for this instance, the concrete class of the returned object may
depend on the representation.
representation
- the string representation of the object to be createdstreamDataProvider
- the stream data provider of the calling reader (Maybe null
. Some translators will use it to gain
additional status information required for translating, e.g. prefix to namespace mapping for creating QNames.)InvalidObjectSourceDataException
- if the specified string representation cannot be parsed to a supported objectUnsupportedOperationException
- if objects handled by this instance can only be represented as XML