/** * Processes the specified template with the given model. * * @param templateURL The template URL. * @param model The root model. */ public void processTemplate(URL templateURL, Object model) throws IOException, TemplateException { processTemplate(templateURL, model, System.out); }
@Override public void close() throws EnunciateException { super.close(); this.model = null; }
@Override public void initModel(EnunciateFreemarkerModel model) { super.initModel(model); if (!isDisabled()) { if (!gwtRtFound && !isGenerateJsonOverlays()) { info("GWT runtime wasn't found on the classpath. If you're doing GWT-RPC, you're going to fail at runtime."); } } }
@Override public void initModel(EnunciateFreemarkerModel model) { super.initModel(model); if (!isDisabled()) { if (!amfRtFound) { warn("WARNING! The AMF module is enabled, but the Enunciate AMF runtime libraries were found on the Enunciate classpath. " + "Application startup will fail unless the Enunciate AMF runtime libraries are on the classpath."); } } }
/** * Calls the step methods as necessary. * * @param target The step. */ public void step(Enunciate.Target target) throws EnunciateException, IOException { switch (target) { case GENERATE: doGenerate(); break; case BUILD: doBuild(); break; case COMPILE: doCompile(); break; case PACKAGE: doPackage(); break; } }
public void loadMavenConfiguration() throws IOException { for (DeploymentModule module : getConfig().getAllModules()) { if (!module.isDisabled()) { if (gwtHome != null && (module instanceof GWTHomeAwareModule)) { ((GWTHomeAwareModule) module).setGwtHome(gwtHome); } else if (flexHome != null && (module instanceof FlexHomeAwareModule)) { ((FlexHomeAwareModule) module).setFlexHome(flexHome); } } } }
/** * Initialize each module. * * @param deploymentModules The deployment modules. */ protected void initModules(List<DeploymentModule> deploymentModules) throws EnunciateException, IOException { info("\n\nInitializing Enunciate mechanism."); for (DeploymentModule deploymentModule : deploymentModules) { debug("Initializing module %s.", deploymentModule.getName()); deploymentModule.init(this); } }
/** * Get the freemarker configuration. * * @return the freemarker configuration. */ protected Configuration getConfiguration() { Configuration configuration = new Configuration(); configuration.setTemplateLoader(getTemplateLoader()); configuration.setTemplateExceptionHandler(getTemplateExceptionHandler()); configuration.setLocalizedLookup(false); return configuration; }
@Override public File getBuildDir() { File buildDir = null; WebAppConfig webAppConfig = getWebAppConfig(); if (webAppConfig != null && webAppConfig.getDir() != null) { buildDir = getEnunciate().resolvePath(webAppConfig.getDir()); buildDir.mkdirs(); } return buildDir == null ? super.getBuildDir() : buildDir; } }
/** * Handle an info-level message. * * @param message The info message. * @param formatArgs The format args of the message. */ public void info(String message, Object... formatArgs) { if (this.enunciate != null) { this.enunciate.info('[' + getName() + "] " + message, formatArgs); } }
/** * Processes the template. Declared final because we don't ever want to do more than process * the template so it can be safe to call the processTemplate() method directly (e.g. in the * {@link org.codehaus.enunciate.apt.EnunciateAnnotationProcessor}). */ @Override protected final void doGenerate() throws EnunciateException, IOException { try { doFreemarkerGenerate(); } catch (TemplateException e) { throw new EnunciateException(e); } }
@Override public boolean isDisabled() { return getWebAppConfig() != null && getWebAppConfig().isDisabled(); }
/** * Calls the step methods as necessary. * * @param target The step. */ public void step(Enunciate.Target target) throws EnunciateException, IOException { switch (target) { case GENERATE: doGenerate(); break; case BUILD: doBuild(); break; case COMPILE: doCompile(); break; case PACKAGE: doPackage(); break; } }
/** * Get the freemarker configuration. * * @return the freemarker configuration. */ protected Configuration getConfiguration() { Configuration configuration = new Configuration(); configuration.setTemplateLoader(getTemplateLoader()); configuration.setTemplateExceptionHandler(getTemplateExceptionHandler()); configuration.setLocalizedLookup(false); return configuration; }
/** * Processes the specified template with the given model. * * @param template The template. * @param model The root model. */ public void processTemplate(Template template, Object model) throws TemplateException, IOException { processTemplate(template, model, System.out); }
/** * Handle a warn-level message. * * @param message The warn message. * @param formatArgs The format args of the message. */ public void warn(String message, Object... formatArgs) { if (this.enunciate != null) { this.enunciate.warn('[' + getName() + "] " + message, formatArgs); } }
/** * Processes the template. Declared final because we don't ever want to do more than process * the template so it can be safe to call the processTemplate() method directly (e.g. in the * {@link org.codehaus.enunciate.apt.EnunciateAnnotationProcessor}). */ @Override protected final void doGenerate() throws EnunciateException, IOException { try { doFreemarkerGenerate(); } catch (TemplateException e) { throw new EnunciateException(e); } }
/** * Processes the specified template with the given model. * * @param templateURL The template URL. * @param model The root model. */ public void processTemplate(URL templateURL, Object model) throws IOException, TemplateException { processTemplate(templateURL, model, System.out); }
/** * Handle a debug-level message. * * @param message The debug message. * @param formatArgs The format args of the message. */ public void debug(String message, Object... formatArgs) { if (this.enunciate != null) { this.enunciate.debug('[' + getName() + "] " + message, formatArgs); } }
/** * Processes the specified template with the given model. * * @param template The template. * @param model The root model. */ public void processTemplate(Template template, Object model) throws TemplateException, IOException { processTemplate(template, model, System.out); }