org.apache.ws.jaxme.generator.sg

Interface PropertySG

public interface PropertySG

Author: Jochen Wiedmann

Method Summary
voidaddValue(JavaMethod pMethod, DirectAccessible pElement, TypedValue pValue, JavaQName pType)

Creates a piece of Java code adding an element value.

voidforAllNonNullValues(JavaMethod pMethod, DirectAccessible pElement, SGlet pSGlet)

Invokes the given SGlet for any non null value.

voidforAllValues(JavaMethod pMethod, DirectAccessible pElement, SGlet pSGlet)

Invokes the given SGlet for any value.

voidgenerate(JavaSource pSource)

Generates the property setters and getters.

StringgetCollectionType()

Returns the properties collection type.

StringgetPropertyName()

Returns the objects property name.

ObjectgetValue(DirectAccessible pElement)

Returns a piece of Java code with the property value.

JavaFieldgetXMLField(JavaSource pSource)

Creates the Java field holding the objects property value.

StringgetXMLFieldName()

Returns the objects field name.

JavaMethodgetXMLGetMethod(JavaSource pSource)

Creates the getter returning the property value.

StringgetXMLGetMethodName()

Returns the objects getter name.

JavaMethodgetXMLIsSetMethod(JavaSource pSource)

Creates the isSet returning whether the property value is set or not.

StringgetXMLIsSetMethodName()

Returns the name of the objects "isSet" method.

JavaMethodgetXMLSetMethod(JavaSource pSource)

Creates the setter returning the property value.

StringgetXMLSetMethodName()

Returns the objects setter name.

booleanhasIsSetMethod()

Returns whether the property has an "is set" method.

voidinit()

Initializes the PropertySG.

voidsetValue(JavaMethod pMethod, DirectAccessible pElement, Object pValue, JavaQName pType)

Creates a piece of Java code setting the elements property value.

Method Detail

addValue

public void addValue(JavaMethod pMethod, DirectAccessible pElement, TypedValue pValue, JavaQName pType)

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.

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)

Invokes the given SGlet for any non null value.

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)

Invokes the given SGlet for any value.

Parameters: pElement The element on which the value is being set or null for "this".

generate

public void generate(JavaSource pSource)

Generates the property setters and getters.

getCollectionType

public String getCollectionType()

Returns the properties collection type.

getPropertyName

public String getPropertyName()

Returns the objects property name.

getValue

public Object getValue(DirectAccessible pElement)

Returns a piece of Java code with the property value.

Parameters: pElement The element on which the value is being set or null for "this".

getXMLField

public JavaField getXMLField(JavaSource pSource)

Creates the Java field holding the objects property value.

getXMLFieldName

public String getXMLFieldName()

Returns the objects field name. By default, this is the property name with the prefix '_'.

getXMLGetMethod

public JavaMethod getXMLGetMethod(JavaSource pSource)

Creates the getter returning the property value.

getXMLGetMethodName

public String getXMLGetMethodName()

Returns the objects getter name.

getXMLIsSetMethod

public JavaMethod getXMLIsSetMethod(JavaSource pSource)

Creates the isSet returning whether the property value is set or not.

getXMLIsSetMethodName

public String getXMLIsSetMethodName()

Returns the name of the objects "isSet" method.

getXMLSetMethod

public JavaMethod getXMLSetMethod(JavaSource pSource)

Creates the setter returning the property value.

getXMLSetMethodName

public String getXMLSetMethodName()

Returns the objects setter name.

hasIsSetMethod

public boolean hasIsSetMethod()

Returns whether the property has an "is set" method.

init

public void init()

Initializes the PropertySG.

setValue

public void setValue(JavaMethod pMethod, DirectAccessible pElement, Object pValue, JavaQName pType)

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.

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.