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

Class PropertySGImpl

Implemented Interfaces:
PropertySG

public class PropertySGImpl
extends java.lang.Object
implements PropertySG

Constructor Summary

PropertySGImpl(PropertySGChain o)

Method Summary

void
addValue(JavaMethod pMethod, DirectAccessible pElement, TypedValue pValue, JavaQName pType)
Creates a piece of Java code adding an element value.
void
forAllNonNullValues(JavaMethod pMethod, DirectAccessible pElement, SGlet pSGlet)
Invokes the given SGlet for any non null value.
void
forAllValues(JavaMethod pMethod, DirectAccessible pElement, SGlet pSGlet)
Invokes the given SGlet for any value.
void
generate(JavaSource pSource)
Generates the property setters and getters.
String
getCollectionType()
Returns the properties collection type.
PropertySGChain
getHeadOfChain()
String
getPropertyName()
Returns the objects property name.
Object
getValue(DirectAccessible pElement)
Returns a piece of Java code with the property value.
JavaField
getXMLField(JavaSource pSource)
Creates the Java field holding the objects property value.
String
getXMLFieldName()
Returns the objects field name.
JavaMethod
getXMLGetMethod(JavaSource pSource)
Creates the getter returning the property value.
String
getXMLGetMethodName()
Returns the objects getter name.
JavaMethod
getXMLIsSetMethod(JavaSource pSource)
Creates the isSet returning whether the property value is set or not.
String
getXMLIsSetMethodName()
Returns the name of the objects "isSet" method.
JavaMethod
getXMLSetMethod(JavaSource pSource)
Creates the setter returning the property value.
String
getXMLSetMethodName()
Returns the objects setter name.
boolean
hasIsSetMethod()
Returns whether the property has an "is set" method.
void
init()
Initializes the PropertySG.
void
setValue(JavaMethod pMethod, DirectAccessible pElement, Object pValue, JavaQName pType)
Creates a piece of Java code setting the elements property value.

Constructor Details

PropertySGImpl

public PropertySGImpl(PropertySGChain o)

Method Details

addValue

public void addValue(JavaMethod pMethod,
                     DirectAccessible pElement,
                     TypedValue pValue,
                     JavaQName pType)
            throws SAXException
Creates a piece of Java code adding an element value. In the case of an element with multiplicity > 1, the object must be the atomic value.
Specified by:
addValue in interface PropertySG
Parameters:
pElement - The element on which the value is being set or null for "this".
pType - The values type, if a cast is required, or null, if the value is already casted.

forAllNonNullValues

public void forAllNonNullValues(JavaMethod pMethod,
                                DirectAccessible pElement,
                                SGlet pSGlet)
            throws SAXException
Invokes the given SGlet for any non null value.
Specified by:
forAllNonNullValues in interface PropertySG
Parameters:
pElement - The element on which the value is being set or null for "this".

forAllValues

public void forAllValues(JavaMethod pMethod,
                         DirectAccessible pElement,
                         SGlet pSGlet)
            throws SAXException
Invokes the given SGlet for any value.
Specified by:
forAllValues in interface PropertySG
Parameters:
pElement - The element on which the value is being set or null for "this".

generate

public void generate(JavaSource pSource)
            throws SAXException
Generates the property setters and getters.
Specified by:
generate in interface PropertySG

getCollectionType

public String getCollectionType()
Returns the properties collection type.
Specified by:
getCollectionType in interface PropertySG

getHeadOfChain

public PropertySGChain getHeadOfChain()

getPropertyName

public String getPropertyName()
            throws SAXException
Returns the objects property name.
Specified by:
getPropertyName in interface PropertySG

getValue

public Object getValue(DirectAccessible pElement)
            throws SAXException
Returns a piece of Java code with the property value.
Specified by:
getValue in interface PropertySG
Parameters:
pElement - The element on which the value is being set or null for "this".

getXMLField

public JavaField getXMLField(JavaSource pSource)
            throws SAXException
Creates the Java field holding the objects property value.
Specified by:
getXMLField in interface PropertySG

getXMLFieldName

public String getXMLFieldName()
            throws SAXException
Returns the objects field name. By default, this is the property name with the prefix '_'.
Specified by:
getXMLFieldName in interface PropertySG

getXMLGetMethod

public JavaMethod getXMLGetMethod(JavaSource pSource)
            throws SAXException
Creates the getter returning the property value.
Specified by:
getXMLGetMethod in interface PropertySG

getXMLGetMethodName

public String getXMLGetMethodName()
            throws SAXException
Returns the objects getter name.
Specified by:
getXMLGetMethodName in interface PropertySG

getXMLIsSetMethod

public JavaMethod getXMLIsSetMethod(JavaSource pSource)
            throws SAXException
Creates the isSet returning whether the property value is set or not.
Specified by:
getXMLIsSetMethod in interface PropertySG

getXMLIsSetMethodName

public String getXMLIsSetMethodName()
            throws SAXException
Returns the name of the objects "isSet" method.
Specified by:
getXMLIsSetMethodName in interface PropertySG

getXMLSetMethod

public JavaMethod getXMLSetMethod(JavaSource pSource)
            throws SAXException
Creates the setter returning the property value.
Specified by:
getXMLSetMethod in interface PropertySG

getXMLSetMethodName

public String getXMLSetMethodName()
            throws SAXException
Returns the objects setter name.
Specified by:
getXMLSetMethodName in interface PropertySG

hasIsSetMethod

public boolean hasIsSetMethod()
Returns whether the property has an "is set" method.
Specified by:
hasIsSetMethod in interface PropertySG

init

public void init()
            throws SAXException
Initializes the PropertySG.
Specified by:
init in interface PropertySG

setValue

public void setValue(JavaMethod pMethod,
                     DirectAccessible pElement,
                     Object pValue,
                     JavaQName pType)
            throws SAXException
Creates a piece of Java code setting the elements property value. In the case of an element with multiplicity > 1, the object must be a list or an array.
Specified by:
setValue in interface PropertySG
Parameters:
pMethod - The method being generated.
pElement - The element on which the value is being set or null for "this".
pType - The values type, if a cast is required, or null, if the value is already casted.