org.apache.ws.jaxme.generator.sg.impl
Class TypeSGImpl

java.lang.Object
  extended by org.apache.ws.jaxme.generator.sg.impl.TypeSGImpl
All Implemented Interfaces:
SGItem, TypeSG

public class TypeSGImpl
extends java.lang.Object
implements TypeSG, SGItem


Constructor Summary
TypeSGImpl(TypeSGChain o)
           
 
Method Summary
 void generate()
          Generates the types sources.
 void generate(JavaSource pSource)
          Generates the types sources as an inner class of the given.
 ComplexTypeSG getComplexTypeSG()
          If the type is complex: Returns an instance of ComplexTypeSG generating the type.
 TypeSG getExtendedType()
          If the type is an extension: Returns the extended type.
 SGFactory getFactory()
          Returns the factory that created this item.
 TypeSGChain getHeadOfChain()
           
 org.xml.sax.Locator getLocator()
          Returns the items location in the schema; useful for error messages.
 XsQName getName()
          If the type is global: Returns the types name.
 java.lang.Object getProperty(java.lang.String pName)
          A property allows to store custom data related to the type.
 TypeSG getRestrictedType()
          If the type is a restriction: Returns the restricted type.
 JavaQName getRuntimeType()
          Returns the types runtime type.
 SchemaSG getSchema()
          Returns the items schema.
 XsSchemaHeader getSchemaHeader()
          Returns information on the types syntactical context.
 SimpleTypeSG getSimpleTypeSG()
          If the type is simple: Returns an instance of SimpleTypeSG for generating the type.
 JavaField getXMLField(JavaSource pSource, java.lang.String pFieldName, java.lang.String pDefaultValue)
          Generates a Java field for an instance of this type.
 JavaMethod getXMLGetMethod(JavaSource pSource, java.lang.String pFieldName, java.lang.String pMethodName)
          Generates a get method returning an instance of this type.
 JavaMethod getXMLIsSetMethod(JavaSource pSource, java.lang.String pFieldName, java.lang.String pMethodName)
          Generates an "isSet" method returning whether the field is set.
 JavaMethod getXMLSetMethod(JavaSource pSource, java.lang.String pFieldName, java.lang.String pParamName, java.lang.String pMethodName, boolean pSetIsSet)
          Generates a set method returning an instance of this type.
 void init()
          Initializes the item.
 boolean isComplex()
          Returns whether the type is complex.
 boolean isExtension()
          Returns whether the type is an extension of another type.
 boolean isGlobalClass()
          Returns whether this type is generated with a global class.
 boolean isGlobalType()
          Returns whether this is a global type.
 boolean isRestriction()
          Returns whether the type is a restriction of another type.
 java.lang.Object newComplexTypeSG()
          If the type is complex: Creates an instance of ComplexTypeSGChain generating the type.
 java.lang.Object newSimpleTypeSG()
          If the type is simple: Creates a new instance of SimpleTypeSGChain generating the type.
 void setProperty(java.lang.String pName, java.lang.Object pValue)
          A property allows to store custom data related to the type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeSGImpl

public TypeSGImpl(TypeSGChain o)
Method Detail

setProperty

public void setProperty(java.lang.String pName,
                        java.lang.Object pValue)
Description copied from interface: TypeSG

A property allows to store custom data related to the type. Properties are used by external source generators. For example, the JDBC source generator will use this to store the complex types table name here.

Specified by:
setProperty in interface TypeSG

getProperty

public java.lang.Object getProperty(java.lang.String pName)
Description copied from interface: TypeSG

A property allows to store custom data related to the type. Properties are used by external source generators. For example, the JDBC source generator will use this to store the complex types table name here.

Specified by:
getProperty in interface TypeSG

isGlobalType

public boolean isGlobalType()
Description copied from interface: TypeSG

Returns whether this is a global type.

Specified by:
isGlobalType in interface TypeSG

isGlobalClass

public boolean isGlobalClass()
Description copied from interface: TypeSG

Returns whether this type is generated with a global class.

Specified by:
isGlobalClass in interface TypeSG

getName

public XsQName getName()
Description copied from interface: TypeSG

If the type is global: Returns the types name.

Specified by:
getName in interface TypeSG

isComplex

public boolean isComplex()
Description copied from interface: TypeSG

Returns whether the type is complex. If so, it is valid to invoke the method TypeSG.getComplexTypeSG(). Otherwise, you may invoke the method TypeSG.getSimpleTypeSG().

Specified by:
isComplex in interface TypeSG

newSimpleTypeSG

public java.lang.Object newSimpleTypeSG()
                                 throws org.xml.sax.SAXException
Description copied from interface: TypeSG

If the type is simple: Creates a new instance of SimpleTypeSGChain generating the type.

Implementation note: The type SimpleTypeSGChain must not be exposed in the interface, because the interface class is used to generate this type. In other words, this interface must be compilable without the SimpleTypeSGChain interface.

Specified by:
newSimpleTypeSG in interface TypeSG
Throws:
org.xml.sax.SAXException

newComplexTypeSG

public java.lang.Object newComplexTypeSG()
                                  throws org.xml.sax.SAXException
Description copied from interface: TypeSG

If the type is complex: Creates an instance of ComplexTypeSGChain generating the type.

Implementation note: The type ComplexTypeSGChain must not be exposed in the interface, because the interface class is used to generate this type. In other words, this interface must be compilable without the ComplexTypeSGChain interface.

Specified by:
newComplexTypeSG in interface TypeSG
Throws:
org.xml.sax.SAXException

getComplexTypeSG

public ComplexTypeSG getComplexTypeSG()
Description copied from interface: TypeSG

If the type is complex: Returns an instance of ComplexTypeSG generating the type.

Specified by:
getComplexTypeSG in interface TypeSG

getSimpleTypeSG

public SimpleTypeSG getSimpleTypeSG()
Description copied from interface: TypeSG

If the type is simple: Returns an instance of SimpleTypeSG for generating the type.

Specified by:
getSimpleTypeSG in interface TypeSG

getXMLField

public JavaField getXMLField(JavaSource pSource,
                             java.lang.String pFieldName,
                             java.lang.String pDefaultValue)
                      throws org.xml.sax.SAXException
Description copied from interface: TypeSG

Generates a Java field for an instance of this type.

Specified by:
getXMLField in interface TypeSG
Throws:
org.xml.sax.SAXException

getXMLGetMethod

public JavaMethod getXMLGetMethod(JavaSource pSource,
                                  java.lang.String pFieldName,
                                  java.lang.String pMethodName)
                           throws org.xml.sax.SAXException
Description copied from interface: TypeSG

Generates a get method returning an instance of this type.

Specified by:
getXMLGetMethod in interface TypeSG
Throws:
org.xml.sax.SAXException

getXMLSetMethod

public JavaMethod getXMLSetMethod(JavaSource pSource,
                                  java.lang.String pFieldName,
                                  java.lang.String pParamName,
                                  java.lang.String pMethodName,
                                  boolean pSetIsSet)
                           throws org.xml.sax.SAXException
Description copied from interface: TypeSG

Generates a set method returning an instance of this type.

Specified by:
getXMLSetMethod in interface TypeSG
Throws:
org.xml.sax.SAXException

getXMLIsSetMethod

public JavaMethod getXMLIsSetMethod(JavaSource pSource,
                                    java.lang.String pFieldName,
                                    java.lang.String pMethodName)
                             throws org.xml.sax.SAXException
Description copied from interface: TypeSG

Generates an "isSet" method returning whether the field is set.

Specified by:
getXMLIsSetMethod in interface TypeSG
Throws:
org.xml.sax.SAXException

getRuntimeType

public JavaQName getRuntimeType()
                         throws org.xml.sax.SAXException
Description copied from interface: TypeSG

Returns the types runtime type.

Specified by:
getRuntimeType in interface TypeSG
Throws:
org.xml.sax.SAXException

generate

public void generate()
              throws org.xml.sax.SAXException
Description copied from interface: TypeSG

Generates the types sources.

Specified by:
generate in interface TypeSG
Throws:
org.xml.sax.SAXException

generate

public void generate(JavaSource pSource)
              throws org.xml.sax.SAXException
Description copied from interface: TypeSG

Generates the types sources as an inner class of the given.

Specified by:
generate in interface TypeSG
Throws:
org.xml.sax.SAXException

isRestriction

public boolean isRestriction()
Description copied from interface: TypeSG

Returns whether the type is a restriction of another type.

Specified by:
isRestriction in interface TypeSG

getRestrictedType

public TypeSG getRestrictedType()
Description copied from interface: TypeSG

If the type is a restriction: Returns the restricted type.

Specified by:
getRestrictedType in interface TypeSG

isExtension

public boolean isExtension()
Description copied from interface: TypeSG

Returns whether the type is an extension of another type.

Specified by:
isExtension in interface TypeSG

getExtendedType

public TypeSG getExtendedType()
Description copied from interface: TypeSG

If the type is an extension: Returns the extended type.

Specified by:
getExtendedType in interface TypeSG

getSchemaHeader

public XsSchemaHeader getSchemaHeader()
Description copied from interface: TypeSG

Returns information on the types syntactical context.

Specified by:
getSchemaHeader in interface TypeSG

getFactory

public SGFactory getFactory()
Description copied from interface: SGItem

Returns the factory that created this item.

Specified by:
getFactory in interface SGItem

getSchema

public SchemaSG getSchema()
Description copied from interface: SGItem

Returns the items schema.

Specified by:
getSchema in interface SGItem

getLocator

public org.xml.sax.Locator getLocator()
Description copied from interface: SGItem

Returns the items location in the schema; useful for error messages.

Specified by:
getLocator in interface SGItem

init

public void init()
          throws org.xml.sax.SAXException
Description copied from interface: SGItem

Initializes the item.

Specified by:
init in interface SGItem
Throws:
org.xml.sax.SAXException

getHeadOfChain

public TypeSGChain getHeadOfChain()