olg.csv.bean.parser.impl
Class ConstructorParser<T>
java.lang.Object
olg.csv.bean.parser.AbstractParser<T>
olg.csv.bean.parser.impl.ConstructorParser<T>
- Type Parameters:
T
- the parser target type
public final class ConstructorParser<T>
- extends AbstractParser<T>
Parser Use a constructor with string argument to parse a string.
Constructor Summary |
ConstructorParser(Class<T> clazz)
Returns the Constructor for the given class which have a single String
argument. |
Method Summary |
T |
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 |
constructeur
private Constructor<T> constructeur
- The constructor to use.
ConstructorParser
public ConstructorParser(Class<T> clazz)
throws NoSuchMethodException
- Returns the Constructor for the given class which have a single String
argument.
- Parameters:
clazz
- the parser target class
- Throws:
NoSuchMethodException
- if no such constructor exists
parse
public T parse(String str)
- Description copied from class:
AbstractParser
- Converts a string into a new instance of .
- Specified by:
parse
in class AbstractParser<T>
- Parameters:
str
- the string.
- Returns:
- the new instance of .
Copyright © 2014. All Rights Reserved.