olg.csv.bean.parser.impl
Class DecorateParser<T>

Package class diagram package DecorateParser
java.lang.Object
  extended by olg.csv.bean.parser.AbstractParser<T>
      extended by olg.csv.bean.parser.impl.DecorateParser<T>
Type Parameters:
T -

public final class DecorateParser<T>
extends AbstractParser<T>

Parser Decorator use for substitute null and empty string value by a default string to be parsed.


Field Summary
private  String defaut
          the default value.
private  AbstractParser<T> parser
          the decorated parser.
 
Constructor Summary
DecorateParser(AbstractParser<T> parser, String defaut)
          constructs a decorateParser.
 
Method Summary
 T 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

parser

private final AbstractParser<T> parser
the decorated parser.


defaut

private final String defaut
the default value.

Constructor Detail

DecorateParser

public DecorateParser(AbstractParser<T> parser,
                      String defaut)
constructs a decorateParser.

Parameters:
parser - the parser.
defaut - the default value to parse.
Method Detail

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.