The default implementation of the ObjectWrapper interface. @version $Id: DefaultObjectWrapper.java,v 1.23 2005/06/08 00:06:19 revusky Exp $
6970717273747576777879
{ parser.parse(new InputSource (new FileReader (getSchemaFile()))); Configuration cfg = new Configuration (); cfg.setDirectoryForTemplateLoading(new File (getTemplateDirectory ())); cfg.setStrictSyntaxMode(true); cfg.setObjectWrapper(new DefaultObjectWrapper ()); Map<String, String> workset = new HashMap<String, String> (); workset.put ("valueObject.ftl", "valueObject"); workset.put ("interface.ftl", "interface"); workset.put ("interfaceAsync.ftl", "interface");
949596979899100
} } loaders.add(new ClassTemplateLoader(loaderConfig.getLoaderClass(), loaderConfig.getBasePath())); config = new Configuration(); config.setTemplateLoader(new MultiTemplateLoader(loaders.toArray(new TemplateLoader[0]))); config.setObjectWrapper(new DefaultObjectWrapper()); }
208209210211212213214215216217218
log("\t" + key + " - " + data.get(key)); } } try { Configuration cfg = new Configuration(); cfg.setObjectWrapper( new DefaultObjectWrapper() ); cfg.setTemplateUpdateDelay( 0 ); Template temp = new Template( name, new InputStreamReader( GuvnorJRClusterConfigAntTask.class.getResourceAsStream( "/jrcluster/templates/repository/" + name ) ), cfg );
724725726727728729730731732733734
*/ public String processTemplate(String name, Map<String, Object> data) { try { Configuration configuration = new Configuration(); configuration.setObjectWrapper( new DefaultObjectWrapper() ); configuration.setTemplateUpdateDelay( 0 ); Template template = new Template( name, new InputStreamReader( ServiceImplementation.class.getResourceAsStream( "/repoconfig/" + name + ".xml" ) ), configuration );
801802803804805806807808809810811
727728729730731732733734735736737
*/ public String processTemplate(String name, Map<String, Object> data) { try { Configuration cfg = new Configuration(); cfg.setObjectWrapper( new DefaultObjectWrapper() ); cfg.setTemplateUpdateDelay( 0 ); Template temp = new Template( name, new InputStreamReader( ServiceImplementation.class.getResourceAsStream( "/repoconfig/" + name + ".xml" ) ), cfg );
26672668266926702671267226732674267526762677
* Load and process the repository configuration templates. */ public String processTemplate(String name, Map<String, Object> data) { try { Configuration cfg = new Configuration(); cfg.setObjectWrapper( new DefaultObjectWrapper() ); cfg.setTemplateUpdateDelay( 0 ); Template temp = new Template( name, new InputStreamReader( ServiceImplementation.class.getResourceAsStream( "/repoconfig/" + name + ".xml" ) ), cfg ); StringWriter strw = new StringWriter(); temp.process( data, strw );
35363738394041424344
*/ private TemplateFactory() { this.cfg = new Configuration(); this.cfg.setClassForTemplateLoading(Main.class, "templates"); this.cfg.setObjectWrapper(new DefaultObjectWrapper()); this.cfg.setDefaultEncoding("UTF-8"); this.cfg.setSharedVariable("message", new MessageDirective()); this.cfg.setTagSyntax(Configuration.SQUARE_BRACKET_TAG_SYNTAX); }
5455565758596061626364
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { final TypeElement element = processingEnv.getElementUtils().getTypeElement(Entity.class.getName()); if (annotations.contains(element)) { try { Configuration cfg = new Configuration(); cfg.setObjectWrapper(new DefaultObjectWrapper()); cfg.setTemplateLoader(new ClassTemplateLoader(getClass(), "/templates")); Template template = cfg.getTemplate("criteria.ftl"); for (TypeElement typeElement : ElementFilter.typesIn(roundEnv.getElementsAnnotatedWith(Entity.class))) { generate(template, typeElement); }
125126127128129130131132133134135
@Command("new-view") public void newView(final PipeOut out, @Option(name = "target") final Resource<?> target) { Configuration freemarkerConfig = new Configuration(); freemarkerConfig.setClassForTemplateLoading(getClass(), "/"); freemarkerConfig.setObjectWrapper(new DefaultObjectWrapper()); Map<Object, Object> map = new HashMap<Object, Object>(); Writer output = new StringWriter(); try {