|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jmatchparser.util.csv.fieldreader.ParseFormat<T>
T
- Type of the parsed objectpublic abstract class ParseFormat<T>
A format for parsing a String to an object of a possibly different type.
Field Summary | |
---|---|
static ParseFormat<String> |
IDENTITY
Parse format that returns the original string. |
Constructor Summary | |
---|---|
ParseFormat()
|
Method Summary | ||
---|---|---|
static
|
forEnum(Class<TT> enumType)
Parse format that parses Enum names to their values. |
|
static ParseFormat<Date> |
fromDateFormat(DateFormat format)
Parse format that uses a DateFormat for parsing. |
|
static ParseFormat<Object> |
fromFormat(Format format)
Parse format that uses a Format for parsing. |
|
static ParseFormat<Number> |
fromNumberFormat(NumberFormat format)
Parse format that uses a NumberFormat for parsing. |
|
static
|
fromReplacement(Pattern regex,
String replacement,
ParseFormat<TT> nextFormat)
Parse format that performs a regex replacement before parsing with another format. |
|
abstract T |
parse(String source)
Parse the given source completely. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final ParseFormat<String> IDENTITY
Constructor Detail |
---|
public ParseFormat()
Method Detail |
---|
public abstract T parse(String source) throws ParseException
source
- Source string
ParseException
public static ParseFormat<Object> fromFormat(Format format)
Format
for parsing.
public static ParseFormat<Date> fromDateFormat(DateFormat format)
DateFormat
for parsing.
public static ParseFormat<Number> fromNumberFormat(NumberFormat format)
NumberFormat
for parsing.
public static <TT> ParseFormat<TT> fromReplacement(Pattern regex, String replacement, ParseFormat<TT> nextFormat)
public static <TT extends Enum<TT>> ParseFormat<TT> forEnum(Class<TT> enumType)
Enum
names to their values.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |