private Object doGetProperty(String property) { Closure[] accessors = resolveExplicitProperty(property); if (accessors != null) { if (accessors[0] == null) { // write only property throw new MissingPropertyException(property + " is declared as write only"); } else { return accessors[0].call(); } } else { return super.getProperty(property); } }
/** * Retrieve a script as defined in the shell context. This allows for multi-line scripts to be submitted. */ public static String getScript(final String submittedScript, final Groovysh shell) { return submittedScript.startsWith("@") ? shell.getInterp().getContext().getProperty(submittedScript.substring(1)).toString() : submittedScript; } }
private Object doGetProperty(String property) { Closure[] accessors = resolveExplicitProperty(property); if (accessors != null) { if (accessors[0] == null) { // write only property throw new MissingPropertyException(property + " is declared as write only"); } else { return accessors[0].call(); } } else { return super.getProperty(property); } }
private Object doGetProperty(String property) { Closure[] accessors = resolveExplicitProperty(property); if (accessors != null) { if (accessors[0] == null) { // write only property throw new MissingPropertyException(property + " is declared as write only"); } else { return accessors[0].call(); } } else { return super.getProperty(property); } }
private Object doGetProperty(String property) { Closure[] accessors = resolveExplicitProperty(property); if (accessors != null) { if (accessors[0] == null) { // write only property throw new MissingPropertyException(property + " is declared as write only"); } else { return accessors[0].call(); } } else { return super.getProperty(property); } }
@Override public void setBinding(Binding binding) { super.setBinding(binding); setDelegate(binding.getProperty("delegate")); }