org.codehaus.jackson.map.introspect.AnnotatedMember Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ehcache Show documentation
Show all versions of ehcache Show documentation
Ehcache is an open source, standards-based cache used to boost performance,
offload the database and simplify scalability. Ehcache is robust, proven and full-featured and
this has made it the most widely-used Java-based cache.
package org.codehaus.jackson.map.introspect;
import java.lang.reflect.Member;
import org.codehaus.jackson.map.util.ClassUtil;
/**
* Intermediate base class for annotated entities that are members of
* a class; fields, methods and constructors. This is a superset
* of things that can represent logical properties as it contains
* constructors in addition to fields and methods.
*
* @author tatu
* @since 1.5
*/
public abstract class AnnotatedMember extends Annotated
{
protected final AnnotationMap _annotations;
protected AnnotatedMember(AnnotationMap annotations) {
super();
_annotations = annotations;
}
public abstract Class> getDeclaringClass();
public abstract Member getMember();
@Override
protected AnnotationMap getAllAnnotations() {
return _annotations;
}
/**
* Method that can be called to modify access rights, by calling
* {@link java.lang.reflect.AccessibleObject#setAccessible} on
* the underlying annotated element.
*/
public final void fixAccess() {
ClassUtil.checkAndFixAccess(getMember());
}
/**
* Optional method that can be used to assign value of
* this member on given object, if this is a supported
* operation for member type.
*
* This is implemented for fiedlds and single-argument
* methods; but not for constructor parameters or
* other types of methods.
*
* @since 1.9
*/
public abstract void setValue(Object pojo, Object value)
throws UnsupportedOperationException, IllegalArgumentException;
}