olg.csv.bean.parser.impl
Class EnumParser<E extends Enum<E>>

Package class diagram package EnumParser
java.lang.Object
  extended by olg.csv.bean.parser.AbstractParser<E>
      extended by 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.


Field Summary
private  Class<E> enumClass
          Enum class.
 
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 olg.csv.bean.parser.AbstractParser
getCharacterParser, getConstructorParser, getDateParser, getEnumParser, identifyDefaultParser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

enumClass

private final Class<E extends Enum<E>> enumClass
Enum class.

Constructor Detail

EnumParser

public EnumParser(Class<E> enumClass)
constructs EnumParser to parse a specific enum class.

Parameters:
enumClass - the enum class
Method Detail

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.