Generate java doc

This commit is contained in:
LoveSy 2023-01-10 21:23:30 +08:00
parent 45f3e9722a
commit 29ece95014
No known key found for this signature in database
6 changed files with 689 additions and 0 deletions

View File

@ -2,6 +2,9 @@ package io.github.libxposed;
import android.content.Context; import android.content.Context;
/**
* The type Xposed context.
*/
public abstract class XposedContext extends Context implements XposedInterface { public abstract class XposedContext extends Context implements XposedInterface {
} }

View File

@ -13,17 +13,35 @@ import java.nio.ByteBuffer;
import io.github.libxposed.utils.DexParser; import io.github.libxposed.utils.DexParser;
/**
* The type Xposed context wrapper.
*/
@SuppressWarnings("unused") @SuppressWarnings("unused")
public class XposedContextWrapper extends ContextWrapper implements XposedInterface { public class XposedContextWrapper extends ContextWrapper implements XposedInterface {
/**
* Instantiates a new Xposed context wrapper.
*
* @param base the base
*/
XposedContextWrapper(XposedContext base) { XposedContextWrapper(XposedContext base) {
super(base); super(base);
} }
/**
* Instantiates a new Xposed context wrapper.
*
* @param base the base
*/
public XposedContextWrapper(XposedContextWrapper base) { public XposedContextWrapper(XposedContextWrapper base) {
super(base); super(base);
} }
/**
* Gets api version.
*
* @return the api version
*/
final public int getAPIVersion() { final public int getAPIVersion() {
return API; return API;
} }

View File

@ -12,152 +12,505 @@ import java.util.ConcurrentModificationException;
import io.github.libxposed.utils.DexParser; import io.github.libxposed.utils.DexParser;
/**
* The interface Xposed interface.
*/
@SuppressWarnings("unused") @SuppressWarnings("unused")
public interface XposedInterface { public interface XposedInterface {
/**
* The constant API.
*/
int API = 100; int API = 100;
/**
* The constant FRAMEWORK_PRIVILEGE_ROOT.
*/
int FRAMEWORK_PRIVILEGE_ROOT = 0; int FRAMEWORK_PRIVILEGE_ROOT = 0;
/**
* The constant FRAMEWORK_PRIVILEGE_CONTAINER.
*/
int FRAMEWORK_PRIVILEGE_CONTAINER = 1; int FRAMEWORK_PRIVILEGE_CONTAINER = 1;
/**
* The constant FRAMEWORK_PRIVILEGE_APP.
*/
int FRAMEWORK_PRIVILEGE_APP = 2; int FRAMEWORK_PRIVILEGE_APP = 2;
/**
* The constant FRAMEWORK_PRIVILEGE_EMBEDDED.
*/
int FRAMEWORK_PRIVILEGE_EMBEDDED = 3; int FRAMEWORK_PRIVILEGE_EMBEDDED = 3;
/**
* The interface Before hook callback.
*
* @param <T> the type parameter
*/
interface BeforeHookCallback<T> { interface BeforeHookCallback<T> {
/**
* Gets origin.
*
* @return the origin
*/
@NonNull @NonNull
T getOrigin(); T getOrigin();
/**
* Gets this.
*
* @return the this
*/
@Nullable @Nullable
Object getThis(); Object getThis();
/**
* Get args object [ ].
*
* @return the object [ ]
*/
@NonNull @NonNull
Object[] getArgs(); Object[] getArgs();
/**
* Gets arg.
*
* @param <U> the type parameter
* @param index the index
* @return the arg
*/
@Nullable @Nullable
<U> U getArg(int index); <U> U getArg(int index);
/**
* Sets arg.
*
* @param <U> the type parameter
* @param index the index
* @param value the value
*/
<U> void setArg(int index, U value); <U> void setArg(int index, U value);
/**
* Return and skip.
*
* @param returnValue the return value
*/
void returnAndSkip(@Nullable Object returnValue); void returnAndSkip(@Nullable Object returnValue);
/**
* Throw and skip.
*
* @param throwable the throwable
*/
void throwAndSkip(@Nullable Throwable throwable); void throwAndSkip(@Nullable Throwable throwable);
/**
* Invoke origin object.
*
* @param thisObject the this object
* @param args the args
* @return the object
* @throws InvocationTargetException the invocation target exception
* @throws IllegalAccessException the illegal access exception
*/
@Nullable @Nullable
Object invokeOrigin(@Nullable Object thisObject, Object[] args) throws InvocationTargetException, IllegalAccessException; Object invokeOrigin(@Nullable Object thisObject, Object[] args) throws InvocationTargetException, IllegalAccessException;
/**
* Invoke origin object.
*
* @return the object
* @throws InvocationTargetException the invocation target exception
* @throws IllegalAccessException the illegal access exception
*/
@Nullable @Nullable
Object invokeOrigin() throws InvocationTargetException, IllegalAccessException; Object invokeOrigin() throws InvocationTargetException, IllegalAccessException;
/**
* Sets extra.
*
* @param <U> the type parameter
* @param key the key
* @param value the value
* @throws ConcurrentModificationException the concurrent modification exception
*/
<U> void setExtra(@NonNull String key, @Nullable U value) throws ConcurrentModificationException; <U> void setExtra(@NonNull String key, @Nullable U value) throws ConcurrentModificationException;
} }
/**
* The interface After hook callback.
*
* @param <T> the type parameter
*/
interface AfterHookCallback<T> { interface AfterHookCallback<T> {
/**
* Gets origin.
*
* @return the origin
*/
@NonNull @NonNull
T getOrigin(); T getOrigin();
/**
* Gets this.
*
* @return the this
*/
@Nullable @Nullable
Object getThis(); Object getThis();
/**
* Get args object [ ].
*
* @return the object [ ]
*/
@NonNull @NonNull
Object[] getArgs(); Object[] getArgs();
/**
* Gets result.
*
* @return the result
*/
@Nullable @Nullable
Object getResult(); Object getResult();
/**
* Gets throwable.
*
* @return the throwable
*/
@Nullable @Nullable
Throwable getThrowable(); Throwable getThrowable();
/**
* Is skipped boolean.
*
* @return the boolean
*/
boolean isSkipped(); boolean isSkipped();
/**
* Sets result.
*
* @param result the result
*/
void setResult(@Nullable Object result); void setResult(@Nullable Object result);
/**
* Sets throwable.
*
* @param throwable the throwable
*/
void setThrowable(@Nullable Throwable throwable); void setThrowable(@Nullable Throwable throwable);
/**
* Invoke origin object.
*
* @param thisObject the this object
* @param args the args
* @return the object
* @throws InvocationTargetException the invocation target exception
* @throws IllegalAccessException the illegal access exception
*/
@Nullable @Nullable
Object invokeOrigin(@Nullable Object thisObject, Object[] args) throws InvocationTargetException, IllegalAccessException; Object invokeOrigin(@Nullable Object thisObject, Object[] args) throws InvocationTargetException, IllegalAccessException;
/**
* Invoke origin object.
*
* @return the object
* @throws InvocationTargetException the invocation target exception
* @throws IllegalAccessException the illegal access exception
*/
@Nullable @Nullable
Object invokeOrigin() throws InvocationTargetException, IllegalAccessException; Object invokeOrigin() throws InvocationTargetException, IllegalAccessException;
/**
* Gets extra.
*
* @param <U> the type parameter
* @param key the key
* @return the extra
*/
@Nullable @Nullable
<U> U getExtra(@NonNull String key); <U> U getExtra(@NonNull String key);
} }
/**
* The interface Before hooker.
*
* @param <T> the type parameter
*/
interface BeforeHooker<T> { interface BeforeHooker<T> {
/**
* Before.
*
* @param callback the callback
*/
void before(@NonNull BeforeHookCallback<T> callback); void before(@NonNull BeforeHookCallback<T> callback);
} }
/**
* The interface After hooker.
*
* @param <T> the type parameter
*/
interface AfterHooker<T> { interface AfterHooker<T> {
/**
* After.
*
* @param callback the callback
*/
void after(@NonNull AfterHookCallback<T> callback); void after(@NonNull AfterHookCallback<T> callback);
} }
/**
* The interface Hooker.
*
* @param <T> the type parameter
*/
interface Hooker<T> extends BeforeHooker<T>, AfterHooker<T> { interface Hooker<T> extends BeforeHooker<T>, AfterHooker<T> {
} }
/**
* The interface Method unhooker.
*
* @param <T> the type parameter
* @param <U> the type parameter
*/
interface MethodUnhooker<T, U> { interface MethodUnhooker<T, U> {
/**
* Gets origin.
*
* @return the origin
*/
@NonNull @NonNull
U getOrigin(); U getOrigin();
/**
* Gets hooker.
*
* @return the hooker
*/
@NonNull @NonNull
T getHooker(); T getHooker();
/**
* Unhook.
*/
void unhook(); void unhook();
} }
/**
* Gets framework name.
*
* @return the framework name
*/
@NonNull @NonNull
String getFrameworkName(); String getFrameworkName();
/**
* Gets framework version.
*
* @return the framework version
*/
@NonNull @NonNull
String getFrameworkVersion(); String getFrameworkVersion();
/**
* Gets framework version code.
*
* @return the framework version code
*/
long getFrameworkVersionCode(); long getFrameworkVersionCode();
/**
* Gets framework privilege.
*
* @return the framework privilege
*/
int getFrameworkPrivilege(); int getFrameworkPrivilege();
/**
* Featured method object.
*
* @param name the name
* @param args the args
* @return the object
*/
Object featuredMethod(String name, Object... args); Object featuredMethod(String name, Object... args);
/**
* Hook before method unhooker.
*
* @param origin the origin
* @param hooker the hooker
* @return the method unhooker
*/
@Nullable @Nullable
MethodUnhooker<BeforeHooker<Method>, Method> hookBefore(@NonNull Method origin, @NonNull BeforeHooker<Method> hooker); MethodUnhooker<BeforeHooker<Method>, Method> hookBefore(@NonNull Method origin, @NonNull BeforeHooker<Method> hooker);
/**
* Hook after method unhooker.
*
* @param origin the origin
* @param hooker the hooker
* @return the method unhooker
*/
@Nullable @Nullable
MethodUnhooker<AfterHooker<Method>, Method> hookAfter(@NonNull Method origin, @NonNull AfterHooker<Method> hooker); MethodUnhooker<AfterHooker<Method>, Method> hookAfter(@NonNull Method origin, @NonNull AfterHooker<Method> hooker);
/**
* Hook method unhooker.
*
* @param origin the origin
* @param hooker the hooker
* @return the method unhooker
*/
@Nullable @Nullable
MethodUnhooker<Hooker<Method>, Method> hook(@NonNull Method origin, @NonNull Hooker<Method> hooker); MethodUnhooker<Hooker<Method>, Method> hook(@NonNull Method origin, @NonNull Hooker<Method> hooker);
/**
* Hook before method unhooker.
*
* @param origin the origin
* @param priority the priority
* @param hooker the hooker
* @return the method unhooker
*/
@Nullable @Nullable
MethodUnhooker<BeforeHooker<Method>, Method> hookBefore(@NonNull Method origin, int priority, @NonNull BeforeHooker<Method> hooker); MethodUnhooker<BeforeHooker<Method>, Method> hookBefore(@NonNull Method origin, int priority, @NonNull BeforeHooker<Method> hooker);
/**
* Hook after method unhooker.
*
* @param origin the origin
* @param priority the priority
* @param hooker the hooker
* @return the method unhooker
*/
@Nullable @Nullable
MethodUnhooker<AfterHooker<Method>, Method> hookAfter(@NonNull Method origin, int priority, @NonNull AfterHooker<Method> hooker); MethodUnhooker<AfterHooker<Method>, Method> hookAfter(@NonNull Method origin, int priority, @NonNull AfterHooker<Method> hooker);
/**
* Hook method unhooker.
*
* @param origin the origin
* @param priority the priority
* @param hooker the hooker
* @return the method unhooker
*/
@Nullable @Nullable
MethodUnhooker<Hooker<Method>, Method> hook(@NonNull Method origin, int priority, @NonNull Hooker<Method> hooker); MethodUnhooker<Hooker<Method>, Method> hook(@NonNull Method origin, int priority, @NonNull Hooker<Method> hooker);
/**
* Hook before method unhooker.
*
* @param <T> the type parameter
* @param origin the origin
* @param hooker the hooker
* @return the method unhooker
*/
@Nullable @Nullable
<T> MethodUnhooker<BeforeHooker<Constructor<T>>, Constructor<T>> hookBefore(@NonNull Constructor<T> origin, @NonNull BeforeHooker<Constructor<T>> hooker); <T> MethodUnhooker<BeforeHooker<Constructor<T>>, Constructor<T>> hookBefore(@NonNull Constructor<T> origin, @NonNull BeforeHooker<Constructor<T>> hooker);
/**
* Hook after method unhooker.
*
* @param <T> the type parameter
* @param origin the origin
* @param hooker the hooker
* @return the method unhooker
*/
@Nullable @Nullable
<T> MethodUnhooker<AfterHooker<Constructor<T>>, Constructor<T>> hookAfter(@NonNull Constructor<T> origin, @NonNull AfterHooker<Constructor<T>> hooker); <T> MethodUnhooker<AfterHooker<Constructor<T>>, Constructor<T>> hookAfter(@NonNull Constructor<T> origin, @NonNull AfterHooker<Constructor<T>> hooker);
/**
* Hook method unhooker.
*
* @param <T> the type parameter
* @param origin the origin
* @param hooker the hooker
* @return the method unhooker
*/
@Nullable @Nullable
<T> MethodUnhooker<Hooker<Constructor<T>>, Constructor<T>> hook(@NonNull Constructor<T> origin, @NonNull Hooker<Constructor<T>> hooker); <T> MethodUnhooker<Hooker<Constructor<T>>, Constructor<T>> hook(@NonNull Constructor<T> origin, @NonNull Hooker<Constructor<T>> hooker);
/**
* Hook before method unhooker.
*
* @param <T> the type parameter
* @param origin the origin
* @param priority the priority
* @param hooker the hooker
* @return the method unhooker
*/
@Nullable @Nullable
<T> MethodUnhooker<BeforeHooker<Constructor<T>>, Constructor<T>> hookBefore(@NonNull Constructor<T> origin, int priority, @NonNull BeforeHooker<Constructor<T>> hooker); <T> MethodUnhooker<BeforeHooker<Constructor<T>>, Constructor<T>> hookBefore(@NonNull Constructor<T> origin, int priority, @NonNull BeforeHooker<Constructor<T>> hooker);
/**
* Hook after method unhooker.
*
* @param <T> the type parameter
* @param origin the origin
* @param priority the priority
* @param hooker the hooker
* @return the method unhooker
*/
@Nullable @Nullable
<T> MethodUnhooker<AfterHooker<Constructor<T>>, Constructor<T>> hookAfter(@NonNull Constructor<T> origin, int priority, @NonNull AfterHooker<Constructor<T>> hooker); <T> MethodUnhooker<AfterHooker<Constructor<T>>, Constructor<T>> hookAfter(@NonNull Constructor<T> origin, int priority, @NonNull AfterHooker<Constructor<T>> hooker);
/**
* Hook method unhooker.
*
* @param <T> the type parameter
* @param origin the origin
* @param priority the priority
* @param hooker the hooker
* @return the method unhooker
*/
@Nullable @Nullable
<T> MethodUnhooker<Hooker<Constructor<T>>, Constructor<T>> hook(@NonNull Constructor<T> origin, int priority, @NonNull Hooker<Constructor<T>> hooker); <T> MethodUnhooker<Hooker<Constructor<T>>, Constructor<T>> hook(@NonNull Constructor<T> origin, int priority, @NonNull Hooker<Constructor<T>> hooker);
/**
* Deoptimize boolean.
*
* @param method the method
* @return the boolean
*/
boolean deoptimize(@NonNull Method method); boolean deoptimize(@NonNull Method method);
/**
* Deoptimize boolean.
*
* @param <T> the type parameter
* @param constructor the constructor
* @return the boolean
*/
<T> boolean deoptimize(@NonNull Constructor<T> constructor); <T> boolean deoptimize(@NonNull Constructor<T> constructor);
/**
* Log.
*
* @param message the message
*/
void log(@NonNull String message); void log(@NonNull String message);
/**
* Log.
*
* @param message the message
* @param throwable the throwable
*/
void log(@NonNull String message, @NonNull Throwable throwable); void log(@NonNull String message, @NonNull Throwable throwable);
/**
* Parse dex dex parser.
*
* @param dexData the dex data
* @param includeAnnotations the include annotations
* @return the dex parser
* @throws IOException the io exception
*/
@Nullable @Nullable
DexParser parseDex(@NonNull ByteBuffer dexData, boolean includeAnnotations) throws IOException; DexParser parseDex(@NonNull ByteBuffer dexData, boolean includeAnnotations) throws IOException;
} }

View File

@ -2,8 +2,17 @@ package io.github.libxposed;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
/**
* The type Xposed module.
*/
@SuppressWarnings("unused") @SuppressWarnings("unused")
public abstract class XposedModule extends XposedContextWrapper implements XposedModuleInterface { public abstract class XposedModule extends XposedContextWrapper implements XposedModuleInterface {
/**
* Instantiates a new Xposed module.
*
* @param base the base
* @param param the param
*/
public XposedModule(XposedContext base, @NonNull ModuleLoadedParam param) { public XposedModule(XposedContext base, @NonNull ModuleLoadedParam param) {
super(base); super(base);
} }

View File

@ -6,39 +6,103 @@ import android.os.Bundle;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
/**
* The interface Xposed module interface.
*/
@SuppressWarnings("unused") @SuppressWarnings("unused")
public interface XposedModuleInterface { public interface XposedModuleInterface {
/**
* The interface Module loaded param.
*/
interface ModuleLoadedParam { interface ModuleLoadedParam {
/**
* Is system server boolean.
*
* @return the boolean
*/
boolean isSystemServer(); boolean isSystemServer();
/**
* Gets process name.
*
* @return the process name
*/
@NonNull @NonNull
String getProcessName(); String getProcessName();
/**
* Gets app data dir.
*
* @return the app data dir
*/
@NonNull @NonNull
String getAppDataDir(); String getAppDataDir();
/**
* Gets extras.
*
* @return the extras
*/
@Nullable @Nullable
Bundle getExtras(); Bundle getExtras();
} }
/**
* The interface Package loaded param.
*/
interface PackageLoadedParam { interface PackageLoadedParam {
/**
* Gets package name.
*
* @return the package name
*/
@NonNull @NonNull
String getPackageName(); String getPackageName();
/**
* Gets app info.
*
* @return the app info
*/
@NonNull @NonNull
ApplicationInfo getAppInfo(); ApplicationInfo getAppInfo();
/**
* Gets class loader.
*
* @return the class loader
*/
@NonNull @NonNull
ClassLoader getClassLoader(); ClassLoader getClassLoader();
/**
* Gets process name.
*
* @return the process name
*/
@NonNull @NonNull
String getProcessName(); String getProcessName();
/**
* Is first application boolean.
*
* @return the boolean
*/
boolean isFirstApplication(); boolean isFirstApplication();
/**
* Gets extras.
*
* @return the extras
*/
@Nullable @Nullable
Bundle getExtras(); Bundle getExtras();
} }
/**
* On package loaded.
*
* @param param the param
*/
void onPackageLoaded(@NonNull PackageLoadedParam param); void onPackageLoaded(@NonNull PackageLoadedParam param);
} }

View File

@ -5,130 +5,372 @@ import androidx.annotation.Nullable;
import java.io.Closeable; import java.io.Closeable;
/**
* The interface Dex parser.
*/
@SuppressWarnings("unused") @SuppressWarnings("unused")
public interface DexParser extends Closeable { public interface DexParser extends Closeable {
/**
* The constant NO_INDEX.
*/
int NO_INDEX = 0xffffffff; int NO_INDEX = 0xffffffff;
/**
* The interface Array.
*/
interface Array { interface Array {
/**
* Get values value [ ].
*
* @return the value [ ]
*/
@NonNull @NonNull
Value[] getValues(); Value[] getValues();
} }
/**
* The interface Annotation.
*/
interface Annotation { interface Annotation {
/**
* Gets visibility.
*
* @return the visibility
*/
int getVisibility(); int getVisibility();
/**
* Gets type.
*
* @return the type
*/
@NonNull @NonNull
TypeId getType(); TypeId getType();
/**
* Get elements element [ ].
*
* @return the element [ ]
*/
@NonNull @NonNull
Element[] getElements(); Element[] getElements();
} }
/**
* The interface Value.
*/
interface Value { interface Value {
/**
* Get value byte [ ].
*
* @return the byte [ ]
*/
@Nullable @Nullable
byte[] getValue(); byte[] getValue();
/**
* Gets value type.
*
* @return the value type
*/
int getValueType(); int getValueType();
} }
/**
* The interface Element.
*/
interface Element extends Value { interface Element extends Value {
/**
* Gets name.
*
* @return the name
*/
@NonNull @NonNull
StringId getName(); StringId getName();
} }
/**
* The interface Type id.
*/
interface TypeId { interface TypeId {
/**
* Gets descriptor.
*
* @return the descriptor
*/
@NonNull @NonNull
StringId getDescriptor(); StringId getDescriptor();
} }
/**
* The interface Id.
*/
interface Id { interface Id {
/**
* Gets id.
*
* @return the id
*/
int getId(); int getId();
} }
/**
* The interface String id.
*/
interface StringId extends Id { interface StringId extends Id {
/**
* Gets string.
*
* @return the string
*/
@NonNull @NonNull
String getString(); String getString();
} }
/**
* The interface Field id.
*/
interface FieldId extends Id { interface FieldId extends Id {
/**
* Gets type.
*
* @return the type
*/
@NonNull @NonNull
TypeId getType(); TypeId getType();
/**
* Gets declaring class.
*
* @return the declaring class
*/
@NonNull @NonNull
TypeId getDeclaringClass(); TypeId getDeclaringClass();
/**
* Gets name.
*
* @return the name
*/
@NonNull @NonNull
StringId getName(); StringId getName();
} }
/**
* The interface Method id.
*/
interface MethodId extends Id { interface MethodId extends Id {
/**
* Gets declaring class.
*
* @return the declaring class
*/
@NonNull @NonNull
TypeId getDeclaringClass(); TypeId getDeclaringClass();
/**
* Gets prototype.
*
* @return the prototype
*/
@NonNull @NonNull
ProtoId getPrototype(); ProtoId getPrototype();
/**
* Gets name.
*
* @return the name
*/
@NonNull @NonNull
StringId getName(); StringId getName();
} }
/**
* The interface Proto id.
*/
interface ProtoId extends Id { interface ProtoId extends Id {
/**
* Gets shorty.
*
* @return the shorty
*/
@NonNull @NonNull
StringId getShorty(); StringId getShorty();
/**
* Gets return type.
*
* @return the return type
*/
@NonNull @NonNull
TypeId getReturnType(); TypeId getReturnType();
/**
* Get parameters type id [ ].
*
* @return the type id [ ]
*/
@Nullable @Nullable
TypeId[] getParameters(); TypeId[] getParameters();
} }
/**
* Get string id string id [ ].
*
* @return the string id [ ]
*/
@NonNull @NonNull
StringId[] getStringId(); StringId[] getStringId();
/**
* Get type id type id [ ].
*
* @return the type id [ ]
*/
@NonNull @NonNull
TypeId[] getTypeId(); TypeId[] getTypeId();
/**
* Get field id field id [ ].
*
* @return the field id [ ]
*/
@NonNull @NonNull
FieldId[] getFieldId(); FieldId[] getFieldId();
/**
* Get method id method id [ ].
*
* @return the method id [ ]
*/
@NonNull @NonNull
MethodId[] getMethodId(); MethodId[] getMethodId();
/**
* Get proto id proto id [ ].
*
* @return the proto id [ ]
*/
@NonNull @NonNull
ProtoId[] getProtoId(); ProtoId[] getProtoId();
/**
* Get annotations annotation [ ].
*
* @return the annotation [ ]
*/
@NonNull @NonNull
Annotation[] getAnnotations(); Annotation[] getAnnotations();
/**
* Get arrays array [ ].
*
* @return the array [ ]
*/
@NonNull @NonNull
Array[] getArrays(); Array[] getArrays();
/**
* The interface Early stop visitor.
*/
interface EarlyStopVisitor { interface EarlyStopVisitor {
/**
* Stop boolean.
*
* @return the boolean
*/
boolean stop(); boolean stop();
} }
/**
* The interface Member visitor.
*/
interface MemberVisitor extends EarlyStopVisitor { interface MemberVisitor extends EarlyStopVisitor {
} }
/**
* The interface Class visitor.
*/
interface ClassVisitor extends EarlyStopVisitor { interface ClassVisitor extends EarlyStopVisitor {
/**
* Visit member visitor.
*
* @param clazz the clazz
* @param accessFlags the access flags
* @param superClass the super class
* @param interfaces the interfaces
* @param sourceFile the source file
* @param staticFields the static fields
* @param staticFieldsAccessFlags the static fields access flags
* @param instanceFields the instance fields
* @param instanceFieldsAccessFlags the instance fields access flags
* @param directMethods the direct methods
* @param directMethodsAccessFlags the direct methods access flags
* @param virtualMethods the virtual methods
* @param virtualMethodsAccessFlags the virtual methods access flags
* @param annotations the annotations
* @return the member visitor
*/
@Nullable @Nullable
MemberVisitor visit(int clazz, int accessFlags, int superClass, @NonNull int[] interfaces, int sourceFile, @NonNull int[] staticFields, @NonNull int[] staticFieldsAccessFlags, @NonNull int[] instanceFields, @NonNull int[] instanceFieldsAccessFlags, @NonNull int[] directMethods, @NonNull int[] directMethodsAccessFlags, @NonNull int[] virtualMethods, @NonNull int[] virtualMethodsAccessFlags, @NonNull int[] annotations); MemberVisitor visit(int clazz, int accessFlags, int superClass, @NonNull int[] interfaces, int sourceFile, @NonNull int[] staticFields, @NonNull int[] staticFieldsAccessFlags, @NonNull int[] instanceFields, @NonNull int[] instanceFieldsAccessFlags, @NonNull int[] directMethods, @NonNull int[] directMethodsAccessFlags, @NonNull int[] virtualMethods, @NonNull int[] virtualMethodsAccessFlags, @NonNull int[] annotations);
} }
/**
* The interface Field visitor.
*/
interface FieldVisitor extends MemberVisitor { interface FieldVisitor extends MemberVisitor {
/**
* Visit.
*
* @param field the field
* @param accessFlags the access flags
* @param annotations the annotations
*/
void visit(int field, int accessFlags, @NonNull int[] annotations); void visit(int field, int accessFlags, @NonNull int[] annotations);
} }
/**
* The interface Method visitor.
*/
interface MethodVisitor extends MemberVisitor { interface MethodVisitor extends MemberVisitor {
/**
* Visit method body visitor.
*
* @param method the method
* @param accessFlags the access flags
* @param hasBody the has body
* @param annotations the annotations
* @param parameterAnnotations the parameter annotations
* @return the method body visitor
*/
@Nullable @Nullable
MethodBodyVisitor visit(int method, int accessFlags, boolean hasBody, @NonNull int[] annotations, @NonNull int[] parameterAnnotations); MethodBodyVisitor visit(int method, int accessFlags, boolean hasBody, @NonNull int[] annotations, @NonNull int[] parameterAnnotations);
} }
/**
* The interface Method body visitor.
*/
interface MethodBodyVisitor { interface MethodBodyVisitor {
/**
* Visit.
*
* @param method the method
* @param accessFlags the access flags
* @param referredStrings the referred strings
* @param invokedMethods the invoked methods
* @param accessedFields the accessed fields
* @param assignedFields the assigned fields
* @param opcodes the opcodes
*/
void visit(int method, int accessFlags, @NonNull int[] referredStrings, @NonNull int[] invokedMethods, @NonNull int[] accessedFields, @NonNull int[] assignedFields, @NonNull byte[] opcodes); void visit(int method, int accessFlags, @NonNull int[] referredStrings, @NonNull int[] invokedMethods, @NonNull int[] accessedFields, @NonNull int[] assignedFields, @NonNull byte[] opcodes);
} }
/**
* Visit defined classes.
*
* @param visitor the visitor
* @throws IllegalStateException the illegal state exception
*/
void visitDefinedClasses(@NonNull ClassVisitor visitor) throws IllegalStateException; void visitDefinedClasses(@NonNull ClassVisitor visitor) throws IllegalStateException;
} }