org.nuiton.guix.generator
Class JavaField

java.lang.Object
  extended by org.nuiton.guix.generator.JavaField
All Implemented Interfaces:
java.lang.Comparable<JavaField>

public class JavaField
extends java.lang.Object
implements java.lang.Comparable<JavaField>

Represents a field in a Java source file being generated for output. JavaFields are created and added to a JavaFile, which can then output Java source code.


Field Summary
static java.util.Comparator<JavaField> COMPARATOR
           
 
Constructor Summary
JavaField(int modifiers, java.lang.String type, java.lang.String name, java.lang.String javaDoc)
          Constructs a new JavaField.
JavaField(int modifiers, java.lang.String type, java.lang.String name, java.lang.String initializer, java.lang.String javaDoc, TagHandler tagHandler)
          Constructs a new JavaField.
JavaField(int modifiers, java.lang.String type, java.lang.String name, java.lang.String javaDoc, TagHandler tagHanlder)
          Constructs a new JavaField.
 
Method Summary
 int compareTo(JavaField o)
           
 int getModifiers()
          Returns a bit mask describing the modifier keywords which should appear as part of this field's declaration.
 java.lang.String getName()
          Returns the field's name.
 TagHandler getTagHandler()
           
 java.lang.String getType()
          Returns the field's type, as it would be represented in Java source code.
static JavaField newField(int modifiers, java.lang.String returnType, java.lang.String name)
           
static JavaField newField(int modifiers, java.lang.String returnType, java.lang.String name, java.lang.String initializer)
           
 java.lang.String toString(java.lang.String lineSeparator)
          Returns the Java source code for this field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPARATOR

public static final java.util.Comparator<JavaField> COMPARATOR
Constructor Detail

JavaField

public JavaField(int modifiers,
                 java.lang.String type,
                 java.lang.String name,
                 java.lang.String javaDoc)
Constructs a new JavaField. The modifiers parameter is a bit mask of the constants from Modifier, and the type of the field should be represented as it would appear in Java source code.

Parameters:
modifiers - the modifier keywords that should appear as part of the field's declaration
type - the type of the field as it would appear in Java source code
name - the field's name

JavaField

public JavaField(int modifiers,
                 java.lang.String type,
                 java.lang.String name,
                 java.lang.String javaDoc,
                 TagHandler tagHanlder)
Constructs a new JavaField. The modifiers parameter is a bit mask of the constants from Modifier, and the type of the field should be represented as it would appear in Java source code.

Parameters:
modifiers - the modifier keywords that should appear as part of the field's declaration
type - the type of the field as it would appear in Java source code
name - the field's name

JavaField

public JavaField(int modifiers,
                 java.lang.String type,
                 java.lang.String name,
                 java.lang.String initializer,
                 java.lang.String javaDoc,
                 TagHandler tagHandler)
Constructs a new JavaField. The modifiers parameter is a bit mask of the constants from java.lang.reflect.Modifier, and the type of the field should be represented as it would appear in Java source code. The initializer is the initial value of the field as it would appear in Java source code, or null to leave it at the default value.

Parameters:
modifiers - the modifier keywords that should appear as part of the field's declaration
type - the type of the field as it would appear in Java source code
name - the field's name
initializer - the initial value of the field, as it would appear in Java source code
Method Detail

getModifiers

public int getModifiers()
Returns a bit mask describing the modifier keywords which should appear as part of this field's declaration. See java.lang.reflect.Modifier for more information on decoding this field.

Returns:
the modifier bit mask

getName

public java.lang.String getName()
Returns the field's name.

Returns:
the field's name

getType

public java.lang.String getType()
Returns the field's type, as it would be represented in Java source code.

Returns:
the field's type

getTagHandler

public TagHandler getTagHandler()

toString

public java.lang.String toString(java.lang.String lineSeparator)
Returns the Java source code for this field.

Parameters:
lineSeparator - line separator
Returns:
the Java source code for this field

compareTo

public int compareTo(JavaField o)
Specified by:
compareTo in interface java.lang.Comparable<JavaField>

newField

public static JavaField newField(int modifiers,
                                 java.lang.String returnType,
                                 java.lang.String name)

newField

public static JavaField newField(int modifiers,
                                 java.lang.String returnType,
                                 java.lang.String name,
                                 java.lang.String initializer)


Copyright © 2009 CodeLutin. All Rights Reserved.