@ Override public void controllerParsed ( File source , ControllerModel < Raml > model ) throws WatchingException { Raml raml = new Raml ( ) ; //Create a new raml file raml . setBaseUri ( baseUri ) ; //set the base uri raml . setVersion ( project ( ) . getVersion ( ) ) ; //Visit the controller model to populate the raml model model . accept ( controllerVisitor , raml ) ; getLog ( ) . info ( "Create raml file for controller " + raml . getTitle ( ) ) ; try { //create the file File output = getRamlOutputFile ( source ) ; FileUtils . write ( output , ramlEmitter . dump ( raml ) ) ; getLog ( ) . info ( "Created the RAML description for " + source . getName ( ) + " => " + output . getAbsolutePath ( ) ) ; } catch ( IOException ie ) { throw new WatchingException ( "Cannot create raml file" , source , ie ) ; } catch ( IllegalArgumentException e ) { throw new WatchingException ( "Cannot create Controller Element from" , e ) ; } }
Generate the raml file from a given controller source file .