org.exolab.castor.tools
Class MappingTool

java.lang.Object
  extended by org.exolab.castor.tools.MappingTool

public class MappingTool
extends java.lang.Object

A tool which uses the introspector to automatically create mappings for a given set of classes.

Version:
$Revision: 1.4 $ $Date: 2005/03/01 00:54:25 $
Author:
Assaf Arkin, Keith Visco

Nested Class Summary
(package private)  class MappingTool.InternalLoader
           
 
Constructor Summary
MappingTool()
           
 
Method Summary
 void addClass(java.lang.Class cls)
          Adds the given Class to the mapping file
 void addClass(java.lang.Class cls, boolean deep)
          Adds the given Class to the mapping file.
 void addClass(java.lang.String name)
          Adds the Class, specified by the given name, to the mapping file
 void addClass(java.lang.String name, boolean deep)
          Adds the Class, specified by the given name, to the mapping file
static void main(java.lang.String[] args)
          Command line method
 void setForceIntrospection(boolean force)
          Enables or disables the forcing of introspection when a ClassDescriptor already exists.
 void write(java.io.Writer writer)
          Serializes the mapping to the given writer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MappingTool

public MappingTool()
Method Detail

main

public static void main(java.lang.String[] args)
Command line method


addClass

public void addClass(java.lang.String name)
              throws MappingException
Adds the Class, specified by the given name, to the mapping file

Parameters:
name - the name of the Class to add
Throws:
MappingException

addClass

public void addClass(java.lang.String name,
                     boolean deep)
              throws MappingException
Adds the Class, specified by the given name, to the mapping file

Parameters:
name - the name of the Class to add
deep, - a flag to indicate that recursive processing should take place and all classes used by the given class should also be added to the mapping file. This flag is true by default.
Throws:
MappingException

addClass

public void addClass(java.lang.Class cls)
              throws MappingException
Adds the given Class to the mapping file

Parameters:
cls - the Class to add
Throws:
MappingException

addClass

public void addClass(java.lang.Class cls,
                     boolean deep)
              throws MappingException
Adds the given Class to the mapping file. If the deep flag is true, all mappings for Classes used by the given Class will also be added to the mapping file.

Parameters:
cls - the Class to add
deep, - a flag to indicate that recursive processing should take place and all classes used by the given class should also be added to the mapping file. This flag is true by default.
Throws:
MappingException

setForceIntrospection

public void setForceIntrospection(boolean force)
Enables or disables the forcing of introspection when a ClassDescriptor already exists. This is false by default.

Parameters:
force - when true will cause the MappingTool to always use introspection regardless of whether or not a ClassDescriptor exists for a given Class.

write

public void write(java.io.Writer writer)
           throws MappingException
Serializes the mapping to the given writer

Parameters:
writer, - the Writer to serialize the mapping to
Throws:
MappingException


Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com