Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.cantaloop.tools.conversion
Class IntegerLiteralConverter  view IntegerLiteralConverter download IntegerLiteralConverter.java

java.lang.Object
  extended byorg.cantaloop.tools.conversion.AbstractConverter
      extended byorg.cantaloop.tools.conversion.IntegerLiteralConverter
All Implemented Interfaces:
Converter

public class IntegerLiteralConverter
extends AbstractConverter

Converts a Integer to its literal representation.
Example:
Let i be an java.lang.Integer with value 5. The following string is returned: new Integer(5).

Version:
@version@ ($Revision: 1.2 $)

Field Summary
 
Fields inherited from class org.cantaloop.tools.conversion.AbstractConverter
m_inputTypes, m_outputTypes
 
Constructor Summary
IntegerLiteralConverter()
          Creates a new IntegerLiteralConverter instance.
input types: Integer
output types: String
 
Method Summary
 java.lang.Object convert(java.lang.Object obj, java.lang.Class type)
          Converts the input object to the desired output type as long as the input object is an instance of one of the classes in the getInputtypes and the output type or a subtype is contained in getOutputTypes.
If the desired output type is a supertype of more than one of the output types, one of these subtype will be chosen (the choice may be random).
 
Methods inherited from class org.cantaloop.tools.conversion.AbstractConverter
checkTypes, getInputTypes, getOutputTypes, throwException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntegerLiteralConverter

public IntegerLiteralConverter()
Creates a new IntegerLiteralConverter instance.
input types: Integer
output types: String

Method Detail

convert

public java.lang.Object convert(java.lang.Object obj,
                                java.lang.Class type)
                         throws ConversionException
Description copied from interface: Converter
Converts the input object to the desired output type as long as the input object is an instance of one of the classes in the getInputtypes and the output type or a subtype is contained in getOutputTypes.
If the desired output type is a supertype of more than one of the output types, one of these subtype will be chosen (the choice may be random).