Package com.strobel.reflection.emit
Class MethodBuilder
java.lang.Object
com.strobel.reflection.MemberInfo
com.strobel.reflection.MethodBase
com.strobel.reflection.MethodInfo
com.strobel.reflection.emit.MethodBuilder
- All Implemented Interfaces:
AnnotatedElement
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ReadOnlyList
<AnnotationBuilder<? extends Annotation>> private byte[]
private final TypeBuilder
<?> private Object
private __ExceptionInstance[]
private boolean
private final int
private final String
private int
private SignatureType
private TypeList
(package private) MethodInfo
(package private) CodeGenerator
(package private) GenericParameterBuilder<?>[]
(package private) ParameterBuilder[]
Fields inherited from class com.strobel.reflection.MethodInfo
_erasedMethodDefinition
-
Constructor Summary
ConstructorsConstructorDescriptionMethodBuilder
(String name, int modifiers, Type<?> returnType, TypeList parameterTypes, TypeList thrownTypes, TypeBuilder<?> declaringType) -
Method Summary
Modifier and TypeMethodDescription<A extends Annotation>
voidaddCustomAnnotation
(AnnotationBuilder<A> annotation) private static int
calculateNumberOfExceptions
(__ExceptionInfo[] exceptions) void
createMethodBody
(byte[] bytecode, int size) (package private) void
(package private) ParameterList
defineGenericParameters
(String... names) defineParameter
(int position, String name) <T extends Annotation>
TgetAnnotation
(Class<T> annotationClass) (package private) byte[]
getBody()
getCodeGenerator
(int initialSize) ReadOnlyList
<AnnotationBuilder<? extends Annotation>> TypeBuilder
<?> (package private) __ExceptionInstance[]
int
getName()
(package private) int
Type
<?> Type
<?> boolean
isAnnotationPresent
(Class<? extends Annotation> annotationClass) boolean
boolean
boolean
boolean
(package private) void
void
setDefaultValue
(Object value) void
setParameters
(TypeList types) void
setReturnType
(Type<?> type) void
setSignature
(Type<?> returnType, TypeList parameterTypes) void
setThrownTypes
(TypeList types) (package private) void
(package private) void
(package private) void
Methods inherited from class com.strobel.reflection.MethodInfo
appendBriefDescription, appendErasedDescription, appendModifiers, containsGenericParameter, containsGenericParameters, emptyMethods, findBaseMethod, findOverriddenMethod, getGenericMethodDefinition, getMemberType, getTypeArguments, getTypeBindings, invoke, isAbstract, isDefault, isEquivalentTo, makeGenericMethod, makeGenericMethod
Methods inherited from class com.strobel.reflection.MethodBase
getCallingConvention
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 Details
-
_name
-
_declaringType
-
_modifiers
private final int _modifiers -
_signatureType
-
_thrownTypes
-
_isFinished
private boolean _isFinished -
_annotations
-
_body
private byte[] _body -
_numberOfExceptions
private int _numberOfExceptions -
_exceptions
-
_defaultValue
-
genericParameterBuilders
GenericParameterBuilder<?>[] genericParameterBuilders -
parameterBuilders
ParameterBuilder[] parameterBuilders -
generator
CodeGenerator generator -
generatedMethod
MethodInfo generatedMethod
-
-
Constructor Details
-
MethodBuilder
MethodBuilder(String name, int modifiers, Type<?> returnType, TypeList parameterTypes, TypeList thrownTypes, TypeBuilder<?> declaringType)
-
-
Method Details
-
verifyNotGeneric
void verifyNotGeneric() -
verifyNotAbstract
void verifyNotAbstract() -
getCodeGenerator
-
getCodeGenerator
-
getName
- Overrides:
getName
in classMethodInfo
-
getReturnType
- Specified by:
getReturnType
in classMethodInfo
-
getSignatureType
- Specified by:
getSignatureType
in classMethodBase
-
getRawMethod
- Specified by:
getRawMethod
in classMethodInfo
-
getDefaultValue
- Overrides:
getDefaultValue
in classMethodInfo
-
setDefaultValue
-
getDeclaringType
- Specified by:
getDeclaringType
in classMemberInfo
-
getModifiers
public int getModifiers()- Specified by:
getModifiers
in classMemberInfo
-
getParameters
- Overrides:
getParameters
in classMethodBase
-
createParameters
ParameterList createParameters() -
getThrownTypes
- Overrides:
getThrownTypes
in classMethodBase
-
getParameterTypes
-
getDefinedParameters
-
isTypeCreated
public boolean isTypeCreated() -
isFinished
public boolean isFinished() -
setReturnType
-
verifyCodeGeneratorNotCreated
void verifyCodeGeneratorNotCreated() -
setSignature
-
setParameters
-
setThrownTypes
-
getReflectedType
- Overrides:
getReflectedType
in classMemberInfo
-
addCustomAnnotation
-
getCustomAnnotations
-
getAnnotation
- Specified by:
getAnnotation
in interfaceAnnotatedElement
- Overrides:
getAnnotation
in classMethodInfo
-
getAnnotations
- Specified by:
getAnnotations
in interfaceAnnotatedElement
- Overrides:
getAnnotations
in classMethodInfo
-
getDeclaredAnnotations
- Specified by:
getDeclaredAnnotations
in interfaceAnnotatedElement
- Overrides:
getDeclaredAnnotations
in classMethodInfo
-
isAnnotationPresent
- Specified by:
isAnnotationPresent
in interfaceAnnotatedElement
- Overrides:
isAnnotationPresent
in classMethodInfo
-
isGenericMethod
public boolean isGenericMethod()- Overrides:
isGenericMethod
in classMethodInfo
-
isGenericMethodDefinition
public boolean isGenericMethodDefinition()- Overrides:
isGenericMethodDefinition
in classMethodInfo
-
getGenericMethodParameters
- Overrides:
getGenericMethodParameters
in classMethodInfo
-
getErasedMethodDefinition
- Overrides:
getErasedMethodDefinition
in classMethodInfo
-
appendDescription
- Overrides:
appendDescription
in classMethodInfo
-
appendSimpleDescription
- Overrides:
appendSimpleDescription
in classMethodInfo
-
appendErasedSignature
- Overrides:
appendErasedSignature
in classMethodInfo
-
appendSignature
- Overrides:
appendSignature
in classMethodInfo
-
defineGenericParameters
-
defineParameter
-
createMethodBody
public void createMethodBody(byte[] bytecode, int size) -
getBody
byte[] getBody() -
getExceptionInstances
__ExceptionInstance[] getExceptionInstances() -
getNumberOfExceptions
int getNumberOfExceptions() -
createMethodBodyHelper
-
calculateNumberOfExceptions
-
releaseBakedStructures
void releaseBakedStructures()
-