static public Accessor [ ] getAccessors ( Class < ? > type , FieldFilter filter ) { Class < ? > nextClass = type ; HashMap < String , Accessor > map = new HashMap < String , Accessor > ( ) ; if ( filter == null ) filter = BasicFiledFilter . SINGLETON ; while ( nextClass != Object . class ) { Field [ ] declaredFields = nextClass . getDeclaredFields ( ) ; for ( Field field : declaredFields ) { String fn = field . getName ( ) ; if ( map . containsKey ( fn ) ) continue ; Accessor acc = new Accessor ( nextClass , field , filter ) ; if ( ! acc . isUsable ( ) ) continue ; map . put ( fn , acc ) ; } nextClass = nextClass . getSuperclass ( ) ; } return map . values ( ) . toArray ( new Accessor [ map . size ( ) ] ) ; }
Extract all Accessor for the field of the given class .