本文整理汇总了Java中java.beans.Statement.getMethodName方法的典型用法代码示例。如果您正苦于以下问题:Java Statement.getMethodName方法的具体用法?Java Statement.getMethodName怎么用?Java Statement.getMethodName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.beans.Statement
的用法示例。
在下文中一共展示了Statement.getMethodName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeStatement
import java.beans.Statement; //导入方法依赖的package包/类
/** Scans the argument and calls one of event methods. See
* the introduction of this class for details.
*
* @param stmt The statement to serialize.
*/
public void writeStatement(Statement stmt)
{
// This is a simplified version of writeExpression. Everything
// that would not create something that is embedded in a <void> tag
// is left out (instantiation, getters, ...).
// TODO: Is this the right thing to do?
String methodName = stmt.getMethodName();
Object target = stmt.getTarget();
Object[] args = stmt.getArguments();
if (target == Array.class && methodName.equals("set"))
{
arraySet(args[1].toString());
return;
}
if (target instanceof List)
{
if (methodName.equals("set"))
{
listSet();
return;
}
}
// If nothing else could be used then this is a normal
// method invocation.
methodInvocation(methodName);
}
示例2: writeStatement
import java.beans.Statement; //导入方法依赖的package包/类
/** Scans the argument and calls one of event methods. See
* the introduction of this class for details.
*
* @param stmt The statement to serialize.
*/
public void writeStatement(Statement stmt)
{
// This is a simplified version of writeExpression. Everything
// that would not create something that is embedded in a <void> tag
// is left out (instantiation, getters, ...).
// TODO: Is this the right thing to do?
String methodName = stmt.getMethodName();
Object target = stmt.getTarget();
Object[] args = stmt.getArguments();
if (target == Array.class && methodName.equals("set"))
{
arraySet(args[1].toString());
return;
}
if (target instanceof List)
{
if (methodName.equals("set"))
{
listSet();
return;
}
}
// If nothing else could be used then this is a normal
// method invocation.
methodInvocation(methodName);
}
示例3: string
import java.beans.Statement; //导入方法依赖的package包/类
public static String string(Statement stat) {
String str = "(" + stat.getTarget() + ")." + stat.getMethodName() + "(";
Object args[] = stat.getArguments();
for (int i = 0; i < args.length; i++) {
if (i > 0) {
str += ", ";
}
str += args[i];
}
str = str + ")";
return str;
}