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>>_annotationsprivate java.lang.Object_constantValueprivate int_modifiersprivate java.lang.String_nameprivate Type<?>_typeprivate TypeBuilder<?>_typeBuilder(package private) FieldInfogeneratedField
-
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.ObjectgetConstantValue()(package private) FieldInfogetCreatedField()ReadOnlyList<AnnotationBuilder<? extends java.lang.annotation.Annotation>>getCustomAnnotations()java.lang.annotation.Annotation[]getDeclaredAnnotations()TypeBuilder<?>getDeclaringType()Type<?>getFieldType()intgetModifiers()java.lang.StringgetName()java.lang.reflect.FieldgetRawField()Type<?>getReflectedType()booleanisAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)voidsetFieldType(Type<?> fieldType)(package private) voidverifyTypeNotCreated()-
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:
getFieldTypein classFieldInfo
-
setFieldType
public void setFieldType(Type<?> fieldType)
-
getRawField
public java.lang.reflect.Field getRawField()
- Specified by:
getRawFieldin classFieldInfo
-
getName
public java.lang.String getName()
- Specified by:
getNamein classMemberInfo
-
getDeclaringType
public TypeBuilder<?> getDeclaringType()
- Specified by:
getDeclaringTypein classMemberInfo
-
getModifiers
public int getModifiers()
- Specified by:
getModifiersin classMemberInfo
-
getConstantValue
public java.lang.Object getConstantValue()
-
getReflectedType
public Type<?> getReflectedType()
- Overrides:
getReflectedTypein classMemberInfo
-
getAnnotation
public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationClass)
- Specified by:
getAnnotationin interfacejava.lang.reflect.AnnotatedElement- Overrides:
getAnnotationin classFieldInfo
-
getAnnotations
@NotNull public java.lang.annotation.Annotation[] getAnnotations()
- Specified by:
getAnnotationsin interfacejava.lang.reflect.AnnotatedElement- Overrides:
getAnnotationsin classFieldInfo
-
getDeclaredAnnotations
@NotNull public java.lang.annotation.Annotation[] getDeclaredAnnotations()
- Specified by:
getDeclaredAnnotationsin interfacejava.lang.reflect.AnnotatedElement- Overrides:
getDeclaredAnnotationsin classFieldInfo
-
isAnnotationPresent
public boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
- Specified by:
isAnnotationPresentin interfacejava.lang.reflect.AnnotatedElement- Overrides:
isAnnotationPresentin classFieldInfo
-
-