Package com.strobel.reflection.emit
Class FieldBuilder
- java.lang.Object
-
- com.strobel.reflection.MemberInfo
-
- com.strobel.reflection.FieldInfo
-
- com.strobel.reflection.emit.FieldBuilder
-
- All Implemented Interfaces:
java.lang.reflect.AnnotatedElement
public final class FieldBuilder extends FieldInfo
-
-
Field Summary
Fields Modifier and Type Field Description private ReadOnlyList<AnnotationBuilder<? extends java.lang.annotation.Annotation>>
_annotations
private java.lang.Object
_constantValue
private int
_modifiers
private java.lang.String
_name
private Type<?>
_type
private TypeBuilder<?>
_typeBuilder
(package private) FieldInfo
generatedField
-
Constructor Summary
Constructors Constructor Description FieldBuilder(TypeBuilder<?> typeBuilder, java.lang.String name, Type<?> type, int modifiers, java.lang.Object constantValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <A extends java.lang.annotation.Annotation>
voidaddCustomAnnotation(AnnotationBuilder<A> annotation)
<T extends java.lang.annotation.Annotation>
TgetAnnotation(java.lang.Class<T> annotationClass)
java.lang.annotation.Annotation[]
getAnnotations()
java.lang.Object
getConstantValue()
(package private) FieldInfo
getCreatedField()
ReadOnlyList<AnnotationBuilder<? extends java.lang.annotation.Annotation>>
getCustomAnnotations()
java.lang.annotation.Annotation[]
getDeclaredAnnotations()
TypeBuilder<?>
getDeclaringType()
Type<?>
getFieldType()
int
getModifiers()
java.lang.String
getName()
java.lang.reflect.Field
getRawField()
Type<?>
getReflectedType()
boolean
isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
void
setFieldType(Type<?> fieldType)
(package private) void
verifyTypeNotCreated()
-
Methods inherited from class com.strobel.reflection.FieldInfo
appendBriefDescription, appendDescription, appendErasedDescription, appendErasedSignature, appendSignature, appendSimpleDescription, getMemberType, getValue, isEnumConstant, isEquivalentTo, setValue, toString
-
Methods inherited from class com.strobel.reflection.MemberInfo
appendGenericSignature, emptyAnnotations, equals, getAnnotationsByType, getBriefDescription, getDeclaredAnnotation, getDeclaredAnnotationsByType, getDescription, getErasedDescription, getErasedSignature, getSignature, getSimpleDescription, hashCode, invalidateCaches, isFinal, isNonPublic, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic
-
-
-
-
Field Detail
-
_typeBuilder
private final TypeBuilder<?> _typeBuilder
-
_name
private final java.lang.String _name
-
_modifiers
private final int _modifiers
-
_constantValue
private final java.lang.Object _constantValue
-
_type
private Type<?> _type
-
_annotations
private ReadOnlyList<AnnotationBuilder<? extends java.lang.annotation.Annotation>> _annotations
-
generatedField
FieldInfo generatedField
-
-
Constructor Detail
-
FieldBuilder
FieldBuilder(TypeBuilder<?> typeBuilder, java.lang.String name, Type<?> type, int modifiers, java.lang.Object constantValue)
-
-
Method Detail
-
getCreatedField
FieldInfo getCreatedField()
-
addCustomAnnotation
public <A extends java.lang.annotation.Annotation> void addCustomAnnotation(AnnotationBuilder<A> annotation)
-
getCustomAnnotations
public ReadOnlyList<AnnotationBuilder<? extends java.lang.annotation.Annotation>> getCustomAnnotations()
-
verifyTypeNotCreated
void verifyTypeNotCreated()
-
getFieldType
public Type<?> getFieldType()
- Specified by:
getFieldType
in classFieldInfo
-
setFieldType
public void setFieldType(Type<?> fieldType)
-
getRawField
public java.lang.reflect.Field getRawField()
- Specified by:
getRawField
in classFieldInfo
-
getName
public java.lang.String getName()
- Specified by:
getName
in classMemberInfo
-
getDeclaringType
public TypeBuilder<?> getDeclaringType()
- Specified by:
getDeclaringType
in classMemberInfo
-
getModifiers
public int getModifiers()
- Specified by:
getModifiers
in classMemberInfo
-
getConstantValue
public java.lang.Object getConstantValue()
-
getReflectedType
public Type<?> getReflectedType()
- Overrides:
getReflectedType
in classMemberInfo
-
getAnnotation
public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationClass)
- Specified by:
getAnnotation
in interfacejava.lang.reflect.AnnotatedElement
- Overrides:
getAnnotation
in classFieldInfo
-
getAnnotations
@NotNull public java.lang.annotation.Annotation[] getAnnotations()
- Specified by:
getAnnotations
in interfacejava.lang.reflect.AnnotatedElement
- Overrides:
getAnnotations
in classFieldInfo
-
getDeclaredAnnotations
@NotNull public java.lang.annotation.Annotation[] getDeclaredAnnotations()
- Specified by:
getDeclaredAnnotations
in interfacejava.lang.reflect.AnnotatedElement
- Overrides:
getDeclaredAnnotations
in classFieldInfo
-
isAnnotationPresent
public boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
- Specified by:
isAnnotationPresent
in interfacejava.lang.reflect.AnnotatedElement
- Overrides:
isAnnotationPresent
in classFieldInfo
-
-