org.exolab.castor.tools
Class MappingTool
java.lang.Object
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.
$Revision: 7273 $ $Date: 2006-01-30 14:37:08 -0700 (Mon, 30 Jan 2006) $
void | addClass(Class cls) - Adds the given Class to the mapping file.
|
void | addClass(Class cls, boolean deep) - Adds the given Class to the mapping file.
|
void | addClass(String name) - Adds the Class, specified by the given name, to the mapping file.
|
void | addClass(String name, boolean deep) - Adds the Class, specified by the given name, to the mapping file.
|
static void | main(String[] args) - 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 | write(Writer writer) - Serializes the mapping to the given writer.
|
MappingTool
public MappingTool()
Constructor, builds up the relations.
addClass
public void addClass(Class cls)
throws MappingException
Adds the given Class to the mapping file.
addClass
public void addClass(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.
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.
addClass
public void addClass(String name)
throws MappingException
Adds the Class, specified by the given name, to the mapping file.
name
- the name of the Class to add
addClass
public void addClass(String name,
boolean deep)
throws MappingException
Adds the Class, specified by the given name, to the mapping file.
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.
main
public static void main(String[] args)
Command line method.
args
- the command line parameters
setForceIntrospection
public void setForceIntrospection(boolean force)
Enables or disables the forcing of introspection when a ClassDescriptor
already exists. This is false by default.
force
- when true will cause the MappingTool to always use
introspection regardless of whether or not a ClassDescriptor
exists for a given Class.
setInternalContext
public void setInternalContext(InternalContext internalContext)
To set the XMLContext to be used.
internalContext
- the XMLContext to be used
write
public void write(Writer writer)
throws MappingException
Serializes the mapping to the given writer.
writer
- the Writer to serialize the mapping to
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com