org.exolab.castor.builder
Class SourceFactory

java.lang.Object
  extended byorg.exolab.castor.builder.SourceFactory

public class SourceFactory
extends java.lang.Object

This class creates the Java Source classes for Schema components

Version:
$Revision: 1.83 $ $Date: 2002/01/25 23:54:38 $
Author:
Keith Visco

Constructor Summary
SourceFactory()
          Creates a new SourceFactory using the default FieldInfo factory.
SourceFactory(FieldInfoFactory infoFactory)
          Creates a new SourceFactory with the given FieldInfoFactory
 
Method Summary
static void createEqualsMethod(JClass jclass)
          Create an 'equals' method on the given JClass
 JClass[] createSourceCode(ComplexType type, SGStateInfo sgState)
          Creates the necessary JClass and ClassInfo objects for the given ComplexType.
 JClass[] createSourceCode(ElementDecl element, SGStateInfo sgState)
          Creates a new ClassInfo for the given XML Schema element declaration
 JClass[] createSourceCode(Group group, SGStateInfo sgState)
          Creates a new ClassInfo for the given XML Schema type declaration.
 JClass createSourceCode(SimpleType simpleType, SGStateInfo sgState)
          Creates the Java source code to support the given Simpletype
static void createTestableMethods(JClass jclass)
          Implement org.exolab.castor.tests.framework.CastorTestable im the given JClass
 void setCreateMarshalMethods(boolean createMarshalMethods)
          Sets whether or not to create the XML marshalling framework specific methods (marshall, unmarshall, validate) in the generated classes.
 void setTestable(boolean testable)
          Sets whether or not to create the XML marshalling framework specific methods (marshall, unmarshall, validate) in the generated classes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceFactory

public SourceFactory()
Creates a new SourceFactory using the default FieldInfo factory.


SourceFactory

public SourceFactory(FieldInfoFactory infoFactory)
Creates a new SourceFactory with the given FieldInfoFactory

Parameters:
infoFactory - the FieldInfoFactory to use
Method Detail

setCreateMarshalMethods

public void setCreateMarshalMethods(boolean createMarshalMethods)
Sets whether or not to create the XML marshalling framework specific methods (marshall, unmarshall, validate) in the generated classes. By default, these methods are generated.

Parameters:
createMarshalMethods - a boolean, when true indicates to generated the marshalling framework methods

setTestable

public void setTestable(boolean testable)
Sets whether or not to create the XML marshalling framework specific methods (marshall, unmarshall, validate) in the generated classes. By default, these methods are generated.


createSourceCode

public JClass[] createSourceCode(ElementDecl element,
                                 SGStateInfo sgState)
Creates a new ClassInfo for the given XML Schema element declaration

Parameters:
element - the XML Schema element declaration to create the ClassInfo for

createSourceCode

public JClass[] createSourceCode(ComplexType type,
                                 SGStateInfo sgState)
Creates the necessary JClass and ClassInfo objects for the given ComplexType. The complex type declaration must be a top-level declaration.

Parameters:
type - the XML Schema type declaration to create the JClass and ClassInfo objects for
Returns:
the array of JClass objects created for the ComplexType

createSourceCode

public JClass createSourceCode(SimpleType simpleType,
                               SGStateInfo sgState)
Creates the Java source code to support the given Simpletype

Parameters:
sgState - the current SGStateInfo (cannot be null).
Returns:
the JClass representation of the given Simpletype

createSourceCode

public JClass[] createSourceCode(Group group,
                                 SGStateInfo sgState)
Creates a new ClassInfo for the given XML Schema type declaration. The type declaration must be a top-level declaration.


createEqualsMethod

public static void createEqualsMethod(JClass jclass)
Create an 'equals' method on the given JClass

Parameters:
jclass - the Jclass in which we create the equals method

createTestableMethods

public static void createTestableMethods(JClass jclass)
Implement org.exolab.castor.tests.framework.CastorTestable im the given JClass

Parameters:
jclass - the JCLass which will implement the CastorTestable Interface
See Also:
org.exolab.castor.tests.framework.CastorTestable


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