org.apache.ws.jaxme.generator.sg

Interface TypeSG

public interface TypeSG extends SGItem

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

Author: Jochen Wiedmann

Method Summary
voidgenerate()

Generates the types sources.

voidgenerate(JavaSource pSource)

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

ComplexTypeSGgetComplexTypeSG()

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

TypeSGgetExtendedType()

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

XsQNamegetName()

If the type is global: Returns the types name.

ObjectgetProperty(String pName)

A property allows to store custom data related to the type.

TypeSGgetRestrictedType()

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

JavaQNamegetRuntimeType()

Returns the types runtime type.

XsSchemaHeadergetSchemaHeader()

Returns information on the types syntactical context.

SimpleTypeSGgetSimpleTypeSG()

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

JavaFieldgetXMLField(JavaSource pSource, String pFieldName, String pDefaultValue)

Generates a Java field for an instance of this type.

JavaMethodgetXMLGetMethod(JavaSource pSource, String pFieldName, String pMethodName)

Generates a get method returning an instance of this type.

JavaMethodgetXMLIsSetMethod(JavaSource pSource, String pFieldName, String pMethodName)

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

JavaMethodgetXMLSetMethod(JavaSource pSource, String pFieldName, String pParamName, String pMethodName, boolean pSetIsSet)

Generates a set method returning an instance of this type.

booleanisComplex()

Returns whether the type is complex.

booleanisExtension()

Returns whether the type is an extension of another type.

booleanisGlobalClass()

Returns whether this type is generated with a global class.

booleanisGlobalType()

Returns whether this is a global type.

booleanisRestriction()

Returns whether the type is a restriction of another type.

ObjectnewComplexTypeSG()

If the type is complex: Creates an instance of org.apache.ws.jaxme.generator.sg.ComplexTypeSGChain generating the type.

Implementation note: The type org.apache.ws.jaxme.generator.sg.ComplexTypeSGChain must not be exposed in the interface, because the interface class is used to generate this type.

ObjectnewSimpleTypeSG()

If the type is simple: Creates a new instance of org.apache.ws.jaxme.generator.sg.SimpleTypeSGChain generating the type.

Implementation note: The type org.apache.ws.jaxme.generator.sg.SimpleTypeSGChain must not be exposed in the interface, because the interface class is used to generate this type.

voidsetProperty(String pName, Object pValue)

A property allows to store custom data related to the type.

Method Detail

generate

public void generate()

Generates the types sources.

generate

public void generate(JavaSource pSource)

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

getComplexTypeSG

public ComplexTypeSG getComplexTypeSG()

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

getExtendedType

public TypeSG getExtendedType()

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

Throws: IllegalStateException The type is no extension.

getName

public XsQName getName()

If the type is global: Returns the types name.

Throws: IllegalStateException The type isn't global.

getProperty

public Object getProperty(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.

getRestrictedType

public TypeSG getRestrictedType()

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

Throws: IllegalStateException The type is no restriction.

getRuntimeType

public JavaQName getRuntimeType()

Returns the types runtime type.

getSchemaHeader

public XsSchemaHeader getSchemaHeader()

Returns information on the types syntactical context.

getSimpleTypeSG

public SimpleTypeSG getSimpleTypeSG()

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

Throws: IllegalStateException The type is complex.

getXMLField

public JavaField getXMLField(JavaSource pSource, String pFieldName, String pDefaultValue)

Generates a Java field for an instance of this type.

getXMLGetMethod

public JavaMethod getXMLGetMethod(JavaSource pSource, String pFieldName, String pMethodName)

Generates a get method returning an instance of this type.

getXMLIsSetMethod

public JavaMethod getXMLIsSetMethod(JavaSource pSource, String pFieldName, String pMethodName)

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

getXMLSetMethod

public JavaMethod getXMLSetMethod(JavaSource pSource, String pFieldName, String pParamName, String pMethodName, boolean pSetIsSet)

Generates a set method returning an instance of this type.

isComplex

public boolean isComplex()

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

isExtension

public boolean isExtension()

Returns whether the type is an extension of another type.

isGlobalClass

public boolean isGlobalClass()

Returns whether this type is generated with a global class.

isGlobalType

public boolean isGlobalType()

Returns whether this is a global type.

isRestriction

public boolean isRestriction()

Returns whether the type is a restriction of another type.

newComplexTypeSG

public Object newComplexTypeSG()

If the type is complex: Creates an instance of org.apache.ws.jaxme.generator.sg.ComplexTypeSGChain generating the type.

Implementation note: The type org.apache.ws.jaxme.generator.sg.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 org.apache.ws.jaxme.generator.sg.ComplexTypeSGChain interface.

newSimpleTypeSG

public Object newSimpleTypeSG()

If the type is simple: Creates a new instance of org.apache.ws.jaxme.generator.sg.SimpleTypeSGChain generating the type.

Implementation note: The type org.apache.ws.jaxme.generator.sg.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 org.apache.ws.jaxme.generator.sg.SimpleTypeSGChain interface.

setProperty

public void setProperty(String pName, 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.