congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Script.setMetaClass
Code IndexAdd Tabnine to your IDE (free)

How to use
setMetaClass
method
in
groovy.lang.Script

Best Java code snippets using groovy.lang.Script.setMetaClass (Showing top 20 results out of 315)

origin: org.codehaus.groovy/groovy

public void setProperty(String property, Object newValue) {
  if ("binding".equals(property))
    setBinding((Binding) newValue);
  else if("metaClass".equals(property))
    setMetaClass((MetaClass)newValue);
  else
    binding.setVariable(property, newValue);
}
origin: org.codehaus.groovy/groovy

public Object build(Script script) {
  // this used to be synchronized, but we also used to remove the
  // metaclass.  Since adding the metaclass is now a side effect, we
  // don't need to ensure the meta-class won't be observed and don't
  // need to hide the side effect.
  MetaClass scriptMetaClass = script.getMetaClass();
  script.setMetaClass(new FactoryInterceptorMetaClass(scriptMetaClass, this));
  script.setBinding(this);
  Object oldScriptName = getProxyBuilder().getVariables().get(SCRIPT_CLASS_NAME);
  try {
    getProxyBuilder().setVariable(SCRIPT_CLASS_NAME, script.getClass().getName());
    return script.run();
  } finally {
    if(oldScriptName != null) {
      getProxyBuilder().setVariable(SCRIPT_CLASS_NAME, oldScriptName);
    } else {
      getProxyBuilder().getVariables().remove(SCRIPT_CLASS_NAME);
    }
  }
}
origin: apache/groovy

scriptObject.setMetaClass(new DelegatingMetaClass(oldMetaClass) {
  @Override
  public Object invokeMethod(Object object, String name, Object args) {
origin: apache/tinkerpop

scriptObject.setMetaClass(new DelegatingMetaClass(oldMetaClass) {
  @Override
  public Object invokeMethod(final Object object, final String name, final Object args) {
origin: org.codehaus.groovy/groovy-jsr223

scriptObject.setMetaClass(new DelegatingMetaClass(oldMetaClass) {
  @Override
  public Object invokeMethod(Object object, String name, Object args) {
origin: org.kohsuke.droovy/groovy

public void setProperty(String property, Object newValue) {
  if ("binding".equals(property))
    setBinding((Binding) newValue);
  else if("metaClass".equals(property))
    setMetaClass((MetaClass)newValue);
  else
    binding.setVariable(property, newValue);
}
origin: org.codehaus.groovy/groovy-jdk14

public void setProperty(String property, Object newValue) {
  if ("binding".equals(property))
    setBinding((Binding) newValue);
  else if("metaClass".equals(property))
    setMetaClass((MetaClass)newValue);
  else
    binding.setVariable(property, newValue);
}
origin: org.codehaus.groovy/groovy-all-minimal

public void setProperty(String property, Object newValue) {
  if ("binding".equals(property))
    setBinding((Binding) newValue);
  else if("metaClass".equals(property))
    setMetaClass((MetaClass)newValue);
  else
    binding.setVariable(property, newValue);
}
origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

public void setProperty(String property, Object newValue) {
  if ("binding".equals(property))
    setBinding((Binding) newValue);
  else if("metaClass".equals(property))
    setMetaClass((MetaClass)newValue);
  else
    binding.setVariable(property, newValue);
}
origin: org.codehaus.groovy/groovy-all-minimal

public Object build(Script script) {
  synchronized (script) {
    MetaClass scriptMetaClass = script.getMetaClass();
    try {
      script.setMetaClass(new FactoryInterceptorMetaClass(scriptMetaClass, this));
      script.setBinding(this);
      return script.run();
    } finally {
      script.setMetaClass(scriptMetaClass);
    }
  }
}
origin: org.codehaus.groovy/groovy-jdk14

public Object build(Script script) {
  // this used to be synchronized, but we also used to remove the
  // metaclass.  Since adding the metaclass is now a side effect, we
  // don't need to ensure the meta-class won't be observed and don't
  // need to hide the side effect.
  MetaClass scriptMetaClass = script.getMetaClass();
  script.setMetaClass(new FactoryInterceptorMetaClass(scriptMetaClass, this));
  script.setBinding(this);
  return script.run();
}
origin: org.kohsuke.droovy/groovy

public Object build(Script script) {
  // this used to be synchronized, but we also used to remove the
  // metaclass.  Since adding the metaclass is now a side effect, we
  // don't need to ensure the meta-class won't be observed and don't
  // need to hide the side effect.
  MetaClass scriptMetaClass = script.getMetaClass();
  script.setMetaClass(new FactoryInterceptorMetaClass(scriptMetaClass, this));
  script.setBinding(this);
  return script.run();
}
origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

public Object build(Script script) {
  // this used to be synchronized, but we also used to remove the
  // metaclass.  Since adding the metaclass is now a side effect, we
  // don't need to ensure the meta-class won't be observed and don't
  // need to hide the side effect.
  MetaClass scriptMetaClass = script.getMetaClass();
  script.setMetaClass(new FactoryInterceptorMetaClass(scriptMetaClass, this));
  script.setBinding(this);
  Object oldScriptName = getProxyBuilder().getVariables().get(SCRIPT_CLASS_NAME);
  try {
    getProxyBuilder().setVariable(SCRIPT_CLASS_NAME, script.getClass().getName());
    return script.run();
  } finally {
    if(oldScriptName != null) {
      getProxyBuilder().setVariable(SCRIPT_CLASS_NAME, oldScriptName);
    } else {
      getProxyBuilder().getVariables().remove(SCRIPT_CLASS_NAME);
    }
  }
}
origin: org.apache.tinkerpop/gremlin-groovy

scriptObject.setMetaClass(new DelegatingMetaClass(oldMetaClass) {
  @Override
  public Object invokeMethod(final Object object, final String name, final Object args) {
origin: org.scijava/scripting-groovy

scriptObject.setMetaClass(new DelegatingMetaClass(oldMetaClass) {
origin: com.tinkerpop/gremlin-groovy

scriptObject.setMetaClass(new DelegatingMetaClass(oldMetaClass) {
  @Override
  public Object invokeMethod(Object object, String name, Object args) {
origin: org.kohsuke.droovy/groovy

scriptObject.setMetaClass(new DelegatingMetaClass(oldMetaClass) {
      @Override
      public Object invokeMethod(Object object, String name, Object args) {
origin: org.codehaus.groovy/groovy-jdk14

scriptObject.setMetaClass(new DelegatingMetaClass(oldMetaClass) {
  @Override
  public Object invokeMethod(Object object, String name, Object args) {
origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

scriptObject.setMetaClass(new DelegatingMetaClass(oldMetaClass) {
  @Override
  public Object invokeMethod(Object object, String name, Object args) {
origin: zycgit/hasor

scriptObject.setMetaClass(new DelegatingMetaClass(oldMetaClass) {
  @Override
  public Object invokeMethod(Object object, String name, Object args) {
groovy.langScriptsetMetaClass

Popular methods of Script

  • run
    A helper method to allow scripts to be run taking command line arguments
  • setBinding
  • getProperty
  • getBinding
  • setProperty
  • invokeMethod
    Invoke a method (or closure in the binding) defined.
  • getMetaClass
  • evaluate
    A helper method to allow the dynamic evaluation of groovy expressions using this scripts binding as

Popular in Java

  • Reading from database using SQL prepared statement
  • getSystemService (Context)
  • onRequestPermissionsResult (Fragment)
  • getContentResolver (Context)
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • JButton (javax.swing)
  • JCheckBox (javax.swing)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now