protected Accessor [ ] createAccessors ( ) { Field [ ] fields = getClass ( ) . getFields ( ) ; // assume we have one static field for every non-static field List < Accessor > accs = Lists . newArrayListWithExpectedSize ( fields . length / 2 ) ; for ( Field field : fields ) { if ( ! Modifier . isStatic ( field . getModifiers ( ) ) ) { // skip static fields accs . add ( new Accessor . ByField ( field ) ) ; } } return accs . toArray ( new Accessor [ accs . size ( ) ] ) ; }
Creates the accessors that will be used to read and write this object s attributes . The default implementation assumes the object s attributes are all public fields and uses reflection to get and set their values .