Java Code Examples for org.jf.dexlib2.analysis.reflection.util.ReflectionUtils

The following examples show how to use org.jf.dexlib2.analysis.reflection.util.ReflectionUtils. These examples are extracted from open source projects. 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 Project: ZjDroid   Source File: ReflectionClassDef.java    License: Apache License 2.0 6 votes vote down vote up
@Nonnull @Override public Set<String> getInterfaces() {
    return new AbstractSet<String>() {
        @Nonnull @Override public Iterator<String> iterator() {
            return Iterators.transform(Iterators.forArray(cls.getInterfaces()), new Function<Class, String>() {
                @Nullable @Override public String apply(@Nullable Class input) {
                    if (input == null) {
                        return null;
                    }
                    return ReflectionUtils.javaToDexName(input.getName());
                }
            });
        }

        @Override public int size() {
            return cls.getInterfaces().length;
        }
    };
}
 
Example 2
Source Project: ZjDroid   Source File: ReflectionConstructor.java    License: 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 3
Source Project: ZjDroid   Source File: ReflectionMethod.java    License: 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 4
Source Project: zjdroid   Source File: ReflectionClassDef.java    License: Apache License 2.0 6 votes vote down vote up
@Nonnull @Override public Set<String> getInterfaces() {
    return new AbstractSet<String>() {
        @Nonnull @Override public Iterator<String> iterator() {
            return Iterators.transform(Iterators.forArray(cls.getInterfaces()), new Function<Class, String>() {
                @Nullable @Override public String apply(@Nullable Class input) {
                    if (input == null) {
                        return null;
                    }
                    return ReflectionUtils.javaToDexName(input.getName());
                }
            });
        }

        @Override public int size() {
            return cls.getInterfaces().length;
        }
    };
}
 
Example 5
Source Project: zjdroid   Source File: ReflectionConstructor.java    License: 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 6
Source Project: zjdroid   Source File: ReflectionMethod.java    License: 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 7
Source Project: HeyGirl   Source File: ReflectionClassDef.java    License: Apache License 2.0 6 votes vote down vote up
@Nonnull @Override public Set<String> getInterfaces() {
    return new AbstractSet<String>() {
        @Nonnull @Override public Iterator<String> iterator() {
            return Iterators.transform(Iterators.forArray(cls.getInterfaces()), new Function<Class, String>() {
                @Nullable @Override public String apply(@Nullable Class input) {
                    if (input == null) {
                        return null;
                    }
                    return ReflectionUtils.javaToDexName(input.getName());
                }
            });
        }

        @Override public int size() {
            return cls.getInterfaces().length;
        }
    };
}
 
Example 8
Source Project: HeyGirl   Source File: ReflectionConstructor.java    License: 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 9
Source Project: HeyGirl   Source File: ReflectionMethod.java    License: 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 10
Source Project: ZjDroid   Source File: ReflectionClassDef.java    License: Apache License 2.0 6 votes vote down vote up
@Nonnull @Override public Set<String> getInterfaces() {
    return new AbstractSet<String>() {
        @Nonnull @Override public Iterator<String> iterator() {
            return Iterators.transform(Iterators.forArray(cls.getInterfaces()), new Function<Class, String>() {
                @Nullable @Override public String apply(@Nullable Class input) {
                    if (input == null) {
                        return null;
                    }
                    return ReflectionUtils.javaToDexName(input.getName());
                }
            });
        }

        @Override public int size() {
            return cls.getInterfaces().length;
        }
    };
}
 
Example 11
Source Project: ZjDroid   Source File: ReflectionConstructor.java    License: 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 12
Source Project: ZjDroid   Source File: ReflectionMethod.java    License: 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 13
Source Project: ZjDroid   Source File: ReflectionClassDef.java    License: Apache License 2.0 5 votes vote down vote up
@Nullable @Override public String getSuperclass() {
    if (Modifier.isInterface(cls.getModifiers())) {
        return "Ljava/lang/Object;";
    }
    Class superClass = cls.getSuperclass();
    if (superClass == null) {
        return null;
    }
    return ReflectionUtils.javaToDexName(superClass.getName());
}
 
Example 14
Source Project: zjdroid   Source File: ReflectionClassDef.java    License: Apache License 2.0 5 votes vote down vote up
@Nullable @Override public String getSuperclass() {
    if (Modifier.isInterface(cls.getModifiers())) {
        return "Ljava/lang/Object;";
    }
    Class superClass = cls.getSuperclass();
    if (superClass == null) {
        return null;
    }
    return ReflectionUtils.javaToDexName(superClass.getName());
}
 
Example 15
Source Project: HeyGirl   Source File: ReflectionClassDef.java    License: Apache License 2.0 5 votes vote down vote up
@Nullable @Override public String getSuperclass() {
    if (Modifier.isInterface(cls.getModifiers())) {
        return "Ljava/lang/Object;";
    }
    Class superClass = cls.getSuperclass();
    if (superClass == null) {
        return null;
    }
    return ReflectionUtils.javaToDexName(superClass.getName());
}
 
Example 16
Source Project: ZjDroid   Source File: ReflectionClassDef.java    License: Apache License 2.0 5 votes vote down vote up
@Nullable @Override public String getSuperclass() {
    if (Modifier.isInterface(cls.getModifiers())) {
        return "Ljava/lang/Object;";
    }
    Class superClass = cls.getSuperclass();
    if (superClass == null) {
        return null;
    }
    return ReflectionUtils.javaToDexName(superClass.getName());
}
 
Example 17
Source Project: ZjDroid   Source File: ReflectionField.java    License: Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public String getDefiningClass() {
    return ReflectionUtils.javaToDexName(field.getDeclaringClass().getName());
}
 
Example 18
Source Project: ZjDroid   Source File: ReflectionField.java    License: Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public String getType() {
    return ReflectionUtils.javaToDexName(field.getType().getName());
}
 
Example 19
Source Project: ZjDroid   Source File: ReflectionClassDef.java    License: Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public String getType() {
    return ReflectionUtils.javaToDexName(cls.getName());
}
 
Example 20
Source Project: ZjDroid   Source File: ReflectionConstructor.java    License: Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public String getDefiningClass() {
    return ReflectionUtils.javaToDexName(constructor.getDeclaringClass().getName());
}
 
Example 21
Source Project: ZjDroid   Source File: ReflectionMethod.java    License: Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public String getDefiningClass() {
    return ReflectionUtils.javaToDexName(method.getDeclaringClass().getName());
}
 
Example 22
Source Project: ZjDroid   Source File: ReflectionMethod.java    License: Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public String getReturnType() {
    return ReflectionUtils.javaToDexName(method.getReturnType().getName());
}
 
Example 23
Source Project: zjdroid   Source File: ReflectionField.java    License: Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public String getDefiningClass() {
    return ReflectionUtils.javaToDexName(field.getDeclaringClass().getName());
}
 
Example 24
Source Project: zjdroid   Source File: ReflectionField.java    License: Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public String getType() {
    return ReflectionUtils.javaToDexName(field.getType().getName());
}
 
Example 25
Source Project: zjdroid   Source File: ReflectionClassDef.java    License: Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public String getType() {
    return ReflectionUtils.javaToDexName(cls.getName());
}
 
Example 26
Source Project: zjdroid   Source File: ReflectionConstructor.java    License: Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public String getDefiningClass() {
    return ReflectionUtils.javaToDexName(constructor.getDeclaringClass().getName());
}
 
Example 27
Source Project: zjdroid   Source File: ReflectionMethod.java    License: Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public String getDefiningClass() {
    return ReflectionUtils.javaToDexName(method.getDeclaringClass().getName());
}
 
Example 28
Source Project: zjdroid   Source File: ReflectionMethod.java    License: Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public String getReturnType() {
    return ReflectionUtils.javaToDexName(method.getReturnType().getName());
}
 
Example 29
Source Project: HeyGirl   Source File: ReflectionField.java    License: Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public String getDefiningClass() {
    return ReflectionUtils.javaToDexName(field.getDeclaringClass().getName());
}
 
Example 30
Source Project: HeyGirl   Source File: ReflectionField.java    License: Apache License 2.0 4 votes vote down vote up
@Nonnull @Override public String getType() {
    return ReflectionUtils.javaToDexName(field.getType().getName());
}