Package com.strobel.reflection.emit
Class ConstructorBuilder
- java.lang.Object
-
- com.strobel.reflection.MemberInfo
-
- com.strobel.reflection.MethodBase
-
- com.strobel.reflection.ConstructorInfo
-
- com.strobel.reflection.emit.ConstructorBuilder
-
- All Implemented Interfaces:
java.lang.reflect.AnnotatedElement
public final class ConstructorBuilder extends ConstructorInfo
-
-
Field Summary
Fields Modifier and Type Field Description private MethodBuilder
_methodBuilder
(package private) ConstructorInfo
generatedConstructor
(package private) boolean
returnCodeGenerator
-
Constructor Summary
Constructors Constructor Description ConstructorBuilder(int modifiers, TypeList parameterTypes, TypeList thrownTypes, TypeBuilder<?> declaringType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCustomAnnotation(AnnotationBuilder<? extends java.lang.annotation.Annotation> annotation)
java.lang.StringBuilder
appendErasedSignature(java.lang.StringBuilder sb)
java.lang.StringBuilder
appendSimpleDescription(java.lang.StringBuilder sb)
void
defineParameter(int position, java.lang.String name)
<T extends java.lang.annotation.Annotation>
TgetAnnotation(java.lang.Class<T> annotationClass)
java.lang.annotation.Annotation[]
getAnnotations()
CodeGenerator
getCodeGenerator()
ReadOnlyList<AnnotationBuilder<? extends java.lang.annotation.Annotation>>
getCustomAnnotations()
java.lang.annotation.Annotation[]
getDeclaredAnnotations()
TypeBuilder<?>
getDeclaringType()
java.util.List<ParameterBuilder>
getDefinedParameters()
MethodBuilder
getMethodBuilder()
int
getModifiers()
ParameterList
getParameters()
TypeList
getParameterTypes()
java.lang.reflect.Constructor<?>
getRawConstructor()
Type<?>
getReflectedType()
SignatureType
getSignatureType()
boolean
isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
boolean
isFinished()
boolean
isTypeCreated()
void
setParameterTypes(TypeList parameterTypes)
private void
verifyTypeCreated()
-
Methods inherited from class com.strobel.reflection.ConstructorInfo
appendBriefDescription, appendDescription, appendErasedDescription, appendSignature, containsGenericParameter, getMemberType, getName, invoke
-
Methods inherited from class com.strobel.reflection.MethodBase
getCallingConvention, getThrownTypes, isEquivalentTo
-
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, toString
-
-
-
-
Field Detail
-
_methodBuilder
private final MethodBuilder _methodBuilder
-
returnCodeGenerator
boolean returnCodeGenerator
-
generatedConstructor
ConstructorInfo generatedConstructor
-
-
Constructor Detail
-
ConstructorBuilder
public ConstructorBuilder(int modifiers, TypeList parameterTypes, TypeList thrownTypes, TypeBuilder<?> declaringType)
-
-
Method Detail
-
verifyTypeCreated
private void verifyTypeCreated()
-
isFinished
public boolean isFinished()
-
isTypeCreated
public boolean isTypeCreated()
-
getMethodBuilder
public MethodBuilder getMethodBuilder()
-
getCodeGenerator
public CodeGenerator getCodeGenerator()
-
getRawConstructor
public java.lang.reflect.Constructor<?> getRawConstructor()
- Specified by:
getRawConstructor
in classConstructorInfo
-
appendErasedSignature
public java.lang.StringBuilder appendErasedSignature(java.lang.StringBuilder sb)
- Overrides:
appendErasedSignature
in classConstructorInfo
-
appendSimpleDescription
public java.lang.StringBuilder appendSimpleDescription(java.lang.StringBuilder sb)
- Overrides:
appendSimpleDescription
in classConstructorInfo
-
getDeclaringType
public TypeBuilder<?> getDeclaringType()
- Specified by:
getDeclaringType
in classMemberInfo
-
getModifiers
public int getModifiers()
- Specified by:
getModifiers
in classMemberInfo
-
getSignatureType
public SignatureType getSignatureType()
- Specified by:
getSignatureType
in classMethodBase
-
getParameters
public ParameterList getParameters()
- Overrides:
getParameters
in classMethodBase
-
getParameterTypes
public TypeList getParameterTypes()
-
setParameterTypes
public void setParameterTypes(TypeList parameterTypes)
-
getDefinedParameters
public java.util.List<ParameterBuilder> getDefinedParameters()
-
defineParameter
public void defineParameter(int position, java.lang.String name)
-
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 classConstructorInfo
-
getAnnotations
@NotNull public java.lang.annotation.Annotation[] getAnnotations()
- Specified by:
getAnnotations
in interfacejava.lang.reflect.AnnotatedElement
- Overrides:
getAnnotations
in classConstructorInfo
-
getDeclaredAnnotations
@NotNull public java.lang.annotation.Annotation[] getDeclaredAnnotations()
- Specified by:
getDeclaredAnnotations
in interfacejava.lang.reflect.AnnotatedElement
- Overrides:
getDeclaredAnnotations
in classConstructorInfo
-
isAnnotationPresent
public boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
- Specified by:
isAnnotationPresent
in interfacejava.lang.reflect.AnnotatedElement
- Overrides:
isAnnotationPresent
in classConstructorInfo
-
addCustomAnnotation
public void addCustomAnnotation(AnnotationBuilder<? extends java.lang.annotation.Annotation> annotation)
-
getCustomAnnotations
public ReadOnlyList<AnnotationBuilder<? extends java.lang.annotation.Annotation>> getCustomAnnotations()
-
-