org.enhydra.zeus.transform
Class TransformerOptions

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

public class TransformerOptions
extends java.lang.Object

TransformerOptions is used to specify options used in Transformer and related classes and processes. It specifies global options for transformation such as packages, collection types, and more.

Author:
Brett McLaughlin

Field Summary
protected  int defaultCollectionType
          The default collection class type
protected  java.lang.String defaultPackage
          The default package for all classes, unless overridden
protected  java.lang.String implementationPackage
          The default implementation package for this transformation
protected  java.lang.String interfacePackage
          The default interface package for this transformation
 
Constructor Summary
TransformerOptions()
           This default constructor sets up default variable values.
TransformerOptions(java.lang.String defaultPackage, int defaultCollectionType)
           This convenience constructor allows options to be set on construction.
TransformerOptions(java.lang.String interfacePackage, java.lang.String implementationPackage, int defaultCollectionType)
           This convenience constructor allows options to be set on construction.
 
Method Summary
 java.lang.String getDefaultCollectionType()
           This will return the default collection class name for this set of transformation options.
 java.lang.String getImplementationPackage()
           This returns the default package in which generated implementations are placed.
 java.lang.String getInterfacePackage()
           This returns the default package in which generated interfaces are placed.
 void setDefaultCollectionType(int defaultCollectionType)
           This allows setting of the default collection type for transformations, through constants defined in this class.
 void setDefaultCollectionType(java.lang.String defaultCollectionTypeString)
           This allows setting of the default collection type for transformations, through supplying a String class name, such as java.util.List.
 void setDefaultPackage(java.lang.String defaultPackage)
           This sets the default and global package for all generated classes, unless a specific package for interfaces and/or implementations is supplied, which then overrides this setting.
 void setImplementationPackage(java.lang.String implementationPackage)
           This sets the default and global interface package for generated classes.
 void setInterfacePackage(java.lang.String interfacePackage)
           This sets the default and global interface package for generated classes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultPackage

protected java.lang.String defaultPackage
The default package for all classes, unless overridden

interfacePackage

protected java.lang.String interfacePackage
The default interface package for this transformation

implementationPackage

protected java.lang.String implementationPackage
The default implementation package for this transformation

defaultCollectionType

protected int defaultCollectionType
The default collection class type
Constructor Detail

TransformerOptions

public TransformerOptions()

This default constructor sets up default variable values.


TransformerOptions

public TransformerOptions(java.lang.String defaultPackage,
                          int defaultCollectionType)

This convenience constructor allows options to be set on construction.

Parameters:
defaultPackage - the package for all generated classes.
defaultCollectionType - constant for the collection type to use.

TransformerOptions

public TransformerOptions(java.lang.String interfacePackage,
                          java.lang.String implementationPackage,
                          int defaultCollectionType)

This convenience constructor allows options to be set on construction.

Parameters:
interfacePackage - the package for all generated interfaces.
implementationPackage - the package for all generated implementation packages.
defaultCollectionType - constant for the collection type to use.
Method Detail

setDefaultPackage

public void setDefaultPackage(java.lang.String defaultPackage)

This sets the default and global package for all generated classes, unless a specific package for interfaces and/or implementations is supplied, which then overrides this setting. Those packages can be set using the setInterfacePackage(java.lang.String) and setImplementationPackage(java.lang.String) methods.

There is intentionally not a getDefaultPackage() method. Instead, getInterfacePackage() and getImplementationPackage() should be used, which return correct values based on the default and specific packages set for both options.

Parameters:
interfacePackage - the package for generated interfaces.

setInterfacePackage

public void setInterfacePackage(java.lang.String interfacePackage)

This sets the default and global interface package for generated classes.

Parameters:
interfacePackage - the package for generated interfaces.

getInterfacePackage

public java.lang.String getInterfacePackage()

This returns the default package in which generated interfaces are placed.

Returns:
String - the default interface package.

setImplementationPackage

public void setImplementationPackage(java.lang.String implementationPackage)

This sets the default and global interface package for generated classes.

Parameters:
interfacePackage - the package for generated interfaces.

getImplementationPackage

public java.lang.String getImplementationPackage()

This returns the default package in which generated implementations are placed.

Returns:
String - the default implementation package.

setDefaultCollectionType

public void setDefaultCollectionType(int defaultCollectionType)
                              throws InvalidCollectionTypeException

This allows setting of the default collection type for transformations, through constants defined in this class. If the supplied constant is an illegal type, an InvalidCollectionTypeException is thrown.

Parameters:
defaultCollectionType - the collection type to use in transformations, as an int constant.
Throws:
InvalidCollectionTypeException - - when an illegal collection type is supplied.
See Also:
{@link #COLLECTION_TYPE_LIST}, {@link #COLLECTION_TYPE_ARRAY}

setDefaultCollectionType

public void setDefaultCollectionType(java.lang.String defaultCollectionTypeString)
                              throws InvalidCollectionTypeException

This allows setting of the default collection type for transformations, through supplying a String class name, such as java.util.List. If the supplied type is an illegal type, an InvalidCollectionTypeException is thrown.

Parameters:
defaultCollectionTypeString - the String representation of the collection type to use.
Throws:
InvalidCollectionTypeException - - when an illegal collection type is supplied.

getDefaultCollectionType

public java.lang.String getDefaultCollectionType()

This will return the default collection class name for this set of transformation options. This will return a fully-qualified class name, such as java.util.List.

Returns:
String - the class name for the collection type.


Copyright © 2002 Enhydra. All Rights Reserved.