public void setPreviousElement ( String element , String value ) throws NoSuchFieldException , SecurityException , IllegalArgumentException , IllegalAccessException , InstantiationException , ClassNotFoundException , NoSuchMethodException , InvocationTargetException { Reflections reflections = new Reflections ( "com.stratio" ) ; Set classes = reflections . getSubTypesOf ( CommonG . class ) ; Object pp = ( classes . toArray ( ) ) [ 0 ] ; String qq = ( pp . toString ( ) . split ( " " ) ) [ 1 ] ; Class < ? > c = Class . forName ( qq . toString ( ) ) ; Field ff = c . getDeclaredField ( element ) ; ff . setAccessible ( true ) ; ff . set ( null , value ) ; }
Saves the value in the attribute in class extending CommonG .