Comparable<FieldInfo>
public class FieldInfo extends Object implements Comparable<FieldInfo>
Constructor | Description |
---|---|
FieldInfo(String className,
String fieldName,
int modifiers,
String typeDescriptorStr,
String typeSignatureStr,
Object constValue,
List<AnnotationInfo> annotationInfo) |
Modifier and Type | Method | Description |
---|---|---|
int |
compareTo(FieldInfo other) |
Sort in order of class name then field name
|
boolean |
equals(Object obj) |
Use class name and field name for equals().
|
List<AnnotationInfo> |
getAnnotationInfo() |
Get a list of annotations on this field, along with any annotation parameter values, wrapped in
AnnotationInfo objects. |
List<String> |
getAnnotationNames() |
Returns the names of unique annotations on the field.
|
List<Class<?>> |
getAnnotationTypes() |
Returns
Class<?> references for the unique annotations on this field. |
String |
getClassName() |
Get the name of the class this field is defined within.
|
Object |
getConstFinalValue() |
Returns the constant final initializer value of the field.
|
String |
getFieldName() |
Returns the name of the field.
|
int |
getModifiers() |
Returns the modifier bits for the field.
|
String |
getModifierStr() |
Get the field modifiers as a string, e.g.
|
String |
getModifierStrs() |
Deprecated.
|
Class<?> |
getType() |
Returns the
Class<?> reference for the field. |
TypeSignature |
getTypeDescriptor() |
Returns the parsed type descriptor for the field, if available.
|
String |
getTypeDescriptorStr() |
Returns the low-level internal type descriptor string for the field, without type parameters, e.g.
|
TypeSignature |
getTypeSignature() |
Returns the parsed type signature for the field, if available.
|
TypeSignature |
getTypeSignatureOrTypeDescriptor() |
Returns the parsed type signature for the field, possibly including type parameters.
|
String |
getTypeSignatureStr() |
Returns the low-level internal type signature string for the method, possibly with type parameters.
|
int |
hashCode() |
Use hash code of class name and field name.
|
boolean |
isFinal() |
Returns true if this field is final.
|
boolean |
isPackagePrivate() |
Returns true if this field is package-private.
|
boolean |
isPrivate() |
Returns true if this field is private.
|
boolean |
isProtected() |
Returns true if this field is protected.
|
boolean |
isPublic() |
Returns true if this field is public.
|
boolean |
isStatic() |
Returns true if this field is static.
|
boolean |
isTransient() |
Returns true if this field is a transient field.
|
String |
toString() |
public FieldInfo(String className, String fieldName, int modifiers, String typeDescriptorStr, String typeSignatureStr, Object constValue, List<AnnotationInfo> annotationInfo)
className
- The class the field is defined within.fieldName
- The name of the field.modifiers
- The field modifiers.typeDescriptorStr
- The field type descriptor.typeSignatureStr
- The field type signature.constValue
- The static constant value the field is initialized to, if any.annotationInfo
- AnnotationInfo
for any annotations on the field.public String getClassName()
public String getFieldName()
@Deprecated public String getModifierStrs()
public String getModifierStr()
public boolean isPublic()
public boolean isPrivate()
public boolean isProtected()
public boolean isPackagePrivate()
public boolean isStatic()
public boolean isFinal()
public boolean isTransient()
public int getModifiers()
public String getTypeDescriptorStr()
public TypeSignature getTypeDescriptor()
public String getTypeSignatureStr()
public TypeSignature getTypeSignature()
public TypeSignature getTypeSignatureOrTypeDescriptor()
public Class<?> getType() throws IllegalArgumentException
Class<?>
reference for the field. Note that this calls Class.forName() on the field type,
which will cause the class to be loaded, and possibly initialized. If the class is initialized, this can
trigger side effects.Class<?>
reference for the field.IllegalArgumentException
- if the field type could not be loaded.public Object getConstFinalValue()
public List<String> getAnnotationNames()
public List<Class<?>> getAnnotationTypes() throws IllegalArgumentException
Class<?>
references for the unique annotations on this field. Note that this calls
Class.forName() on the annotation types, which will cause each annotation class to be loaded.Class<?>
references for the unique annotations on this field.IllegalArgumentException
- if the annotation type could not be loaded.public List<AnnotationInfo> getAnnotationInfo()
AnnotationInfo
objects.AnnotationInfo
objects, or the empty list if none.public boolean equals(Object obj)
public int hashCode()
public int compareTo(FieldInfo other)
compareTo
in interface Comparable<FieldInfo>
Copyright © 2018. All rights reserved.