本文整理汇总了Java中org.jboss.jandex.MethodInfo.parameters方法的典型用法代码示例。如果您正苦于以下问题:Java MethodInfo.parameters方法的具体用法?Java MethodInfo.parameters怎么用?Java MethodInfo.parameters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.jandex.MethodInfo
的用法示例。
在下文中一共展示了MethodInfo.parameters方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildMethodDef
import org.jboss.jandex.MethodInfo; //导入方法依赖的package包/类
static String buildMethodDef(MethodInfo method) {
StringBuilder builder = new StringBuilder();
// Method Parameters
builder.append("(");
for (org.jboss.jandex.Type type : method.parameters()) {
builder.append(buildTypeDef(type.name().toString()));
}
builder.append(")");
// Method Return Type
if (method.returnType().kind().equals(org.jboss.jandex.Type.Kind.VOID)) {
builder.append("V");
} else {
builder.append(buildTypeDef(method.returnType().name().toString()));
}
return builder.toString();
}
示例2: validParameters
import org.jboss.jandex.MethodInfo; //导入方法依赖的package包/类
private boolean validParameters(final MethodInfo method, final StringBuilder sb) {
boolean ok = true;
final Map<Integer, List<AnnotationInstance>> map = Utils.createParameterAnnotationMap(method);
final List<Type> params = method.parameters();
for (int i = 0; i < params.size(); i++) {
final Type param = params.get(i);
if (param.kind() != Kind.PRIMITIVE) {
final List<AnnotationInstance> annotations = map.get(i);
if ((annotations == null) || !contains(annotations, notNullFqn, nullableFqn)) {
ok = false;
sb.append(method.declaringClass());
sb.append("\t");
sb.append(method);
sb.append("\t");
sb.append("Parameter #" + i + " (" + params.get(i).name() + ")\n");
}
}
}
return ok;
}
示例3: makeSignature
import org.jboss.jandex.MethodInfo; //导入方法依赖的package包/类
/**
* @param i
* @return
* @throws SerianalyzerException
*/
static String makeSignature ( MethodInfo i, boolean fix ) throws SerianalyzerException {
StringBuilder sb = new StringBuilder();
sb.append('(');
ClassInfo declaringImpl = i.declaringClass();
if ( fix && "<init>".equals(i.name()) && declaringImpl.nestingType() == NestingType.INNER ) { //$NON-NLS-1$
// there seems to be some sort of bug, missing the the outer instance parameter in the constructor
if ( !Modifier.isStatic(declaringImpl.flags()) ) {
org.jboss.jandex.Type enclosingClass = org.jboss.jandex.Type.create(declaringImpl.enclosingClass(), Kind.CLASS);
org.jboss.jandex.Type firstArg = i.parameters().size() > 0 ? i.parameters().get(0) : null;
if ( firstArg instanceof TypeVariable ) {
firstArg = firstArg.asTypeVariable().bounds().get(0);
}
if ( firstArg == null || !firstArg.equals(enclosingClass) ) {
sb.append(toString(enclosingClass));
}
}
}
for ( org.jboss.jandex.Type p : i.parameters() ) {
sb.append(toString(p));
}
sb.append(')');
sb.append(toString(i.returnType()));
return sb.toString();
}