public class FieldInfo extends java.lang.Object implements JavaInfo, Copyable, java.lang.Comparable
Modifier and Type | Field and Description |
---|---|
int |
accessorModifiers
Modifiers on the get/set methods that expose this field as a Bean property
|
java.lang.String |
declaringClassName
Declaring class name
|
int |
modifiers
Modifiers declared (implictly or explicitly)
|
java.lang.String |
name
Name of the field.
|
java.lang.String |
type
Class name of the filed type
|
java.lang.String |
typeSignature
Class name of the filed type
|
DEFAULT_MODIFIERS, DUPLICATE_PARAM_NAME, DUPLICATE_THROW_CLAUSE, GENERIC_SETTINGS_ERROR, INVALID_DIMENSION, INVALID_IDENTIFIER, INVALID_IDENTIFIER_NULL, INVALID_MODIFIERS, INVALID_PARAM_IDENTIFIER, INVALID_PARAM_IDENTIFIER_NULL, INVALID_PARAM_TYPE_NULL, INVALID_THROW_TYPE_NULL, INVALID_TYPE_NULL, PARAM_TYPE_NOT_FOUND, PRIMITIVE_FIELD_TYPES, PRIMITIVE_METHOD_TYPES, THROW_TYPE_NOT_FOUND, TYPE_NOT_FOUND, VALID
Constructor and Description |
---|
FieldInfo()
Default Constructor
-------------------------------------------------------------------------
|
FieldInfo(FieldInfo fi)
Copy Constructor
-------------------------------------------------------------------------
|
FieldInfo(JavaVariable javaVar)
Initialize from JavaField
-------------------------------------------------------------------------
|
FieldInfo(java.lang.String type,
java.lang.String name,
int modifiers) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object o) |
java.lang.Object |
copyTo(java.lang.Object target)
Copyable interface
-------------------------------------------------------------------------
|
protected void |
copyToImpl(FieldInfo copy) |
SourceLocalVariable |
createLocalVariable(SourceFile srcFile)
Helper method for creating a new SourceFieldDeclaration from a FieldInfo.
|
SourceLocalVariable |
createLocalVariable(SourceFile srcFile,
java.lang.String expr) |
SourceLocalVariableDeclaration |
createLocalVariableDeclaration(SourceFile srcFile)
Helper method for creating a new SourceFieldDeclaration from a FieldInfo.
|
SourceLocalVariableDeclaration |
createLocalVariableDeclaration(SourceFile srcFile,
java.lang.String expr) |
SourceFieldDeclaration |
createSourceFieldDecl(SourceFile srcFile)
Helper method for creating a new SourceFieldDeclaration from a FieldInfo.
|
SourceFieldDeclaration |
createSourceFieldDecl(SourceFile srcFile,
java.lang.String expr) |
boolean |
equals(java.lang.Object o) |
protected boolean |
equalsImpl(FieldInfo fieldInfo) |
java.util.Collection |
getJavaFieldAnnotations() |
protected java.util.Collection |
getJavaFieldAnnotations(JavaField javaField) |
java.lang.String |
getName()
Get the name of the field being described by this FieldInfo.
|
int |
hashCode() |
MethodInfo |
makeGetter() |
MethodInfo |
makeGetter(java.lang.String fieldName,
java.lang.String fieldType) |
MethodInfo |
makeSetter() |
MethodInfo |
makeSetter(java.lang.String fieldName,
java.lang.String fieldType) |
java.lang.String |
render() |
protected void |
setJavaFieldAnnotations(java.util.Collection javaAnno) |
java.lang.String |
toString() |
int |
validate()
Validate the settings of the FieldInfo.
|
public java.lang.String name
public java.lang.String type
public java.lang.String typeSignature
public java.lang.String declaringClassName
public int modifiers
public int accessorModifiers
public FieldInfo()
public FieldInfo(java.lang.String type, java.lang.String name, int modifiers)
public FieldInfo(JavaVariable javaVar)
public FieldInfo(FieldInfo fi)
public java.lang.Object copyTo(java.lang.Object target)
copyTo
in interface Copyable
target
- The target object to which the state of
this
object should be copied. If target
is null
, then the copyTo
method will
return a new instance of this
class.this
object was copied. If the target
was
non-null
, then the return value is the same as the
target
object that was passed in; otherwise, the
return value is a new instance of this
class.protected final void copyToImpl(FieldInfo copy)
public java.lang.String render()
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
protected final boolean equalsImpl(FieldInfo fieldInfo)
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int validate()
public java.lang.String getName()
public MethodInfo makeGetter()
public MethodInfo makeGetter(java.lang.String fieldName, java.lang.String fieldType)
public MethodInfo makeSetter()
public MethodInfo makeSetter(java.lang.String fieldName, java.lang.String fieldType)
public SourceFieldDeclaration createSourceFieldDecl(SourceFile srcFile)
srcFile
- public SourceFieldDeclaration createSourceFieldDecl(SourceFile srcFile, java.lang.String expr)
public SourceLocalVariableDeclaration createLocalVariableDeclaration(SourceFile srcFile)
srcFile
- public SourceLocalVariableDeclaration createLocalVariableDeclaration(SourceFile srcFile, java.lang.String expr)
public SourceLocalVariable createLocalVariable(SourceFile srcFile)
srcFile
- public SourceLocalVariable createLocalVariable(SourceFile srcFile, java.lang.String expr)
protected void setJavaFieldAnnotations(java.util.Collection javaAnno)
protected java.util.Collection getJavaFieldAnnotations(JavaField javaField)
public java.util.Collection getJavaFieldAnnotations()