本文整理汇总了Java中org.codehaus.groovy.runtime.InvokerHelper.invokeMethodSafe方法的典型用法代码示例。如果您正苦于以下问题:Java InvokerHelper.invokeMethodSafe方法的具体用法?Java InvokerHelper.invokeMethodSafe怎么用?Java InvokerHelper.invokeMethodSafe使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.codehaus.groovy.runtime.InvokerHelper
的用法示例。
在下文中一共展示了InvokerHelper.invokeMethodSafe方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bind
import org.codehaus.groovy.runtime.InvokerHelper; //导入方法依赖的package包/类
public void bind() {
if (!bound) {
bound = true;
boundBean = bean;
boundProperty = propertyName;
try {
InvokerHelper.invokeMethodSafe(boundBean, "addPropertyChangeListener", new Object[]{boundProperty, this});
boundToProperty = true;
} catch (MissingMethodException mme) {
try {
boundToProperty = false;
InvokerHelper.invokeMethodSafe(boundBean, "addPropertyChangeListener", new Object[]{this});
} catch (MissingMethodException mme2) {
throw new RuntimeException("Properties in beans of type " + bean.getClass().getName() + " are not observable in any capacity (no PropertyChangeListener support).");
}
}
}
}
示例2: unbind
import org.codehaus.groovy.runtime.InvokerHelper; //导入方法依赖的package包/类
public void unbind() {
if (bound) {
if (boundToProperty) {
try {
InvokerHelper.invokeMethodSafe(boundBean, "removePropertyChangeListener", new Object[]{boundProperty, this});
} catch (MissingMethodException mme) {
// ignore, too bad so sad they don't follow conventions, we'll just leave the listener attached
}
} else {
try {
InvokerHelper.invokeMethodSafe(boundBean, "removePropertyChangeListener", new Object[]{this});
} catch (MissingMethodException mme2) {
// ignore, too bad so sad they don't follow conventions, we'll just leave the listener attached
}
}
boundBean = null;
boundProperty = null;
bound = false;
}
}
示例3: request
import org.codehaus.groovy.runtime.InvokerHelper; //导入方法依赖的package包/类
public void request(List<?> options) throws AppException {
for (Object object : options) {
String str = toString.toString(object, "option");
OptionDeclarationImpl o = optionFactory.create();
InvokerHelper.invokeMethodSafe(o, "option", str);
}
}
示例4: prepend
import org.codehaus.groovy.runtime.InvokerHelper; //导入方法依赖的package包/类
public void prepend(String option, String value) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("option", option);
map.put("value", value);
PrependStatementImpl s = prependFactory.create();
InvokerHelper.invokeMethodSafe(s, "prepend", map);
addStatement(s);
}
示例5: send
import org.codehaus.groovy.runtime.InvokerHelper; //导入方法依赖的package包/类
public void send(Map<String, Object> args) {
Map<String, Object> map = new HashMap<String, Object>(args);
SendStatementImpl s = sendFactory.create();
InvokerHelper.invokeMethodSafe(s, "send", map);
addStatement(s);
}
示例6: request
import org.codehaus.groovy.runtime.InvokerHelper; //导入方法依赖的package包/类
public void request(String option) {
RequestsStatementImpl s = requestsFactory.create();
InvokerHelper.invokeMethodSafe(s, "request", option);
addStatement(s);
}
示例7: option
import org.codehaus.groovy.runtime.InvokerHelper; //导入方法依赖的package包/类
public void option(String string) {
this.option = optionFactory.create();
InvokerHelper.invokeMethodSafe(option, "option", string);
}