com.ricebridge.data.sc
Class StringConverterSupport

java.lang.Object
  extended bycom.ricebridge.data.sc.StringConverterSupport
All Implemented Interfaces:
StringConverter
Direct Known Subclasses:
DefaultStringConverter, TypeStringConverter

public abstract class StringConverterSupport
extends Object
implements StringConverter

Support class for the StringConverter interface.

Concrete implementations should extend this class, so that future interface compatibility can be protected.

For normal use, extend the DefaultStringConverter subclass of this class, as it provides error handling support.

The Source Code of this Java class is available under a BSD-style license.

See Also:
StringConverter, DefaultStringConverter

Constructor Summary
StringConverterSupport()
           
 
Method Summary
 Object makeDefaultObject()
          Helper implementation of StringConverter.makeDefaultObject().
protected abstract  Object makeDefaultObjectImpl()
          Implement this method to create a default object.
 String makeDefaultString()
          Helper implementation of StringConverter.makeDefaultString().
protected abstract  String makeDefaultStringImpl()
          Implement this method to create a default String.
 Object makeObject(String pValue, boolean pUseDefault)
          Helper implementation of StringConverter.makeObject.
protected abstract  Object makeObjectImpl(String pValue, boolean pUseDefault)
          Implement this method to create a new object from a String.
 String makeString(Object pValue, boolean pUseDefault)
          Helper implementation of StringConverter.makeString.
protected abstract  String makeStringImpl(Object pValue, boolean pUseDefault)
          Implement this method to create a new String from a object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringConverterSupport

public StringConverterSupport()
Method Detail

makeObject

public Object makeObject(String pValue,
                         boolean pUseDefault)
Helper implementation of StringConverter.makeObject. Subclasses should implement makeObjectImpl.

Specified by:
makeObject in interface StringConverter
Parameters:
pValue - textual representation of the object
pUseDefault - use the default value in case of error

makeDefaultObject

public Object makeDefaultObject()
Helper implementation of StringConverter.makeDefaultObject(). Subclasses should implement makeDefaultObjectImpl().

Specified by:
makeDefaultObject in interface StringConverter

makeString

public String makeString(Object pValue,
                         boolean pUseDefault)
Helper implementation of StringConverter.makeString. Subclasses should implement makeStringImpl.

Specified by:
makeString in interface StringConverter
Parameters:
pValue - object to convert
pUseDefault - use the default value in case of error

makeDefaultString

public String makeDefaultString()
Helper implementation of StringConverter.makeDefaultString(). Subclasses should implement makeDefaultStringImpl().

Specified by:
makeDefaultString in interface StringConverter

makeObjectImpl

protected abstract Object makeObjectImpl(String pValue,
                                         boolean pUseDefault)
                                  throws Exception
Implement this method to create a new object from a String.

Throws:
Exception
See Also:
makeObject(java.lang.String, boolean), StringConverter.makeObject(java.lang.String, boolean)

makeDefaultObjectImpl

protected abstract Object makeDefaultObjectImpl()
                                         throws Exception
Implement this method to create a default object.

Throws:
Exception
See Also:
makeDefaultObject(), StringConverter.makeDefaultObject()

makeStringImpl

protected abstract String makeStringImpl(Object pValue,
                                         boolean pUseDefault)
                                  throws Exception
Implement this method to create a new String from a object.

Throws:
Exception
See Also:
makeString(java.lang.Object, boolean), StringConverter.makeString(java.lang.Object, boolean)

makeDefaultStringImpl

protected abstract String makeDefaultStringImpl()
                                         throws Exception
Implement this method to create a default String.

Throws:
Exception
See Also:
makeDefaultString(), StringConverter.makeDefaultString()


Copyright © 2004-2005 Ricebridge