BeanIO 2.0.4

org.beanio.types
Class CharacterTypeHandler

java.lang.Object
  extended by org.beanio.types.CharacterTypeHandler
All Implemented Interfaces:
TypeHandler

public class CharacterTypeHandler
extends Object
implements TypeHandler

A type handler for the Character class. A TypeConversionException is thrown if the input text length exceeds 1 character.

Since:
1.0
Author:
Kevin Seim

Field Summary
 
Fields inherited from interface org.beanio.types.TypeHandler
NIL
 
Constructor Summary
CharacterTypeHandler()
           
 
Method Summary
 String format(Object value)
          Formats a Java object into field text.
 Class<?> getType()
          Returns the class type supported by this handler.
 Character parse(String text)
          Parses field text into a Java object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CharacterTypeHandler

public CharacterTypeHandler()
Method Detail

parse

public Character parse(String text)
                throws TypeConversionException
Description copied from interface: TypeHandler
Parses field text into a Java object.

Specified by:
parse in interface TypeHandler
Parameters:
text - the field text to parse, which may be null if the field was not passed in the record
Returns:
the parsed Java object
Throws:
TypeConversionException - if the text cannot be parsed

format

public String format(Object value)
Description copied from interface: TypeHandler
Formats a Java object into field text.

Specified by:
format in interface TypeHandler
Parameters:
value - the Java object to format, which may be null
Returns:
the formatted field text, or null to indicate the value is not present, or TypeHandler.NIL for XML formatted streams

getType

public Class<?> getType()
Description copied from interface: TypeHandler
Returns the class type supported by this handler. Primitive types should not be returned by this method- use the object equivalent instead.

Specified by:
getType in interface TypeHandler
Returns:
the class type supported by this handler

BeanIO 2.0.4

Copyright © 2010-2013 Kevin Seim