org.jboss.errai.codegen.meta.MetaClass.isVoid()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(79)

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

MetaClass.isVoid介绍

暂无

代码示例

代码示例来源:origin: org.jboss.errai/errai-bus

@Override
 public Collection<MetaClass> provideTypesToExpose() {
  final Set<MetaClass> types = new HashSet<MetaClass>();
  for (final MetaClass metaClass : ClassScanner.getTypesAnnotatedWith(Remote.class)) {
   for (final MetaMethod method : metaClass.getDeclaredMethods()) {
    if (!method.getReturnType().isVoid()) {
     types.add(method.getReturnType().getErased());
    }
    for (final MetaParameter parameter : method.getParameters()) {
     final MetaClass type = parameter.getType();

     types.add(type.getErased());

     final MetaParameterizedType parameterizedType = type.getParameterizedType();
     if (parameterizedType != null) {
      for (final MetaType tp : parameterizedType.getTypeParameters()) {
        if (tp instanceof MetaClass) {
         types.add(((MetaClass) tp).getErased());
        }
      }
     }

    }
   }
  }
  return types;
 }
}

代码示例来源:origin: errai/errai

public static String methodAccess(final MetaMethod method) {
  final StringBuilder buf = new StringBuilder(50);

  if (!method.getReturnType().isVoid()) {
   buf.append("return ");
  }

  if (!method.isStatic()) {
   buf.append("instance.");
  }

  buf.append('@').append(method.getDeclaringClass().getFullyQualifiedName().replace('$', '.'))
      .append("::").append(method instanceof MetaConstructor ? "new" : method.getName()).append('(');

  for (final MetaParameter parm : method.getParameters()) {
   buf.append(parm.getType().getInternalName());
  }
  buf.append(")(");

  final int length = method.getParameters().length;

  for (int i = 0; i < length; i++) {
   buf.append("a").append(i);
   if (i + 1 < length) buf.append(",");
  }
  buf.append(")");

  return buf.toString();
 }
}

代码示例来源:origin: org.jboss.errai/errai-codegen-gwt

public static String methodAccess(final MetaMethod method) {
  final StringBuilder buf = new StringBuilder(50);

  if (!method.getReturnType().isVoid()) {
   buf.append("return ");
  }

  if (!method.isStatic()) {
   buf.append("instance.");
  }

  buf.append('@').append(method.getDeclaringClass().getFullyQualifiedName().replace('$', '.'))
      .append("::").append(method instanceof MetaConstructor ? "new" : method.getName()).append('(');

  for (final MetaParameter parm : method.getParameters()) {
   buf.append(parm.getType().getInternalName());
  }
  buf.append(")(");

  final int length = method.getParameters().length;

  for (int i = 0; i < length; i++) {
   buf.append("a").append(i);
   if (i + 1 < length) buf.append(",");
  }
  buf.append(")");

  return buf.toString();
 }
}

代码示例来源:origin: errai/errai

@Override
 public Collection<MetaClass> provideTypesToExpose() {
  final Set<MetaClass> types = new HashSet<MetaClass>();
  for (final MetaClass metaClass : ClassScanner.getTypesAnnotatedWith(Remote.class)) {
   for (final MetaMethod method : metaClass.getDeclaredMethods()) {
    if (!method.getReturnType().isVoid()) {
     types.add(method.getReturnType().getErased());
    }
    for (final MetaParameter parameter : method.getParameters()) {
     final MetaClass type = parameter.getType();

     types.add(type.getErased());

     final MetaParameterizedType parameterizedType = type.getParameterizedType();
     if (parameterizedType != null) {
      for (final MetaType tp : parameterizedType.getTypeParameters()) {
        if (tp instanceof MetaClass) {
         types.add(((MetaClass) tp).getErased());
        }
      }
     }

    }
   }
  }
  return types;
 }
}

代码示例来源:origin: org.jboss.errai/errai-ui

final MetaMethod method = decorable.getAsMethod();
final MetaParameter[] parameters = method.getParameters();
if (!method.getReturnType().isVoid() && parameters.length == 0) {
 valueAccessor = decorable.getAccessStatement();
else if (method.getReturnType().isVoid() && parameters.length == 1) {

代码示例来源:origin: errai/errai

final MetaMethod method = decorable.getAsMethod();
final MetaParameter[] parameters = method.getParameters();
if (!method.getReturnType().isVoid() && parameters.length == 0) {
 valueAccessor = decorable.getAccessStatement();
else if (method.getReturnType().isVoid() && parameters.length == 1) {

代码示例来源:origin: errai/errai

System.arraycopy(statementVars, 0, privateAccessStmts, 1, statementVars.length);
 if (method.getReturnType().isVoid()) {
  ifBody._(loadVariable("this").invoke(PrivateAccessUtil.getPrivateMethodName(method), privateAccessStmts));
 if (method.getReturnType().isVoid()) {
  ifBody._(loadVariable(proxyVar).invoke(method, statementVars));
if (!method.getReturnType().isVoid()) {
 elseBody.append(ProxyUtil.generateProxyMethodReturnStatement(method));

代码示例来源:origin: errai/errai

.invoke("invoke", method.isStatic() ? null : Refs.get("instance"), args);
if (method.getReturnType().isVoid()) {
 tryBuilder._(statementBuilder);

代码示例来源:origin: org.jboss.errai/errai-codegen

.invoke("invoke", method.isStatic() ? null : Refs.get("instance"), args);
if (method.getReturnType().isVoid()) {
 tryBuilder._(statementBuilder);

代码示例来源:origin: org.jboss.errai/errai-codegen

System.arraycopy(statementVars, 0, privateAccessStmts, 1, statementVars.length);
 if (method.getReturnType().isVoid()) {
  ifBody._(loadVariable("this").invoke(PrivateAccessUtil.getPrivateMethodName(method), privateAccessStmts));
 if (method.getReturnType().isVoid()) {
  ifBody._(loadVariable(proxyVar).invoke(method, statementVars));
if (!method.getReturnType().isVoid()) {
 elseBody.append(ProxyUtil.generateProxyMethodReturnStatement(method));

代码示例来源:origin: errai/errai

.append(proxiedInstanceDeclaration)
        .appendAll(controller.getInvokeBeforeStatements(method));
if (method.getReturnType().isVoid()) {
 ifBlock.append(proxyHelperInvocation);
 ifBlock.appendAll(controller.getInvokeAfterStatements(method));

代码示例来源:origin: errai/errai

final boolean hasReturnType = !method.getReturnType().isVoid();
final Statement methodInvocation = Stmt.nestedCall(Stmt.loadVariable("instance")).invoke(method.getName(), (Object[]) objects);
final Statement invocation = (hasReturnType) ? Stmt.declareFinalVariable("ret", method.getReturnType(), methodInvocation) : methodInvocation;

代码示例来源:origin: org.jboss.errai/errai-ioc-bus-support

final boolean hasReturnType = !method.getReturnType().isVoid();
final Statement methodInvocation = Stmt.nestedCall(Stmt.loadVariable("instance")).invoke(method.getName(), (Object[]) objects);
final Statement invocation = (hasReturnType) ? Stmt.declareFinalVariable("ret", method.getReturnType(), methodInvocation) : methodInvocation;

相关文章