public Object getProperty(String property) { if ("method".equals(property)) { return getMethod(); } else return super.getProperty(property); } }
public Object getProperty(String property) { try { return super.getProperty(property); } catch (MissingPropertyException e) { PipeLineClosure sub = _sub(property); if (sub != null) { return sub; } else { throw e; } } }
@Override public Object getProperty(String property) { return this.target.getProperty(property); }
public Object getProperty(String property) { return Closure.this.getProperty(property); }
public Object getProperty(String property) { return Closure.this.getProperty(property); }
public Object getProperty(String property) { return Closure.this.getProperty(property); }
public Object getProperty(String property) { if ("method".equals(property)) { return getMethod(); } else return super.getProperty(property); } }
public Object getProperty(String property) { if ("method".equals(property)) { return getMethod(); } else return super.getProperty(property); } }
public Object getProperty(String property) { if ("method".equals(property)) { return getMethod(); } else return super.getProperty(property); } }
public Object getProperty(String property) { if ("method".equals(property)) { return getMethod(); } else return super.getProperty(property); } }
public Object getProperty(String property) { try { return super.getProperty(property); } catch (MissingPropertyException e) { PipeLineClosure sub = _sub(property); if (sub != null) { return sub; } else { throw e; } } }
public Object getProperty(String property) { try { return super.getProperty(property); } catch (MissingPropertyException e) { PipeLineClosure sub = _sub(property); if (sub != null) { return sub; } else { throw e; } } }
public static String toString(Closure closure) { PrintWriter oldWriter = (PrintWriter) closure.getProperty("out"); StringWriter newWriter = new StringWriter(); closure.setProperty("out", new PrintWriter(newWriter)); closure.call(); closure.setProperty("out", oldWriter); return newWriter.toString(); }
public static void _set(Map<?, ?> args, Closure body, PrintWriter out, ExecutableTemplate template, int fromLine) { // Simple case : #{set title:'Yop' /} for (Map.Entry<?, ?> entry : args.entrySet()) { Object key = entry.getKey(); if (!key.toString().equals("arg")) { BaseTemplate.layoutData.get().put( key, (entry.getValue() != null && entry.getValue() instanceof String) ? __safe(template.template, entry.getValue()) : entry.getValue()); return; } } // Body case Object name = args.get("arg"); if (name != null && body != null) { Object oldOut = body.getProperty("out"); StringWriter sw = new StringWriter(); body.setProperty("out", new PrintWriter(sw)); body.call(); BaseTemplate.layoutData.get().put(name, sw.toString()); body.setProperty("out", oldOut); } }
public static String toString(String name, Closure<?> closure, Map<String, Object> groovyVariablesBound) { // boolean enabled = log.isInfoEnabled(); // if(enabled) { // int count = closureDepth.get().incrementAndGet(); // String tabs = generate(count); // if(groovyVariablesBound == null) // groovyVariablesBound = new HashMap<>(); // log.info(tabs+"closure '"+name+"' nestLevel="+count+" {"); // for(Entry<String, Object> entry : groovyVariablesBound.entrySet()) { // log.info(tabs+" "+entry.getKey()+"="+entry.getValue()); // } // } PrintWriter oldWriter = (PrintWriter) closure.getProperty(GroovyTemplateSuperclass.OUT_PROPERTY_NAME); StringWriter newWriter = new StringWriter(); closure.setProperty(GroovyTemplateSuperclass.OUT_PROPERTY_NAME, new PrintWriter(newWriter)); closure.call(); closure.setProperty(GroovyTemplateSuperclass.OUT_PROPERTY_NAME, oldWriter); // // if(enabled) { // int count = closureDepth.get().getAndDecrement(); // String tabs = generate(count); // log.info(tabs+"} // end "+name); // // } return newWriter.toString(); }
field.put("errorClass", field.get("error") != null ? "hasError" : ""); String[] pieces = _arg.split("\\."); Object obj = body.getProperty(pieces[0]); if (obj != null) { if (pieces.length > 1) {
private Closure<?> cloneClosure(final List<String> columnNames, final List<Comparable> values) { Closure<?> result = closureTemplate.rehydrate(new Expando(), null, null); result.setResolveStrategy(Closure.DELEGATE_ONLY); result.setProperty("log", closureTemplate.getProperty("log")); for (int i = 0; i < values.size(); i++) { result.setProperty(columnNames.get(i), new ShardingValueWrapper(values.get(i))); } return result; } }