Class Accessor


  • public class Accessor
    extends java.lang.Object
    Contains all information needed to access a java field.

    field, getter setter

    this object is used internally by BeansAccess

    See Also:
    BeansAccess
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.reflect.Field field
      Field to access
      protected java.lang.String fieldName
      The name of the field.
      protected java.lang.reflect.Type genericType
      Filed Type using JDK 5+ generics if available
      protected java.lang.reflect.Method getter
      getter Methods if available
      protected int index
      Filed index in object
      protected java.lang.reflect.Method setter
      Setter Methods if available
      protected java.lang.Class<?> type
      Filed Class
    • Constructor Summary

      Constructors 
      Constructor Description
      Accessor​(java.lang.Class<?> c, java.lang.reflect.Field field, FieldFilter filter)
      build accessor for a field
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.reflect.Type getGenericType()
      return generics field Type.
      int getIndex()
      getter for index
      java.lang.String getName()
      return the field name
      java.lang.Class<?> getType()
      return field Class
      boolean isEnum()
      is the field is an enum field
      boolean isPublic()
      is the field access using Field access type
      boolean isReadable()
      Checks if the field is readable, either directly or through a getter method.
      boolean isUsable()
      Determines if the field is accessible for reading or writing operations.
      boolean isWritable()
      Determines if the field is writable, either directly or through a setter method.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • field

        protected java.lang.reflect.Field field
        Field to access
      • setter

        protected java.lang.reflect.Method setter
        Setter Methods if available
      • getter

        protected java.lang.reflect.Method getter
        getter Methods if available
      • index

        protected int index
        Filed index in object
      • type

        protected java.lang.Class<?> type
        Filed Class
      • genericType

        protected java.lang.reflect.Type genericType
        Filed Type using JDK 5+ generics if available
      • fieldName

        protected java.lang.String fieldName
        The name of the field.
    • Constructor Detail

      • Accessor

        public Accessor​(java.lang.Class<?> c,
                        java.lang.reflect.Field field,
                        FieldFilter filter)
        build accessor for a field
        Parameters:
        c - the handled class
        field - the field to access
        filter - field filter
    • Method Detail

      • getIndex

        public int getIndex()
        getter for index
        Returns:
        Index
      • isPublic

        public boolean isPublic()
        is the field access using Field access type
        Returns:
        if Accessor is public
      • isEnum

        public boolean isEnum()
        is the field is an enum field
        Returns:
        if Accessor return an Enum Class
      • getName

        public java.lang.String getName()
        return the field name
        Returns:
        the field name
      • getType

        public java.lang.Class<?> getType()
        return field Class
        Returns:
        field Class
      • getGenericType

        public java.lang.reflect.Type getGenericType()
        return generics field Type.
        Returns:
        generics field Type.
      • isUsable

        public boolean isUsable()
        Determines if the field is accessible for reading or writing operations.
        Returns:
        true if the field can be read or write
      • isReadable

        public boolean isReadable()
        Checks if the field is readable, either directly or through a getter method.
        Returns:
        true if the field can be read
      • isWritable

        public boolean isWritable()
        Determines if the field is writable, either directly or through a setter method.
        Returns:
        true if the field can be write