org.enhydra.zeus.transform
Class TypeConversion

java.lang.Object
  |
  +--org.enhydra.zeus.transform.TypeConversion

public class TypeConversion
extends java.lang.Object

TypeConversion is used to specify type conversions used in Transformer and related classes and processes. It allows character-based data, as found in XML documents, to be converted to type-specific data in Java.

Author:
Brett McLaughlin

Constructor Summary
TypeConversion(java.lang.String name, java.lang.String type)
           This creates a new Conversion with the supplied name and type.
TypeConversion(java.lang.String name, java.lang.String type, java.lang.String parseMethod, java.lang.String printMethod)
           This creates a new Conversion with the supplied name and type.
 
Method Summary
 java.lang.String getName()
           This will return the current name of this TypeConversion.
 java.lang.String getParseMethod()
           This returns the name of the method to use for conversion from a character-based piece of XML data into the Java type for this TypeConversion.
 java.lang.String getPrintMethod()
           This returns the name of the method to use for printing data in the format in this TypeConversion.
 java.lang.String getType()
           This returns the Java type for this Conversion.
 void setName(java.lang.String name)
           This will set the name of this TypeConversion.
 void setParseMethod(java.lang.String parseMethod)
           This sets the name of the method to use for conversion from a character-based piece of XML data into the Java type for this TypeConversion.
 void setPrintMethod(java.lang.String printMethod)
           This sets the name of the method to use for printing data in the format in this TypeConversion.
 void setType(java.lang.String type)
           This will set the Java type for data using this Conversion.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeConversion

public TypeConversion(java.lang.String name,
                      java.lang.String type)

This creates a new Conversion with the supplied name and type. In most cases, the type specified here should be a fully-qualified Java class name, such as "java.util.Date" or "java.math.BigDecimal". If the class is in an automatically imported class, like "java.lang.Integer", then the package does not need to be supplied.

Parameters:
name - the name for this type conversion.
type - the Java type for this type conversion.

TypeConversion

public TypeConversion(java.lang.String name,
                      java.lang.String type,
                      java.lang.String parseMethod,
                      java.lang.String printMethod)

This creates a new Conversion with the supplied name and type. In most cases, the type specified here should be a fully-qualified Java class name, such as "java.util.Date" or "java.math.BigDecimal". If the class is in an automatically imported class, like "java.lang.Integer", then the package does not need to be supplied. It also allows specification of the method to use for conversion of data from XML to Java, and for printing Java in the format this TypeConversion represents.

Parameters:
name - the name for this type conversion.
type - the Java type for this type conversion.
parseMethod - the method to use for parsing data.
printMethof - the method to use for printing data.
Method Detail

setName

public void setName(java.lang.String name)

This will set the name of this TypeConversion.

Parameters:
name - the name for this type conversion

getName

public java.lang.String getName()

This will return the current name of this TypeConversion.

Returns:
String - the name of this type conversion.

setType

public void setType(java.lang.String type)

This will set the Java type for data using this Conversion. In most cases, the type specified here should be a fully-qualified Java class name, such as "java.util.Date" or "java.math.BigDecimal". If the class is in an automatically imported class, like "java.lang.Integer", then the package does not need to be supplied.

Parameters:
type - the Java type for this conversion.

getType

public java.lang.String getType()

This returns the Java type for this Conversion. This is generally a fully-qualified Java class, such as "java.util.Date" or "java.math.BigDecimal".

Returns:
String - Java type for this conversion.

setParseMethod

public void setParseMethod(java.lang.String parseMethod)

This sets the name of the method to use for conversion from a character-based piece of XML data into the Java type for this TypeConversion.

Parameters:
parseMethod - the name of the method to use for parsing data

getParseMethod

public java.lang.String getParseMethod()

This returns the name of the method to use for conversion from a character-based piece of XML data into the Java type for this TypeConversion.

Returns:
String - the name of the method to use for parsing.

setPrintMethod

public void setPrintMethod(java.lang.String printMethod)

This sets the name of the method to use for printing data in the format in this TypeConversion.

Parameters:
printMethod - the name of the method to use for printing data

getPrintMethod

public java.lang.String getPrintMethod()

This returns the name of the method to use for printing data in the format in this TypeConversion.

Returns:
String - the name of the method to use for printing.


Copyright © 2002 Enhydra. All Rights Reserved.