private static void handleXmlElement ( Outline outline , Set < String > directClasses , JAnnotationValue type ) { StringWriter sw = new StringWriter ( ) ; JFormatter jf = new JFormatter ( new PrintWriter ( sw ) ) ; type . generate ( jf ) ; String s = sw . toString ( ) ; s = s . substring ( 0 , s . length ( ) - ".class" . length ( ) ) ; if ( ! s . startsWith ( "java" ) && outline . getCodeModel ( ) . _getClass ( s ) == null && ! foundWithinOutline ( s , outline ) ) { directClasses . add ( s ) ; } }
Handles the extraction of the schema type from the XmlElement annotation . This was surprisingly difficult . Apparently the model doesn t provide access to the annotation we re referring to so I need to print it and read the string back . Even the formatter itself is final!