uk.org.ogsadai.converters.csv.resultset.types
Class StringToAllStrategy

java.lang.Object
  extended byuk.org.ogsadai.converters.csv.resultset.types.TypeStrategy
      extended byuk.org.ogsadai.converters.csv.resultset.types.StringToAllStrategy

public class StringToAllStrategy
extends TypeStrategy

Converts a string into other types.

Author:
The OGSA-DAI Team.

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
 
Constructor Summary
StringToAllStrategy()
           
 
Method Summary
 java.io.InputStream getAsciiStream(java.lang.String data)
          Returns an input stream that reads characters from the input string.
 java.math.BigDecimal getBigDecimal(java.lang.String data)
          Returns the BigDecimal value of the input string.
 java.math.BigInteger getBigInteger(java.lang.String data)
           
 java.io.InputStream getBinaryStream(java.lang.String data)
          Returns an input stream that reads the input string as binary data.
 java.sql.Blob getBlob(java.lang.String data)
          Returns the input string as a Blob.
 boolean getBoolean(java.lang.String data)
          Returns the boolean value of the input string.
 byte[] getBytes(java.lang.String data)
          Returns the input string as a byte array.
 byte[] getBytes64(java.lang.String data)
          Returns the decoded byte array of the Base64 encoded input string.
 java.io.Reader getCharacterStream(java.lang.String data)
          Returns a Reader that reads from the input string.
 java.sql.Clob getClob(java.lang.String data)
          Returns the input string as a Clob.
 java.sql.Date getDate(java.lang.String data)
          Returns the input string as a Date object.
 double getDouble(java.lang.String data)
          Returns the double value of the input string.
 float getFloat(java.lang.String data)
          Returns the float value of the input string.
 int getInt(java.lang.String data)
          Returns the integer value of the input string.
 long getLong(java.lang.String data)
          Returns the long value of the input string.
 java.lang.Object getObject(java.lang.String data)
          Returns the input string as an object.
 short getShort(java.lang.String data)
          Returns the short value of the input string.
 java.lang.String getString(java.lang.String data)
          Returns the input string.
 java.sql.Time getTime(java.lang.String data)
          Returns the input string as a Time object.
 java.sql.Timestamp getTimestamp(java.lang.String data)
          Returns the input string as a Timestamp object.
 
Methods inherited from class uk.org.ogsadai.converters.csv.resultset.types.TypeStrategy
getArray, getBigDecimal, getByte, getDate, getRef, getTime, getTimestamp, getUnicodeStream, getURL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
Copyright statement

See Also:
Constant Field Values
Constructor Detail

StringToAllStrategy

public StringToAllStrategy()
Method Detail

getString

public java.lang.String getString(java.lang.String data)
Description copied from class: TypeStrategy
Returns the input string.

Overrides:
getString in class TypeStrategy
Parameters:
data - Input data.
Returns:
converted input.

getAsciiStream

public java.io.InputStream getAsciiStream(java.lang.String data)
Description copied from class: TypeStrategy
Returns an input stream that reads characters from the input string.

Overrides:
getAsciiStream in class TypeStrategy
Parameters:
data - Input data.
Returns:
an input stream.

getBigDecimal

public java.math.BigDecimal getBigDecimal(java.lang.String data)
                                   throws java.sql.SQLException
Description copied from class: TypeStrategy
Returns the BigDecimal value of the input string.

Overrides:
getBigDecimal in class TypeStrategy
Parameters:
data - Input data.
Returns:
converted input.
Throws:
java.sql.SQLException - if there was a problem with the conversion.

getBinaryStream

public java.io.InputStream getBinaryStream(java.lang.String data)
Description copied from class: TypeStrategy
Returns an input stream that reads the input string as binary data.

Overrides:
getBinaryStream in class TypeStrategy
Parameters:
data - Input data.
Returns:
an input stream.

getBigInteger

public java.math.BigInteger getBigInteger(java.lang.String data)
                                   throws java.sql.SQLException
Throws:
java.sql.SQLException

getBoolean

public boolean getBoolean(java.lang.String data)
                   throws java.sql.SQLException
Description copied from class: TypeStrategy
Returns the boolean value of the input string. This is true if the input is equal to "true" or "1" and false otherwise.

Overrides:
getBoolean in class TypeStrategy
Parameters:
data - Input data.
Returns:
converted input.
Throws:
java.sql.SQLException - if there was a problem with the conversion.

getBytes

public byte[] getBytes(java.lang.String data)
Description copied from class: TypeStrategy
Returns the input string as a byte array.

Overrides:
getBytes in class TypeStrategy
Parameters:
data - Input data.
Returns:
converted input.

getBytes64

public byte[] getBytes64(java.lang.String data)
Description copied from class: TypeStrategy
Returns the decoded byte array of the Base64 encoded input string.

Overrides:
getBytes64 in class TypeStrategy
Parameters:
data - Base64 encoded input data.
Returns:
decoded byte array of the input.

getCharacterStream

public java.io.Reader getCharacterStream(java.lang.String data)
                                  throws java.sql.SQLException
Description copied from class: TypeStrategy
Returns a Reader that reads from the input string.

Overrides:
getCharacterStream in class TypeStrategy
Parameters:
data - Input data.
Returns:
a Reader accessing the input value.
Throws:
java.sql.SQLException - if there was a problem with the conversion.

getDate

public java.sql.Date getDate(java.lang.String data)
                      throws java.sql.SQLException
Description copied from class: TypeStrategy
Returns the input string as a Date object.

Overrides:
getDate in class TypeStrategy
Parameters:
data - Input data.
Returns:
converted input.
Throws:
java.sql.SQLException - if there was a problem with the conversion.

getShort

public short getShort(java.lang.String data)
               throws java.sql.SQLException
Description copied from class: TypeStrategy
Returns the short value of the input string.

Overrides:
getShort in class TypeStrategy
Parameters:
data - Input data.
Returns:
converted input.
Throws:
java.sql.SQLException - if there was a problem with the conversion.

getInt

public int getInt(java.lang.String data)
           throws java.sql.SQLException
Description copied from class: TypeStrategy
Returns the integer value of the input string.

Overrides:
getInt in class TypeStrategy
Parameters:
data - Input data.
Returns:
converted input.
Throws:
java.sql.SQLException - if there was a problem with the conversion.

getLong

public long getLong(java.lang.String data)
             throws java.sql.SQLException
Description copied from class: TypeStrategy
Returns the long value of the input string.

Overrides:
getLong in class TypeStrategy
Parameters:
data - Input data.
Returns:
converted input.
Throws:
java.sql.SQLException - if there was a problem with the conversion.

getDouble

public double getDouble(java.lang.String data)
                 throws java.sql.SQLException
Description copied from class: TypeStrategy
Returns the double value of the input string.

Overrides:
getDouble in class TypeStrategy
Parameters:
data - Input data.
Returns:
converted input.
Throws:
java.sql.SQLException - if there was a problem with the conversion.

getFloat

public float getFloat(java.lang.String data)
               throws java.sql.SQLException
Description copied from class: TypeStrategy
Returns the float value of the input string.

Overrides:
getFloat in class TypeStrategy
Parameters:
data - Input data.
Returns:
converted input.
Throws:
java.sql.SQLException - if there was a problem with the conversion.

getTimestamp

public java.sql.Timestamp getTimestamp(java.lang.String data)
                                throws java.sql.SQLException
Description copied from class: TypeStrategy
Returns the input string as a Timestamp object.

Overrides:
getTimestamp in class TypeStrategy
Parameters:
data - Input data.
Returns:
converted input.
Throws:
java.sql.SQLException - if there was a problem with the conversion.

getTime

public java.sql.Time getTime(java.lang.String data)
                      throws java.sql.SQLException
Description copied from class: TypeStrategy
Returns the input string as a Time object.

Overrides:
getTime in class TypeStrategy
Parameters:
data - Input data.
Returns:
converted input.
Throws:
java.sql.SQLException - if there was a problem with the conversion.

getObject

public java.lang.Object getObject(java.lang.String data)
Description copied from class: TypeStrategy
Returns the input string as an object.

Overrides:
getObject in class TypeStrategy
Parameters:
data - Input data.
Returns:
converted input.

getBlob

public java.sql.Blob getBlob(java.lang.String data)
                      throws java.sql.SQLException
Description copied from class: TypeStrategy
Returns the input string as a Blob.

Overrides:
getBlob in class TypeStrategy
Parameters:
data - Input data.
Returns:
converted input.
Throws:
java.sql.SQLException - if there was a problem with the conversion.

getClob

public java.sql.Clob getClob(java.lang.String data)
                      throws java.sql.SQLException
Description copied from class: TypeStrategy
Returns the input string as a Clob.

Overrides:
getClob in class TypeStrategy
Parameters:
data - Input data.
Returns:
converted input.
Throws:
java.sql.SQLException - if there was a problem with the conversion.