Code example for Field

Methods: get, getDeclaringClass, getName

0
 
    @Override 
    public int getModifiers() { return _field.getModifiers(); }
 
    @Override 
    public String getName() { return _field.getName(); }
 
    @Override 
    public <A extends Annotation> A getAnnotation(Class<A> acls)
    { 
        return _annotations.get(acls);
    } 
 
    @Override 
    public Type getGenericType() {
        return _field.getGenericType();
    } 
 
    @Override 
    public Class<?> getRawType() {
        return _field.getType();
    } 
     
    /* 
    /********************************************************** 
    /* AnnotatedMember impl 
    /********************************************************** 
     */ 
 
    @Override 
    public Class<?> getDeclaringClass() { return _field.getDeclaringClass(); }
 
    @Override 
    public Member getMember() { return _field; }
 
    @Override 
    public void setValue(Object pojo, Object value) throws IllegalArgumentException
    { 
        try { 
            _field.set(pojo, value);
        } catch (IllegalAccessException e) {
            throw new IllegalArgumentException("Failed to setValue() for field "
                    +getFullName()+": "+e.getMessage(), e);
        } 
    } 
 
    @Override 
    public Object getValue(Object pojo) throws IllegalArgumentException
    { 
        try { 
            return _field.get(pojo);
        } catch (IllegalAccessException e) {
            throw new IllegalArgumentException("Failed to getValue() for field "
                    +getFullName()+": "+e.getMessage(), e);
        } 
    }