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

All Superinterfaces:
SGItem
All Known Implementing Classes:
SimpleTypeSGImpl

public interface SimpleTypeSG
extends SGItem

Interface of a source generator for complex types.

Author:
Jochen Wiedmann

Method Summary
 void addValidation(JavaMethod pMethod, DirectAccessible pValue)
          Adds code for validating the value pValue to the "add" or "set" method pMethod.
 void forAllNonNullValues(JavaMethod pMethod, java.lang.Object pValue, SGlet pSGlet)
          Invokes the given SGlet on any non null value.
 void forAllValues(JavaMethod pMethod, java.lang.Object pValue, SGlet pSGlet)
          Invokes the given SGlet on any value, assuming they are non null.
 void generate()
          Generates helper classes required by the simple type.
 void generate(JavaSource pSource)
          Generates helper classes required by the simple type.
 AtomicTypeSG getAtomicType()
          If the simple type is atomic: Returns its atomic type details.
 TypedValue getCastFromString(JavaMethod pMethod, java.lang.Object pValue, java.lang.Object pData)
          Returns a piece of Java code converting the string pValue into the runtime type.
 TypedValue getCastFromString(java.lang.String pValue)
          Returns a piece of Java code converting the string pValue into the runtime type.
 TypedValue getCastToString(JavaMethod pMethod, java.lang.Object pValue, DirectAccessible pData)
          Returns a piece of Java code converting the runtime type pValue into a string.
 java.lang.String getCollectionType()
          Returns the collection type, which is either of "indexed" (an array) or a list implementation, as specified by JAXB's property tag.
 java.lang.Object getEqualsCheck(JavaMethod pMethod, java.lang.Object pValue1, java.lang.Object pValue2)
          Returns code creating a boolean value indicating whether the given values are equal.
 Facet getFacet(Facet.Type pType)
          Returns the simple types facets with the given type or null, if no such facet exists.
 Facet[] getFacets()
          Returns all of the simple types facets.
 java.lang.Object getInitialValue(JavaSource pSource)
          Returns the types initial value, as created by the constructor.
 ListTypeSG getListType()
          If the simple type is a list: Returns its item type details.
 JavaQName getRuntimeType()
          Returns the data types runtime type.
 UnionTypeSG getUnionType()
          If the simple type is a union: Returns its union type details.
 JavaMethod getXMLSetMethod(JavaSource pSource, java.lang.String pFieldName, java.lang.String pParamName, java.lang.String pMethodName)
          Generates a set method for the simple type.
 boolean hasSetMethod()
          Returns whether the simple type does have a "set" method.
 boolean isAtomic()
          Returns whether the simple type is atomic.
 boolean isCausingParseConversionEvent()
          Returns whether converting this type from a string can cause a ParseConversionEvent.
 boolean isList()
          Returns whether the simple type is a list.
 boolean isNullable()
          Returns whether the simple type is nullable.
 boolean isUnion()
          Returns whether the simple type is a union.
 void setNullable(boolean pNullable)
          Sets whether the simple type is nullable.
 
Methods inherited from interface org.apache.ws.jaxme.generator.sg.SGItem
getFactory, getLocator, getSchema, init
 

Method Detail

isAtomic

boolean isAtomic()

Returns whether the simple type is atomic.


isList

boolean isList()

Returns whether the simple type is a list.


isUnion

boolean isUnion()

Returns whether the simple type is a union.


isNullable

boolean isNullable()

Returns whether the simple type is nullable.


setNullable

void setNullable(boolean pNullable)

Sets whether the simple type is nullable.


getAtomicType

AtomicTypeSG getAtomicType()

If the simple type is atomic: Returns its atomic type details.


getListType

ListTypeSG getListType()

If the simple type is a list: Returns its item type details.

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

getUnionType

UnionTypeSG getUnionType()

If the simple type is a union: Returns its union type details.

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

getRuntimeType

JavaQName getRuntimeType()

Returns the data types runtime type.


isCausingParseConversionEvent

boolean isCausingParseConversionEvent()
Returns whether converting this type from a string can cause a ParseConversionEvent.


getCastFromString

TypedValue getCastFromString(JavaMethod pMethod,
                             java.lang.Object pValue,
                             java.lang.Object pData)
                             throws org.xml.sax.SAXException

Returns a piece of Java code converting the string pValue into the runtime type. Conversion occurs at runtime, using the given instance of JMUnmarshallerHandler.

Parameters:
pMethod - The method performing the type convertion.
pValue - The value being casted
pData - A piece of Java code holding an instance of JMUnmarshallerHandler; may be used to support the conversion.
Throws:
org.xml.sax.SAXException

getCastToString

TypedValue getCastToString(JavaMethod pMethod,
                           java.lang.Object pValue,
                           DirectAccessible pData)
                           throws org.xml.sax.SAXException

Returns a piece of Java code converting the runtime type pValue into a string. Conversion occurs at runtime, using the given instance of JMUnmarshallerHandlerImpl.

Throws:
org.xml.sax.SAXException

getCastFromString

TypedValue getCastFromString(java.lang.String pValue)
                             throws org.xml.sax.SAXException

Returns a piece of Java code converting the string pValue into the runtime type. Conversion occurs at compile time.

Throws:
org.xml.sax.SAXException

hasSetMethod

boolean hasSetMethod()
                     throws org.xml.sax.SAXException

Returns whether the simple type does have a "set" method.

Throws:
org.xml.sax.SAXException

getCollectionType

java.lang.String getCollectionType()

Returns the collection type, which is either of "indexed" (an array) or a list implementation, as specified by JAXB's property tag.


getFacets

Facet[] getFacets()

Returns all of the simple types facets.


getFacet

Facet getFacet(Facet.Type pType)

Returns the simple types facets with the given type or null, if no such facet exists.


forAllValues

void forAllValues(JavaMethod pMethod,
                  java.lang.Object pValue,
                  SGlet pSGlet)
                  throws org.xml.sax.SAXException

Invokes the given SGlet on any value, assuming they are non null.

Throws:
org.xml.sax.SAXException

forAllNonNullValues

void forAllNonNullValues(JavaMethod pMethod,
                         java.lang.Object pValue,
                         SGlet pSGlet)
                         throws org.xml.sax.SAXException

Invokes the given SGlet on any non null value.

Throws:
org.xml.sax.SAXException

generate

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

Generates helper classes required by the simple type.

Throws:
org.xml.sax.SAXException

generate

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

Generates helper classes required by the simple type. The generated classes are inner classes of the given.

Throws:
org.xml.sax.SAXException

getEqualsCheck

java.lang.Object getEqualsCheck(JavaMethod pMethod,
                                java.lang.Object pValue1,
                                java.lang.Object pValue2)
                                throws org.xml.sax.SAXException

Returns code creating a boolean value indicating whether the given values are equal.

Throws:
org.xml.sax.SAXException

getInitialValue

java.lang.Object getInitialValue(JavaSource pSource)
                                 throws org.xml.sax.SAXException

Returns the types initial value, as created by the constructor.

Throws:
org.xml.sax.SAXException

getXMLSetMethod

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

Generates a set method for the simple type.

Throws:
org.xml.sax.SAXException

addValidation

void addValidation(JavaMethod pMethod,
                   DirectAccessible pValue)
                   throws org.xml.sax.SAXException

Adds code for validating the value pValue to the "add" or "set" method pMethod.

Throws:
org.xml.sax.SAXException