groovy.lang.Binding.getProperty()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(210)

本文整理了Java中groovy.lang.Binding.getProperty()方法的一些代码示例,展示了Binding.getProperty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Binding.getProperty()方法的具体详情如下:
包路径:groovy.lang.Binding
类名称:Binding
方法名:getProperty

Binding.getProperty介绍

[英]Overloaded to make variables appear as bean properties or via the subscript operator
[中]重载以使变量显示为bean属性或通过下标运算符

代码示例

代码示例来源:origin: org.codehaus.groovy/groovy

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);
  }
}

代码示例来源:origin: com.tinkerpop/gremlin-groovy

/**
   * 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;
  }
}

代码示例来源:origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

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);
  }
}

代码示例来源:origin: org.kohsuke.droovy/groovy

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);
  }
}

代码示例来源:origin: org.codehaus.groovy/groovy-jdk14

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);
  }
}

代码示例来源:origin: jenkinsci/acceptance-test-harness

@Override
public void setBinding(Binding binding) {
  super.setBinding(binding);
  setDelegate(binding.getProperty("delegate"));
}

相关文章