com.ashridgetech.jamda.code
Class ClassGenerator.FieldGenerator

java.lang.Object
  |
  +--com.ashridgetech.jamda.code.ClassGenerator.FieldGenerator
Enclosing class:
ClassGenerator

public class ClassGenerator.FieldGenerator
extends java.lang.Object

Generates a field variable in the code. May only be obtained from ClassGenerator.addField(java.lang.String, java.lang.String, int). Further methods may be called to set the characteristics.

See Also:
ClassGenerator.addField(java.lang.String, java.lang.String, int)

Constructor Summary
protected ClassGenerator.FieldGenerator(java.lang.String typeName, java.lang.String name)
          Create a FieldGenerator with the given name and type, and modifiers of PRIVATE.
 
Method Summary
 ClassGenerator.FieldGenerator addModifiers(int modifiers)
          Add modifiers to the existing modifiers.
 ClassGenerator.FieldGenerator addTag(java.lang.String tag)
          Set an extra tag for the method Javadoc.
 ClassGenerator.FieldGenerator description(java.lang.String comment)
          Set the field description.
 void generate()
          Generate this field's documentation, declaration and initialization in its containing ClassGenerator's ClassWriter.
 ClassGenerator.FieldGenerator initValue(java.lang.String expr)
          Set the field initial value expression.
 ClassGenerator.FieldGenerator setModifiers(int modifiers)
          Replace the existing modifiers with modifiers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassGenerator.FieldGenerator

protected ClassGenerator.FieldGenerator(java.lang.String typeName,
                                        java.lang.String name)
Create a FieldGenerator with the given name and type, and modifiers of PRIVATE.

Parameters:
name - the field name
typeName - the type name
Method Detail

addModifiers

public ClassGenerator.FieldGenerator addModifiers(int modifiers)
Add modifiers to the existing modifiers.

Parameters:
modifiers - the modifiers to OR with the existing ones.
Returns:
this instance

setModifiers

public ClassGenerator.FieldGenerator setModifiers(int modifiers)
Replace the existing modifiers with modifiers. If the constructor set this FieldGenerator to abstract, the abstract modifier will be added to those set.

Parameters:
modifiers - the new modifiers.
Returns:
this instance

initValue

public ClassGenerator.FieldGenerator initValue(java.lang.String expr)
Set the field initial value expression.

Parameters:
expr - the expression for the initial value of the field
Returns:
this instance

description

public ClassGenerator.FieldGenerator description(java.lang.String comment)
Set the field description.

Parameters:
comment - the description of the field
Returns:
this instance

addTag

public ClassGenerator.FieldGenerator addTag(java.lang.String tag)
Set an extra tag for the method Javadoc.

Parameters:
tag - the full text of the extra tag, such as "@see Widget#grumble"
Returns:
this instance

generate

public void generate()
Generate this field's documentation, declaration and initialization in its containing ClassGenerator's ClassWriter.



Copyright © 2003 Ashridge Technologies Ltd. All Rights Reserved.