public static < T > Optional < Class < T > > getElementValueClass ( AnnotationMirror anno , CharSequence name , boolean useDefaults ) { Name cn = getElementValueClassName ( anno , name , useDefaults ) ; try { Class < ? > cls = Class . forName ( cn . toString ( ) ) ; return Optional . of ( ( Class < T > ) cls ) ; } catch ( ClassNotFoundException e ) { return Optional . empty ( ) ; } }
Get the Class that is referenced by attribute name . This method uses Class . forName to load the class . It returns null if the class wasn t found .