All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class org.xmlmiddleware.conversions.formatters.CharFormatter

java.lang.Object
   |
   +----org.xmlmiddleware.conversions.formatters.CharFormatter

public class CharFormatter
extends Object
implements StringFormatter
Implements the StringFormatter interface for Strings.

Note that this implementation is trivial -- it simply returns the String that is passed to parse() or format(). It exists only for completeness. That is, XML-DBMS needs a default StringFormatter for each JDBC type and this is the implementation for CHAR, VARCHAR, and LONGVARCHAR.

Version:
2.0
Author:
Ronald Bourret, 2001

Constructor Index

 o CharFormatter()
Construct a new CharFormatter object.

Method Index

 o canConvert(int)
Whether the class can convert to/from a certain type of object.
 o format(Object)
"Format" a string and return (the same) string.
 o parse(String, int)
"Parse" a string and return (the same) string.

Constructors

 o CharFormatter
 public CharFormatter()
Construct a new CharFormatter object.

Methods

 o parse
 public Object parse(String s,
                     int jdbcType) throws XMLMiddlewareException
"Parse" a string and return (the same) string.

Parameters:
The - string to "parse".
A - JDBC Types value indicating the type of object to return.
Returns:
A String
Throws: XMLMiddlewareException
Thrown if jdbcType is not CHAR, VARCHAR, or LONGVARCHAR.
 o format
 public String format(Object o) throws XMLMiddlewareException
"Format" a string and return (the same) string.

Parameters:
The - string to "format"
Returns:
The string
Throws: XMLMiddlewareException
Thrown if the object is not a String.
 o canConvert
 public boolean canConvert(int type)
Whether the class can convert to/from a certain type of object.

This method returns true for Types.CHAR, VARCHAR, and LONGVARCHAR. It returns false for all other types.

Parameters:
type - The JDBC Types value corresponding to the object type.
Returns:
Whether the type is supported

All Packages  Class Hierarchy  This Package  Previous  Next  Index