本文整理汇总了Java中org.jf.dexlib2.iface.MethodParameter类的典型用法代码示例。如果您正苦于以下问题:Java MethodParameter类的具体用法?Java MethodParameter怎么用?Java MethodParameter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MethodParameter类属于org.jf.dexlib2.iface包,在下文中一共展示了MethodParameter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: reParameters
import org.jf.dexlib2.iface.MethodParameter; //导入依赖的package包/类
@Override
protected Iterable<? extends MethodParameter> reParameters(final List<? extends MethodParameter> paramters) {
final List<ImmutableMethodParameter> list = new ArrayList<ImmutableMethodParameter>();
for (MethodParameter methodParameter : paramters) {
boolean isBasic = false;
if (basicType.containsKey(methodParameter.getType())) {
isBasic = true;
}
list.add(new ImmutableMethodParameter(
isBasic ? methodParameter.getType() : DefineUtils.getDefineClassName(classProcessor.classProcess(DefineUtils.getDalvikClassName(methodParameter.getType())).className,methodParameter.getType().startsWith("[")),
methodParameter.getAnnotations(), methodParameter.getName()));
}
return new Iterable<ImmutableMethodParameter>() {
@Override
public Iterator<ImmutableMethodParameter> iterator() {
return list.iterator();
}
};
}
示例2: internMethod
import org.jf.dexlib2.iface.MethodParameter; //导入依赖的package包/类
@Nonnull public BuilderMethod internMethod(@Nonnull String definingClass,
@Nonnull String name,
@Nullable List<? extends MethodParameter> parameters,
@Nonnull String returnType,
int accessFlags,
@Nonnull Set<? extends Annotation> annotations,
@Nullable MethodImplementation methodImplementation) {
if (parameters == null) {
parameters = ImmutableList.of();
}
return new BuilderMethod(context.methodPool.internMethod(definingClass, name, parameters, returnType),
internMethodParameters(parameters),
accessFlags,
context.annotationSetPool.internAnnotationSet(annotations),
methodImplementation);
}
示例3: getParameters
import org.jf.dexlib2.iface.MethodParameter; //导入依赖的package包/类
@Nonnull @Override public List<? extends MethodParameter> getParameters() {
final Constructor method = this.constructor;
return new AbstractList<MethodParameter>() {
private final Class[] parameters = method.getParameterTypes();
@Override public MethodParameter get(final int index) {
return new BaseMethodParameter() {
@Nonnull @Override public Set<? extends Annotation> getAnnotations() {
return ImmutableSet.of();
}
@Nullable @Override public String getName() {
return null;
}
@Nonnull @Override public String getType() {
return ReflectionUtils.javaToDexName(parameters[index].getName());
}
};
}
@Override public int size() {
return parameters.length;
}
};
}
示例4: getParameters
import org.jf.dexlib2.iface.MethodParameter; //导入依赖的package包/类
@Nonnull @Override public List<? extends MethodParameter> getParameters() {
final java.lang.reflect.Method method = this.method;
return new AbstractList<MethodParameter>() {
private final Class[] parameters = method.getParameterTypes();
@Override public MethodParameter get(final int index) {
return new BaseMethodParameter() {
@Nonnull @Override public Set<? extends Annotation> getAnnotations() {
return ImmutableSet.of();
}
@Nullable @Override public String getName() {
return null;
}
@Nonnull @Override public String getType() {
return ReflectionUtils.javaToDexName(parameters[index].getName());
}
};
}
@Override public int size() {
return parameters.length;
}
};
}
示例5: getParameters
import org.jf.dexlib2.iface.MethodParameter; //导入依赖的package包/类
@Nonnull
@Override
public List<? extends MethodParameter> getParameters() {
int parametersOffset = getParametersOffset();
if (parametersOffset > 0) {
final List<String> parameterTypes = getParameterTypes();
return new AbstractForwardSequentialList<MethodParameter>() {
@Nonnull @Override public Iterator<MethodParameter> iterator() {
return new ParameterIterator(parameterTypes,
getParameterAnnotations(),
getParameterNames());
}
@Override public int size() {
return parameterTypes.size();
}
};
}
return ImmutableList.of();
}
示例6: next
import org.jf.dexlib2.iface.MethodParameter; //导入依赖的package包/类
@Override public MethodParameter next() {
@Nonnull final String type = parameterTypes.next().toString();
@Nonnull final Set<? extends Annotation> annotations;
@Nullable final String name;
if (parameterAnnotations.hasNext()) {
annotations = parameterAnnotations.next();
} else {
annotations = ImmutableSet.of();
}
if (parameterNames.hasNext()) {
name = parameterNames.next();
} else {
name = null;
}
return new BaseMethodParameter() {
@Nonnull @Override public Set<? extends Annotation> getAnnotations() { return annotations; }
@Nullable @Override public String getName() { return name; }
@Nonnull @Override public String getType() { return type; }
};
}
示例7: internMethod
import org.jf.dexlib2.iface.MethodParameter; //导入依赖的package包/类
public BuilderMethod internMethod( String definingClass,
String name,
List<? extends MethodParameter> parameters,
String returnType,
int accessFlags,
Set<? extends Annotation> annotations,
MethodImplementation methodImplementation) {
if (parameters == null) {
parameters = ImmutableList.of();
}
return new BuilderMethod(methodSection.internMethod(definingClass, name, parameters, returnType),
internMethodParameters(parameters),
accessFlags,
annotationSetSection.internAnnotationSet(annotations),
methodImplementation);
}
示例8: getParameters
import org.jf.dexlib2.iface.MethodParameter; //导入依赖的package包/类
@Override public List<? extends MethodParameter> getParameters() {
final Constructor method = this.constructor;
return new AbstractList<MethodParameter>() {
private final Class[] parameters = method.getParameterTypes();
@Override public MethodParameter get(final int index) {
return new BaseMethodParameter() {
@Override public Set<? extends Annotation> getAnnotations() {
return ImmutableSet.of();
}
@Override public String getName() {
return null;
}
@Override public String getType() {
return ReflectionUtils.javaToDexName(parameters[index].getName());
}
};
}
@Override public int size() {
return parameters.length;
}
};
}
示例9: getParameters
import org.jf.dexlib2.iface.MethodParameter; //导入依赖的package包/类
@Override public List<? extends MethodParameter> getParameters() {
final java.lang.reflect.Method method = this.method;
return new AbstractList<MethodParameter>() {
private final Class[] parameters = method.getParameterTypes();
@Override public MethodParameter get(final int index) {
return new BaseMethodParameter() {
@Override public Set<? extends Annotation> getAnnotations() {
return ImmutableSet.of();
}
@Override public String getName() {
return null;
}
@Override public String getType() {
return ReflectionUtils.javaToDexName(parameters[index].getName());
}
};
}
@Override public int size() {
return parameters.length;
}
};
}
示例10: getParameters
import org.jf.dexlib2.iface.MethodParameter; //导入依赖的package包/类
@Override
public List<? extends MethodParameter> getParameters() {
int parametersOffset = getParametersOffset();
if (parametersOffset > 0) {
final List<String> parameterTypes = getParameterTypes();
return new AbstractForwardSequentialList<MethodParameter>() {
@Override public Iterator<MethodParameter> iterator() {
return new ParameterIterator(parameterTypes,
getParameterAnnotations(),
getParameterNames());
}
@Override public int size() {
return parameterTypes.size();
}
};
}
return ImmutableList.of();
}
示例11: next
import org.jf.dexlib2.iface.MethodParameter; //导入依赖的package包/类
@Override public MethodParameter next() {
final String type = parameterTypes.next().toString();
final Set<? extends Annotation> annotations;
final String name;
if (parameterAnnotations.hasNext()) {
annotations = parameterAnnotations.next();
} else {
annotations = ImmutableSet.of();
}
if (parameterNames.hasNext()) {
name = parameterNames.next();
} else {
name = null;
}
return new BaseMethodParameter() {
@Override public Set<? extends Annotation> getAnnotations() { return annotations; }
@Override public String getName() { return name; }
@Override public String getType() { return type; }
};
}
示例12: getTargetId
import org.jf.dexlib2.iface.MethodParameter; //导入依赖的package包/类
@Override
protected String getTargetId(String patchId, Method patch, PatcherAnnotation annotation) {
String target = annotation.getTarget();
String resolvedTarget = (target != null ? target : patch.getName());
String targetId;
String targetLabel;
if (isTaggedByLastParameter(patch, true)) {
ArrayList<MethodParameter> parameters = new ArrayList<>(patch.getParameters());
parameters.remove(parameters.size() - 1);
targetId = Id.ofMethod(parameters, patch.getReturnType(), resolvedTarget);
targetLabel = Label.ofMethod(parameters, patch.getReturnType(), resolvedTarget);
} else {
targetId = (target != null ? Id.ofMethod(patch, target) : patchId);
targetLabel = Label.ofTargetMember(resolvedTarget);
}
if (shouldLogTarget(patchId, targetId)) {
extendLogPrefixWithTargetLabel(targetLabel);
}
return targetId;
}
示例13: BasicMethod
import org.jf.dexlib2.iface.MethodParameter; //导入依赖的package包/类
public BasicMethod(
String definingClass,
String name,
List<? extends MethodParameter> parameters,
String returnType,
int accessFlags,
Set<? extends Annotation> annotations,
MethodImplementation methodImplementation
) {
this.definingClass = definingClass;
this.name = name;
this.parameters = parameters;
this.returnType = returnType;
this.accessFlags = accessFlags;
this.annotations = annotations;
this.methodImplementation = methodImplementation;
}
示例14: getParameterAnnotations
import org.jf.dexlib2.iface.MethodParameter; //导入依赖的package包/类
@Nullable
@Override
public List<? extends Set<? extends Annotation>> getParameterAnnotations(
@Nonnull final PoolMethod method) {
final List<? extends MethodParameter> parameters = method.getParameters();
boolean hasParameterAnnotations = Iterables.any(parameters, HAS_PARAMETER_ANNOTATIONS);
if (hasParameterAnnotations) {
return new AbstractForwardSequentialList<Set<? extends Annotation>>() {
@Nonnull
@Override
public Iterator<Set<? extends Annotation>> iterator() {
return FluentIterable.from(parameters)
.transform(PARAMETER_ANNOTATIONS).iterator();
}
@Override
public int size() {
return parameters.size();
}
};
}
return null;
}
示例15: internMethod
import org.jf.dexlib2.iface.MethodParameter; //导入依赖的package包/类
@Nonnull
public BuilderMethod internMethod(@Nonnull String definingClass,
@Nonnull String name,
@Nullable List<? extends MethodParameter> parameters,
@Nonnull String returnType,
int accessFlags,
@Nonnull Set<? extends Annotation> annotations,
@Nullable MethodImplementation methodImplementation) {
if (parameters == null) {
parameters = ImmutableList.of();
}
return new BuilderMethod(context.methodPool.internMethod(definingClass, name, parameters, returnType),
internMethodParameters(parameters),
accessFlags,
context.annotationSetPool.internAnnotationSet(annotations),
methodImplementation);
}