Package org.exolab.castor.tools
Class MappingTool
java.lang.Object
org.exolab.castor.tools.MappingTool
A tool which uses the introspector to automatically create mappings for a given set of classes.
- Version:
- $Revision$ $Date: 2006-01-30 14:37:08 -0700 (Mon, 30 Jan 2006) $
- Author:
- Assaf Arkin, Keith Visco
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the given Class to the mapping file.void
Adds the given Class to the mapping file.void
Adds the Class, specified by the given name, to the mapping file.void
Adds the Class, specified by the given name, to the mapping file.static void
Command line method.void
setForceIntrospection
(boolean force) Enables or disables the forcing of introspection when a ClassDescriptor already exists.void
setInternalContext
(InternalContext internalContext) To set the XMLContext to be used.void
Serializes the mapping to the given writer.
-
Constructor Details
-
MappingTool
public MappingTool()Constructor, builds up the relations.
-
-
Method Details
-
main
Command line method.- Parameters:
args
- the command line parameters
-
addClass
Adds the Class, specified by the given name, to the mapping file.- Parameters:
name
- the name of the Class to add- Throws:
MappingException
- in case that the name is null or the Class can not be loaded
-
addClass
Adds the Class, specified by the given name, to the mapping file.- Parameters:
name
- the name of the Class to adddeep
- 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
- in case that the name is null or the Class can not be loaded
-
addClass
Adds the given Class to the mapping file.- Parameters:
cls
- the Class to add- Throws:
MappingException
- in case that the name is null or the Class can not be loaded
-
addClass
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 adddeep
- 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
- in case that the name is null or the Class can not be loaded
-
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
Serializes the mapping to the given writer.- Parameters:
writer
- the Writer to serialize the mapping to- Throws:
MappingException
- if writing the mapping information fails
-
setInternalContext
To set the XMLContext to be used.- Parameters:
internalContext
- the XMLContext to be used
-