public class ReferenceValueParser<I extends uk.ac.ed.epcc.webapp.Indexed> extends java.lang.Object implements ValueParser<uk.ac.ed.epcc.webapp.model.data.reference.IndexedReference>
DefaultFormatter| Constructor and Description |
|---|
ReferenceValueParser(uk.ac.ed.epcc.webapp.AppContext c,
uk.ac.ed.epcc.webapp.model.data.reference.IndexedProducer<I> producer) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
format(uk.ac.ed.epcc.webapp.model.data.reference.IndexedReference value)
Format a value as a string.
|
java.lang.Class<uk.ac.ed.epcc.webapp.model.data.reference.IndexedReference> |
getType()
Returns the
Class of object this ValueParser can handle. |
uk.ac.ed.epcc.webapp.model.data.reference.IndexedReference |
parse(java.lang.String valueString)
Parses the specified string and constructs the appropriate object out of
it.
|
public ReferenceValueParser(uk.ac.ed.epcc.webapp.AppContext c,
uk.ac.ed.epcc.webapp.model.data.reference.IndexedProducer<I> producer)
public java.lang.Class<uk.ac.ed.epcc.webapp.model.data.reference.IndexedReference> getType()
ValueParserClass of object this ValueParser can handle.
The ValueParser.parse(String) method must return objects that are assignable to this type.
The #format(T) method can format any object assignable to this type.
The returned class will be the
exact Class (i.e. not a subclass) of this
ValueParser's typegetType in interface ValueFormatter<uk.ac.ed.epcc.webapp.model.data.reference.IndexedReference>getType in interface ValueParser<uk.ac.ed.epcc.webapp.model.data.reference.IndexedReference>ValueParserpublic uk.ac.ed.epcc.webapp.model.data.reference.IndexedReference parse(java.lang.String valueString)
throws ValueParseException
ValueParserparse in interface ValueParser<uk.ac.ed.epcc.webapp.model.data.reference.IndexedReference>ValueParseException - If valueString is not of a format that allows this
parser to convert it into an object of type TvalueString - The string to parsevalueStringpublic java.lang.String format(uk.ac.ed.epcc.webapp.model.data.reference.IndexedReference value)
ValueParserformat in interface ValueFormatter<uk.ac.ed.epcc.webapp.model.data.reference.IndexedReference>format in interface ValueParser<uk.ac.ed.epcc.webapp.model.data.reference.IndexedReference>value - The object to format