Class AnnotatedWithParams
- java.lang.Object
-
- org.codehaus.jackson.map.introspect.Annotated
-
- org.codehaus.jackson.map.introspect.AnnotatedMember
-
- org.codehaus.jackson.map.introspect.AnnotatedWithParams
-
- Direct Known Subclasses:
AnnotatedConstructor
,AnnotatedMethod
public abstract class AnnotatedWithParams extends AnnotatedMember
Intermediate base class that encapsulates features that constructors and methods share.
-
-
Field Summary
Fields Modifier and Type Field Description protected AnnotationMap[]
_paramAnnotations
Annotations associated with parameters of the annotated entity (method or constructor parameters)-
Fields inherited from class org.codehaus.jackson.map.introspect.AnnotatedMember
_annotations
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AnnotatedWithParams(AnnotationMap annotations, AnnotationMap[] paramAnnotations)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addIfNotPresent(java.lang.annotation.Annotation a)
Method called to augment annotations, by adding specified annotation if and only if it is not yet present in the annotation map we have.void
addOrOverride(java.lang.annotation.Annotation a)
Method called to override a class annotation, usually due to a mix-in annotation masking or overriding an annotation 'real' classvoid
addOrOverrideParam(int paramIndex, java.lang.annotation.Annotation a)
Method called to override a method parameter annotation, usually due to a mix-in annotation masking or overriding an annotation 'real' method has.abstract java.lang.Object
call()
Method that can be used to (try to) call this object without arguments.abstract java.lang.Object
call(java.lang.Object[] args)
Method that can be used to (try to) call this object with specified arguments.abstract java.lang.Object
call1(java.lang.Object arg)
Method that can be used to (try to) call this object with single arguments.<A extends java.lang.annotation.Annotation>
AgetAnnotation(java.lang.Class<A> acls)
int
getAnnotationCount()
AnnotatedParameter
getParameter(int index)
AnnotationMap
getParameterAnnotations(int index)
abstract java.lang.Class<?>
getParameterClass(int index)
abstract int
getParameterCount()
abstract java.lang.reflect.Type
getParameterType(int index)
protected JavaType
getType(TypeBindings bindings, java.lang.reflect.TypeVariable<?>[] typeParams)
protected AnnotatedParameter
replaceParameterAnnotations(int index, AnnotationMap ann)
Method called by parameter object when an augmented instance is created; needs to replace parameter with new instanceJavaType
resolveParameterType(int index, TypeBindings bindings)
Method called to fully resolve type of one of parameters, given specified type variable bindings.-
Methods inherited from class org.codehaus.jackson.map.introspect.AnnotatedMember
fixAccess, getAllAnnotations, getDeclaringClass, getMember, setValue
-
Methods inherited from class org.codehaus.jackson.map.introspect.Annotated
getAnnotated, getGenericType, getModifiers, getName, getRawType, getType, hasAnnotation, isPublic, withAnnotations, withFallBackAnnotationsFrom
-
-
-
-
Field Detail
-
_paramAnnotations
protected final AnnotationMap[] _paramAnnotations
Annotations associated with parameters of the annotated entity (method or constructor parameters)
-
-
Constructor Detail
-
AnnotatedWithParams
protected AnnotatedWithParams(AnnotationMap annotations, AnnotationMap[] paramAnnotations)
-
-
Method Detail
-
addOrOverride
public final void addOrOverride(java.lang.annotation.Annotation a)
Method called to override a class annotation, usually due to a mix-in annotation masking or overriding an annotation 'real' class
-
addOrOverrideParam
public final void addOrOverrideParam(int paramIndex, java.lang.annotation.Annotation a)
Method called to override a method parameter annotation, usually due to a mix-in annotation masking or overriding an annotation 'real' method has.
-
addIfNotPresent
public final void addIfNotPresent(java.lang.annotation.Annotation a)
Method called to augment annotations, by adding specified annotation if and only if it is not yet present in the annotation map we have.
-
replaceParameterAnnotations
protected AnnotatedParameter replaceParameterAnnotations(int index, AnnotationMap ann)
Method called by parameter object when an augmented instance is created; needs to replace parameter with new instance- Since:
- 1.9
-
getType
protected JavaType getType(TypeBindings bindings, java.lang.reflect.TypeVariable<?>[] typeParams)
-
getAnnotation
public final <A extends java.lang.annotation.Annotation> A getAnnotation(java.lang.Class<A> acls)
- Specified by:
getAnnotation
in classAnnotated
-
getParameterAnnotations
public final AnnotationMap getParameterAnnotations(int index)
-
getParameter
public final AnnotatedParameter getParameter(int index)
-
getParameterCount
public abstract int getParameterCount()
-
getParameterClass
public abstract java.lang.Class<?> getParameterClass(int index)
-
getParameterType
public abstract java.lang.reflect.Type getParameterType(int index)
-
resolveParameterType
public final JavaType resolveParameterType(int index, TypeBindings bindings)
Method called to fully resolve type of one of parameters, given specified type variable bindings.- Since:
- 1.8
-
getAnnotationCount
public final int getAnnotationCount()
-
call
public abstract java.lang.Object call() throws java.lang.Exception
Method that can be used to (try to) call this object without arguments. This may succeed or fail, depending on expected number of arguments: caller needs to take care to pass correct number. Exceptions are thrown directly from actual low-level call.Note: only works for constructors and static methods.
- Throws:
java.lang.Exception
- Since:
- 1.9
-
call
public abstract java.lang.Object call(java.lang.Object[] args) throws java.lang.Exception
Method that can be used to (try to) call this object with specified arguments. This may succeed or fail, depending on expected number of arguments: caller needs to take care to pass correct number. Exceptions are thrown directly from actual low-level call.Note: only works for constructors and static methods.
- Throws:
java.lang.Exception
- Since:
- 1.9
-
call1
public abstract java.lang.Object call1(java.lang.Object arg) throws java.lang.Exception
Method that can be used to (try to) call this object with single arguments. This may succeed or fail, depending on expected number of arguments: caller needs to take care to pass correct number. Exceptions are thrown directly from actual low-level call.Note: only works for constructors and static methods.
- Throws:
java.lang.Exception
- Since:
- 1.9
-
-