wro4j-extensions/src/main/java/ro/isdc/wro/extensions/model/factory/GroovyModelFactory.java
@Override
  public WroModel create() {
    final StopWatch stopWatch = new StopWatch("Create Wro Model from Groovy");
    final Script script;
    try {
      stopWatch.start("parseStream");
      script = new GroovyShell().parse(new InputStreamReader(new AutoCloseInputStream(getModelResourceAsStream())));
      LOG.debug("Parsing groovy script to build the model");
      stopWatch.stop();

      stopWatch.start("parseScript");
      final WroModel model = GroovyModelParser.parse(script);
      stopWatch.stop();
      LOG.debug("groovy model: {}", model);
      if (model == null) {
        throw new WroRuntimeException("Invalid content provided, cannot build model!");
      }
      return model;
    } catch (final IOException e) {
      throw new WroRuntimeException("Invalid model found!", e);
    } finally {
      LOG.debug(stopWatch.prettyPrint());
    }
  }
@Override
  public WroModel create() {
    final StopWatch stopWatch = new StopWatch("Create Wro Model from Groovy");
    final Script script;
    try {
      stopWatch.start("parseStream");
      script = new GroovyShell().parse(new InputStreamReader(new AutoCloseInputStream(getModelResourceAsStream())));
      LOG.debug("Parsing groovy script to build the model");
      stopWatch.stop();

      stopWatch.start("parseScript");
      final WroModel model = GroovyModelParser.parse(script);
      stopWatch.stop();
      LOG.debug("groovy model: {}", model);
      if (model == null) {
        throw new WroRuntimeException("Invalid content provided, cannot build model!");
      }
      return model;
    } catch (final IOException e) {
      throw new WroRuntimeException("Invalid model found!", e);
    } finally {
      LOG.debug(stopWatch.prettyPrint());
    }
  }
@ Override public WroModel create ( ) { final StopWatch stopWatch = new StopWatch ( "Create Wro Model from Groovy" ) ; final Script script ; try { stopWatch . start ( "parseStream" ) ; script = new GroovyShell ( ) . parse ( new InputStreamReader ( new AutoCloseInputStream ( getModelResourceAsStream ( ) ) ) ) ; LOG . debug ( "Parsing groovy script to build the model" ) ; stopWatch . stop ( ) ; stopWatch . start ( "parseScript" ) ; final WroModel model = GroovyModelParser . parse ( script ) ; stopWatch . stop ( ) ; LOG . debug ( "groovy model: {}" , model ) ; if ( model == null ) { throw new WroRuntimeException ( "Invalid content provided, cannot build model!" ) ; } return model ; } catch ( final IOException e ) { throw new WroRuntimeException ( "Invalid model found!" , e ) ; } finally { LOG . debug ( stopWatch . prettyPrint ( ) ) ; } }
{@inheritDoc}
{