org.apache.ws.jaxme.generator.sg
Interface TypeSG

All Superinterfaces:
SGItem
All Known Implementing Classes:
TypeSGImpl

public interface TypeSG
extends SGItem

Interface of a source generator for types; applies both to simple and complex types.

Author:
Jochen Wiedmann

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.
 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.
 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.
 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 interface org.apache.ws.jaxme.generator.sg.SGItem
getFactory, getLocator, getSchema, init
 

Method Detail

setProperty

void setProperty(java.lang.String pName,
                 java.lang.Object pValue)

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.


getProperty

java.lang.Object getProperty(java.lang.String pName)

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.


isGlobalType

boolean isGlobalType()

Returns whether this is a global type.


isGlobalClass

boolean isGlobalClass()

Returns whether this type is generated with a global class.


getName

XsQName getName()

If the type is global: Returns the types name.

Throws:
java.lang.IllegalStateException - The type isn't global.

isComplex

boolean isComplex()

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


newSimpleTypeSG

java.lang.Object newSimpleTypeSG()
                                 throws org.xml.sax.SAXException

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.

Throws:
org.xml.sax.SAXException

newComplexTypeSG

java.lang.Object newComplexTypeSG()
                                  throws org.xml.sax.SAXException

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.

Throws:
org.xml.sax.SAXException

getComplexTypeSG

ComplexTypeSG getComplexTypeSG()

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


getSimpleTypeSG

SimpleTypeSG getSimpleTypeSG()

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

Throws:
java.lang.IllegalStateException - The type is complex.

getXMLField

JavaField getXMLField(JavaSource pSource,
                      java.lang.String pFieldName,
                      java.lang.String pDefaultValue)
                      throws org.xml.sax.SAXException

Generates a Java field for an instance of this type.

Throws:
org.xml.sax.SAXException

getXMLGetMethod

JavaMethod getXMLGetMethod(JavaSource pSource,
                           java.lang.String pFieldName,
                           java.lang.String pMethodName)
                           throws org.xml.sax.SAXException

Generates a get method returning an instance of this type.

Throws:
org.xml.sax.SAXException

getXMLSetMethod

JavaMethod getXMLSetMethod(JavaSource pSource,
                           java.lang.String pFieldName,
                           java.lang.String pParamName,
                           java.lang.String pMethodName,
                           boolean pSetIsSet)
                           throws org.xml.sax.SAXException

Generates a set method returning an instance of this type.

Throws:
org.xml.sax.SAXException

getXMLIsSetMethod

JavaMethod getXMLIsSetMethod(JavaSource pSource,
                             java.lang.String pFieldName,
                             java.lang.String pMethodName)
                             throws org.xml.sax.SAXException

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

Throws:
org.xml.sax.SAXException

getRuntimeType

JavaQName getRuntimeType()
                         throws org.xml.sax.SAXException

Returns the types runtime type.

Throws:
org.xml.sax.SAXException

generate

void generate()
              throws org.xml.sax.SAXException

Generates the types sources.

Throws:
org.xml.sax.SAXException

generate

void generate(JavaSource pSource)
              throws org.xml.sax.SAXException

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

Throws:
org.xml.sax.SAXException

isRestriction

boolean isRestriction()

Returns whether the type is a restriction of another type.


getRestrictedType

TypeSG getRestrictedType()

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

Throws:
java.lang.IllegalStateException - The type is no restriction.

isExtension

boolean isExtension()

Returns whether the type is an extension of another type.


getExtendedType

TypeSG getExtendedType()

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

Throws:
java.lang.IllegalStateException - The type is no extension.

getSchemaHeader

XsSchemaHeader getSchemaHeader()

Returns information on the types syntactical context.