本文整理汇总了Java中org.jf.dexlib2.immutable.ImmutableMethodParameter类的典型用法代码示例。如果您正苦于以下问题:Java ImmutableMethodParameter类的具体用法?Java ImmutableMethodParameter怎么用?Java ImmutableMethodParameter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ImmutableMethodParameter类属于org.jf.dexlib2.immutable包,在下文中一共展示了ImmutableMethodParameter类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: reParameters
import org.jf.dexlib2.immutable.ImmutableMethodParameter; //导入依赖的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: parseParamString
import org.jf.dexlib2.immutable.ImmutableMethodParameter; //导入依赖的package包/类
@Nonnull
public static Iterable<ImmutableMethodParameter> parseParamString(@Nonnull final String params) {
return new Iterable<ImmutableMethodParameter>() {
@Override public Iterator<ImmutableMethodParameter> iterator() {
return new Iterator<ImmutableMethodParameter>() {
private int index = 0;
@Override public boolean hasNext() {
return index < params.length();
}
@Override public ImmutableMethodParameter next() {
int end = findTypeEnd(params, index);
String ret = params.substring(index, end);
index = end;
return new ImmutableMethodParameter(ret, null, null);
}
@Override public void remove() {
throw new UnsupportedOperationException();
}
};
}
};
}
示例3: parseParamString
import org.jf.dexlib2.immutable.ImmutableMethodParameter; //导入依赖的package包/类
public static Iterable<ImmutableMethodParameter> parseParamString( final String params) {
return new Iterable<ImmutableMethodParameter>() {
@Override public Iterator<ImmutableMethodParameter> iterator() {
return new Iterator<ImmutableMethodParameter>() {
private int index = 0;
@Override public boolean hasNext() {
return index < params.length();
}
@Override public ImmutableMethodParameter next() {
int end = findTypeEnd(params, index);
String ret = params.substring(index, end);
index = end;
return new ImmutableMethodParameter(ret, null, null);
}
@Override public void remove() {
throw new UnsupportedOperationException();
}
};
}
};
}
示例4: parseParamString
import org.jf.dexlib2.immutable.ImmutableMethodParameter; //导入依赖的package包/类
@Nonnull
public static Iterable<ImmutableMethodParameter> parseParamString(@Nonnull final String params) {
return new Iterable<ImmutableMethodParameter>() {
@Override
public Iterator<ImmutableMethodParameter> iterator() {
return new Iterator<ImmutableMethodParameter>() {
private int index = 0;
@Override
public boolean hasNext() {
return index < params.length();
}
@Override
public ImmutableMethodParameter next() {
int end = findTypeEnd(params, index);
String ret = params.substring(index, end);
index = end;
return new ImmutableMethodParameter(ret, null, null);
}
@Override
public void remove() {
throw new UnsupportedOperationException();
}
};
}
};
}
示例5: inlineMethod
import org.jf.dexlib2.immutable.ImmutableMethodParameter; //导入依赖的package包/类
@Nonnull
private static Method inlineMethod(int accessFlags, @Nonnull String cls, @Nonnull String name,
@Nonnull String params, @Nonnull String returnType) {
ImmutableList<ImmutableMethodParameter> paramList = ImmutableList.copyOf(ParamUtil.parseParamString(params));
return new ImmutableMethod(cls, name, paramList, returnType, accessFlags, null, null);
}
示例6: toMethods
import org.jf.dexlib2.immutable.ImmutableMethodParameter; //导入依赖的package包/类
private Collection<BuilderMethod> toMethods(SootClass clazz) {
if (clazz.getMethods().isEmpty())
return null;
String classType = SootToDexUtils.getDexTypeDescriptor(clazz.getType());
List<BuilderMethod> methods = new ArrayList<BuilderMethod>();
for (SootMethod sm : clazz.getMethods()) {
if (sm.isPhantom()) {
// Do not print method bodies for inherited methods
continue;
}
MethodImplementation impl = toMethodImplementation(sm);
List<String> parameterNames = null;
if (sm.hasTag("ParamNamesTag"))
parameterNames = ((ParamNamesTag) sm.getTag("ParamNamesTag")).getNames();
int paramIdx = 0;
List<MethodParameter> parameters = null;
if (sm.getParameterCount() > 0) {
parameters = new ArrayList<MethodParameter>();
for (Type tp : sm.getParameterTypes()) {
String paramType = SootToDexUtils.getDexTypeDescriptor(tp);
parameters.add(new ImmutableMethodParameter(paramType,
buildMethodParameterAnnotations(sm, paramIdx),
sm.isConcrete() && parameterNames != null ?
parameterNames.get(paramIdx) : null));
paramIdx++;
}
}
String returnType = SootToDexUtils.getDexTypeDescriptor(sm.getReturnType());
int accessFlags = SootToDexUtils.getDexAccessFlags(sm);
BuilderMethod meth = dexFile.internMethod(classType,
sm.getName(),
parameters,
returnType,
accessFlags,
buildMethodAnnotations(sm),
impl);
methods.add(meth);
}
return methods;
}
示例7: inlineMethod
import org.jf.dexlib2.immutable.ImmutableMethodParameter; //导入依赖的package包/类
private static Method inlineMethod(int accessFlags, String cls, String name,
String params, String returnType) {
ImmutableList<ImmutableMethodParameter> paramList = ImmutableList.copyOf(ParamUtil.parseParamString(params));
return new ImmutableMethod(cls, name, paramList, returnType, accessFlags, null, null);
}