olg.csv.bean.parser
Enum PrimitiveType

Package class diagram package PrimitiveType
java.lang.Object
  extended by java.lang.Enum<PrimitiveType>
      extended by olg.csv.bean.parser.PrimitiveType
All Implemented Interfaces:
Serializable, Comparable<PrimitiveType>

 enum PrimitiveType
extends Enum<PrimitiveType>

Allows to associate a parser to a primitive type.


Enum Constant Summary
booleanType
          Boolean type.
byteType
          Byte type. 0 is returned as null or empty string is parsed.
charType
          Character type. is returned as null or empty string is parsed.
doubleType
          Double type. 0 is returned as null or empty string is parsed.
floatType
          Float type. 0 is returned as null or empty string is parsed.
intType
          Integer type. 0 is returned as null or empty string is parsed.
longType
          Long type. 0 is returned as null or empty string is parsed.
shortType
          Short type. 0 is returned as null or empty string is parsed.
 
Field Summary
private  AbstractParser<?> parser
          the parser to use.
private  String primitiveName
          the name of the primitive.
 
Method Summary
 AbstractParser<?> getParser()
          The parse associated with the primitive type this enum matches.
static PrimitiveType getPrimitiveTypeByName(String name)
          Returns the enum value identify by its name.
static PrimitiveType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static PrimitiveType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

booleanType

public static final PrimitiveType booleanType
Boolean type. "false" is returned as null or empty string is parsed.


byteType

public static final PrimitiveType byteType
Byte type. 0 is returned as null or empty string is parsed.


shortType

public static final PrimitiveType shortType
Short type. 0 is returned as null or empty string is parsed.


intType

public static final PrimitiveType intType
Integer type. 0 is returned as null or empty string is parsed.


longType

public static final PrimitiveType longType
Long type. 0 is returned as null or empty string is parsed.


floatType

public static final PrimitiveType floatType
Float type. 0 is returned as null or empty string is parsed.


doubleType

public static final PrimitiveType doubleType
Double type. 0 is returned as null or empty string is parsed.


charType

public static final PrimitiveType charType
Character type. is returned as null or empty string is parsed.

Field Detail

primitiveName

private String primitiveName
the name of the primitive.


parser

private AbstractParser<?> parser
the parser to use.

Method Detail

values

public static PrimitiveType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (PrimitiveType c : PrimitiveType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static PrimitiveType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getParser

public AbstractParser<?> getParser()
The parse associated with the primitive type this enum matches.

Returns:
the parser matching the primitive type.

getPrimitiveTypeByName

public static PrimitiveType getPrimitiveTypeByName(String name)
Returns the enum value identify by its name.

Parameters:
name - nom du type primitif.
Returns:
null if the given name doesn't match any enum value.


Copyright © 2014. All rights reserved.