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


Java MethodParameter类代码示例

本文整理汇总了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();

        }
    };
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:21,代码来源:MethodImplReIClassDef.java

示例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);
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:17,代码来源:DexBuilder.java

示例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;
        }
    };
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:27,代码来源:ReflectionConstructor.java

示例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;
        }
    };
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:27,代码来源:ReflectionMethod.java

示例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();
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:22,代码来源:DexBackedMethod.java

示例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; }
    };
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:24,代码来源:ParameterIterator.java

示例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);
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:17,代码来源:DexBuilder.java

示例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;
        }
    };
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:27,代码来源:ReflectionConstructor.java

示例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;
        }
    };
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:27,代码来源:ReflectionMethod.java

示例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();
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:21,代码来源:DexBackedMethod.java

示例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; }
    };
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:24,代码来源:ParameterIterator.java

示例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;
}
 
开发者ID:DexPatcher,项目名称:dexpatcher-tool,代码行数:21,代码来源:MethodSetPatcher.java

示例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;
}
 
开发者ID:DexPatcher,项目名称:dexpatcher-tool,代码行数:18,代码来源:BasicMethod.java

示例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;
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:25,代码来源:ClassPool.java

示例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);
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:18,代码来源:DexBuilder.java


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