protected void build ( XMLNode node , Content contentTree ) throws DocletException { String component = node . name ; try { String methodName = "build" + component ; if ( DEBUG ) { configuration . reporter . print ( ERROR , "DEBUG: " + getClass ( ) . getName ( ) + "." + methodName ) ; } Method method = getClass ( ) . getMethod ( methodName , XMLNode . class , Content . class ) ; method . invoke ( this , node , contentTree ) ; } catch ( NoSuchMethodException e ) { // Use SimpleDocletException instead of InternalException because there is nothing // informative about about the place the exception occurred, here in this method. // The problem is either a misconfigured doclet.xml file or a missing method in the // user-supplied(?) doclet String message = resources . getText ( "doclet.builder.unknown.component" , component ) ; throw new SimpleDocletException ( message , e ) ; } catch ( InvocationTargetException e ) { Throwable cause = e . getCause ( ) ; if ( cause instanceof DocletException ) { throw ( DocletException ) cause ; } else if ( cause instanceof UncheckedDocletException ) { throw ( DocletException ) cause . getCause ( ) ; } else { // use InternalException, so that a stacktrace showing the position of // the internal exception is generated String message = resources . getText ( "doclet.builder.exception.in.component" , component , e . getCause ( ) ) ; throw new InternalException ( message , e . getCause ( ) ) ; } } catch ( ReflectiveOperationException e ) { // Use SimpleDocletException instead of InternalException because there is nothing // informative about about the place the exception occurred, here in this method. // The problem is specific to the method being invoked, such as illegal access // or illegal argument. String message = resources . getText ( "doclet.builder.exception.in.component" , component , e ) ; throw new SimpleDocletException ( message , e . getCause ( ) ) ; } }
Build the documentation as specified by the given XML element .