jaxx.compiler.java
Class JavaField
java.lang.Object
jaxx.compiler.java.JavaElement
jaxx.compiler.java.JavaField
- All Implemented Interfaces:
- Comparable<JavaField>
public class JavaField
- extends JavaElement
- implements 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.
JavaField
public JavaField(int modifiers,
String type,
String name,
boolean override)
- 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 declarationtype - the type of the field as it would appear in Java source codename - the field's nameoverride - flag to add @Override annotation on getter and setter
JavaField
public JavaField(int modifiers,
String type,
String name,
boolean override,
String initializer)
- 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 declarationtype - the type of the field as it would appear in Java source codename - the field's nameoverride - true if method should be marked as overrideninitializer - the initial value of the field, as it would appear in Java source code
getType
public String getType()
- Returns the field's type, as it would be represented in Java source code.
- Returns:
- the field's type
isOverride
public boolean isOverride()
getInitializer
public String getInitializer()
compareTo
public int compareTo(JavaField o)
- Specified by:
compareTo in interface Comparable<JavaField>
toString
public String toString()
- Overrides:
toString in class Object
getSortedFields
public static EnumMap<JavaField.FieldOrder,List<JavaField>> getSortedFields(List<JavaField> fields)
getFieldOrderScope
public static EnumSet<JavaField.FieldOrder> getFieldOrderScope(EnumSet<JavaField.FieldOrder> allConstants,
int scope)
Copyright © 2008-2011 CodeLutin. All Rights Reserved.