org.jf.dexlib2.base.BaseMethodParameter Java Examples

The following examples show how to use org.jf.dexlib2.base.BaseMethodParameter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ReflectionConstructor.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@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;
        }
    };
}
 
Example #2
Source File: ReflectionMethod.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@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;
        }
    };
}
 
Example #3
Source File: ParameterIterator.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@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; }
    };
}
 
Example #4
Source File: ReflectionConstructor.java    From zjdroid with Apache License 2.0 6 votes vote down vote up
@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;
        }
    };
}
 
Example #5
Source File: ReflectionMethod.java    From zjdroid with Apache License 2.0 6 votes vote down vote up
@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;
        }
    };
}
 
Example #6
Source File: ParameterIterator.java    From zjdroid with Apache License 2.0 6 votes vote down vote up
@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; }
    };
}
 
Example #7
Source File: ReflectionConstructor.java    From HeyGirl with Apache License 2.0 6 votes vote down vote up
@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;
        }
    };
}
 
Example #8
Source File: ReflectionMethod.java    From HeyGirl with Apache License 2.0 6 votes vote down vote up
@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;
        }
    };
}
 
Example #9
Source File: ParameterIterator.java    From HeyGirl with Apache License 2.0 6 votes vote down vote up
@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; }
    };
}
 
Example #10
Source File: ReflectionConstructor.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@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;
        }
    };
}
 
Example #11
Source File: ReflectionMethod.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@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;
        }
    };
}
 
Example #12
Source File: ParameterIterator.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@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; }
    };
}