类 ClassModel

java.lang.Object
proguard.evaluation.value.object.model.ClassModel
所有已实现的接口:
Model, ReflectiveModel<ClassModel>

public class ClassModel extends Object implements ReflectiveModel<ClassModel>
A Model to track specific Clazz constants.
  • 构造器详细资料

    • ClassModel

      public ClassModel(@NotNull @NotNull Clazz clazz)
      Creates a new ClassModel for the given Clazz.
      参数:
      clazz - The class to model.
    • ClassModel

      public ClassModel(String name)
      Creates a new ClassModel for an unknown class.
      参数:
      name - The name of the class.
    • ClassModel

      public ClassModel(@NotNull @NotNull Class<?> clazz)
      Used for creating a ClassModel for any of the primitive classes.
      参数:
      clazz - one of the primitive classes. int.class,boolean.class, ...
      抛出:
      IllegalArgumentException - iff a non-primitive Class object is passed.
  • 方法详细资料

    • getClazz

      @Nullable public @Nullable Clazz getClazz()
      Use this in case isPrimitive() is true. Otherwise, use getPrimitiveClass()
      返回:
      the modeled Clazz.
      抛出:
      IllegalArgumentException - if a primitive class is modeled.
    • getPrimitiveClass

      public Class<?> getPrimitiveClass()
      Use this in case isPrimitive() is false. Otherwise, use getClazz().
      返回:
      the modeled Class.
      抛出:
      IllegalArgumentException - if a non-primitive class is modeled.
    • isPrimitive

      public boolean isPrimitive()
    • isUnknown

      public boolean isUnknown()
    • getModeledClassName

      @Nullable public @Nullable String getModeledClassName()
      返回:
      the name of the modeled class.
    • getType

      @NotNull public @NotNull String getType()
      从接口复制的说明: Model
      Returns the type of the modeled class.
      指定者:
      getType 在接口中 Model
    • init

      public MethodResult init(MethodExecutionInfo methodExecutionInfo, ValueCalculator valueCalculator)
      从接口复制的说明: Model
      Execute a constructor call for the modeled class.

      It is suggested to add logic to allow running this only on a dummy model without any state.

      指定者:
      init 在接口中 Model
      指定者:
      init 在接口中 ReflectiveModel<ClassModel>
      参数:
      methodExecutionInfo - execution info of the target method.
      valueCalculator - the value calculator that should be used to create any value in the result.
      返回:
      the result of the method invocation. Since it's a constructor invocation the return value of the result is expected to be empty and the constructed value should be set as the updated instance.
    • equals

      public boolean equals(Object o)
      覆盖:
      equals 在类中 Object
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Object
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object