当前位置: 首页>>代码示例>>Java>>正文


Java Statement.getMethodName方法代码示例

本文整理汇总了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);
}
 
开发者ID:vilie,项目名称:javify,代码行数:36,代码来源:ScanEngine.java

示例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);
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:36,代码来源:ScanEngine.java

示例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;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:13,代码来源:XMLEncoderTest.java


注:本文中的java.beans.Statement.getMethodName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。