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 Objectprivate __ExceptionInstance[]private booleanprivate final intprivate final Stringprivate intprivate SignatureTypeprivate TypeList(package private) MethodInfo(package private) CodeGenerator(package private) GenericParameterBuilder<?>[](package private) ParameterBuilder[]Fields inherited from class 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 intcalculateNumberOfExceptions(__ExceptionInfo[] exceptions) voidcreateMethodBody(byte[] bytecode, int size) (package private) void(package private) ParameterListdefineGenericParameters(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[]intgetName()(package private) intType<?> Type<?> booleanisAnnotationPresent(Class<? extends Annotation> annotationClass) booleanbooleanbooleanboolean(package private) voidvoidsetDefaultValue(Object value) voidsetParameters(TypeList types) voidsetReturnType(Type<?> type) voidsetSignature(Type<?> returnType, TypeList parameterTypes) voidsetThrownTypes(TypeList types) (package private) void(package private) void(package private) voidMethods inherited from class MethodInfo
appendBriefDescription, appendErasedDescription, appendModifiers, containsGenericParameter, containsGenericParameters, emptyMethods, findBaseMethod, findOverriddenMethod, getGenericMethodDefinition, getMemberType, getTypeArguments, getTypeBindings, invoke, isAbstract, isDefault, isEquivalentTo, makeGenericMethod, makeGenericMethodMethods inherited from class MethodBase
getCallingConventionMethods inherited from class 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:
getNamein classMethodInfo
-
getReturnType
- Specified by:
getReturnTypein classMethodInfo
-
getSignatureType
- Specified by:
getSignatureTypein classMethodBase
-
getRawMethod
- Specified by:
getRawMethodin classMethodInfo
-
getDefaultValue
- Overrides:
getDefaultValuein classMethodInfo
-
setDefaultValue
-
getDeclaringType
- Specified by:
getDeclaringTypein classMemberInfo
-
getModifiers
public int getModifiers()- Specified by:
getModifiersin classMemberInfo
-
getParameters
- Overrides:
getParametersin classMethodBase
-
createParameters
ParameterList createParameters() -
getThrownTypes
- Overrides:
getThrownTypesin classMethodBase
-
getParameterTypes
-
getDefinedParameters
-
isTypeCreated
public boolean isTypeCreated() -
isFinished
public boolean isFinished() -
setReturnType
-
verifyCodeGeneratorNotCreated
void verifyCodeGeneratorNotCreated() -
setSignature
-
setParameters
-
setThrownTypes
-
getReflectedType
- Overrides:
getReflectedTypein classMemberInfo
-
addCustomAnnotation
-
getCustomAnnotations
-
getAnnotation
- Specified by:
getAnnotationin interfaceAnnotatedElement- Overrides:
getAnnotationin classMethodInfo
-
getAnnotations
- Specified by:
getAnnotationsin interfaceAnnotatedElement- Overrides:
getAnnotationsin classMethodInfo
-
getDeclaredAnnotations
- Specified by:
getDeclaredAnnotationsin interfaceAnnotatedElement- Overrides:
getDeclaredAnnotationsin classMethodInfo
-
isAnnotationPresent
- Specified by:
isAnnotationPresentin interfaceAnnotatedElement- Overrides:
isAnnotationPresentin classMethodInfo
-
isGenericMethod
public boolean isGenericMethod()- Overrides:
isGenericMethodin classMethodInfo
-
isGenericMethodDefinition
public boolean isGenericMethodDefinition()- Overrides:
isGenericMethodDefinitionin classMethodInfo
-
getGenericMethodParameters
- Overrides:
getGenericMethodParametersin classMethodInfo
-
getErasedMethodDefinition
- Overrides:
getErasedMethodDefinitionin classMethodInfo
-
appendDescription
- Overrides:
appendDescriptionin classMethodInfo
-
appendSimpleDescription
- Overrides:
appendSimpleDescriptionin classMethodInfo
-
appendErasedSignature
- Overrides:
appendErasedSignaturein classMethodInfo
-
appendSignature
- Overrides:
appendSignaturein 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()
-