org.jopendocument.util.convertor
Class StringClobConvertor

java.lang.Object
  extended by org.jopendocument.util.convertor.StringClobConvertor
All Implemented Interfaces:
ValueConvertor<String,Clob>

public class StringClobConvertor
extends Object


Field Summary
static StringClobConvertor INSTANCE
           
static StringClobConvertor INSTANCE_LENIENT
           
 
Constructor Summary
StringClobConvertor(int maxLength)
           
StringClobConvertor(Integer maxLength)
          Create a new instance.
 
Method Summary
 U convert(T o)
           
protected  Clob convertNonNull(String o)
           
 T unconvert(U o)
           
protected  String unconvertNonNull(Clob o)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final StringClobConvertor INSTANCE

INSTANCE_LENIENT

public static final StringClobConvertor INSTANCE_LENIENT
Constructor Detail

StringClobConvertor

public StringClobConvertor(int maxLength)

StringClobConvertor

public StringClobConvertor(Integer maxLength)
Create a new instance. Since String can contain at most Integer.MAX_VALUE characters the maximum length of #unconvert(Clob) must be specified.

Parameters:
maxLength - the maximum length, null to throw an exception if the clob doesn't fit in a String.
Method Detail

convertNonNull

protected Clob convertNonNull(String o)

unconvertNonNull

protected String unconvertNonNull(Clob o)

convert

public final U convert(T o)
Specified by:
convert in interface ValueConvertor<T,U>

unconvert

public final T unconvert(U o)
Specified by:
unconvert in interface ValueConvertor<T,U>


Copyright © 2010 jOpenDocument All Rights Reserved.