olg.csv.bean.parser.impl
Class EnumParser<E extends Enum<E>>
java.lang.Object
olg.csv.bean.parser.AbstractParser<E>
olg.csv.bean.parser.impl.EnumParser<E>
- Type Parameters:
E
-
public final class EnumParser<E extends Enum<E>>
- extends AbstractParser<E>
Parser dedicated in parsing string into enum.
Constructor Summary |
EnumParser(Class<E> enumClass)
constructs EnumParser to parse a specific enum class. |
Method Summary |
E |
parse(String str)
Converts a string into a new instance of . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
enumClass
private final Class<E extends Enum<E>> enumClass
- Enum class.
EnumParser
public EnumParser(Class<E> enumClass)
- constructs EnumParser to parse a specific enum class.
- Parameters:
enumClass
- the enum class
parse
public E parse(String str)
- Converts a string into a new instance of . Throws a ParseException if the argument is not
null
and could not be evaluate as an enum constant.
- Specified by:
parse
in class AbstractParser<E extends Enum<E>>
- Parameters:
str
- the string.
- Returns:
- the new instance of .
Copyright © 2014. All Rights Reserved.