Class ClassModel
java.lang.Object
proguard.evaluation.value.object.model.ClassModel
- All Implemented Interfaces:
Model,ReflectiveModel<ClassModel>
A
Model to track specific Clazz constants.-
Field Summary
Fields inherited from interface proguard.evaluation.value.object.model.reflective.ReflectiveModel
log -
Constructor Summary
ConstructorsConstructorDescriptionClassModel(@NotNull Class<?> clazz) Used for creating aClassModelfor any of the primitive classes.ClassModel(@NotNull Clazz clazz) Creates a newClassModelfor the givenClazz.ClassModel(String name) Creates a newClassModelfor an unknown class. -
Method Summary
Modifier and TypeMethodDescriptionboolean@Nullable ClazzgetClazz()Use this in caseisPrimitive()is true.@Nullable StringClass<?>Use this in caseisPrimitive()is false.@NotNull StringgetType()Returns the type of the modeled class.inthashCode()init(MethodExecutionInfo methodExecutionInfo, ValueCalculator valueCalculator) Execute a constructor call for the modeled class.booleanbooleantoString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface proguard.evaluation.value.object.model.reflective.ReflectiveModel
invoke, invokeStatic
-
Constructor Details
-
ClassModel
Creates a newClassModelfor the givenClazz.- Parameters:
clazz- The class to model.
-
ClassModel
Creates a newClassModelfor an unknown class.- Parameters:
name- The name of the class.
-
ClassModel
Used for creating aClassModelfor any of the primitive classes.- Parameters:
clazz- one of the primitive classes.int.class,boolean.class, ...- Throws:
IllegalArgumentException- iff a non-primitiveClassobject is passed.
-
-
Method Details
-
getClazz
Use this in caseisPrimitive()is true. Otherwise, usegetPrimitiveClass()- Returns:
- the modeled
Clazz. - Throws:
IllegalArgumentException- if a primitive class is modeled.
-
getPrimitiveClass
Use this in caseisPrimitive()is false. Otherwise, usegetClazz().- Returns:
- the modeled
Class. - Throws:
IllegalArgumentException- if a non-primitive class is modeled.
-
isPrimitive
public boolean isPrimitive() -
isUnknown
public boolean isUnknown() -
getModeledClassName
- Returns:
- the name of the modeled class.
-
getType
Description copied from interface:ModelReturns the type of the modeled class. -
init
Description copied from interface:ModelExecute 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.
- Specified by:
initin interfaceModel- Specified by:
initin interfaceReflectiveModel<ClassModel>- Parameters:
methodExecutionInfo- execution info of the target method.valueCalculator- the value calculator that should be used to create any value in the result.- Returns:
- 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
-
hashCode
public int hashCode() -
toString
-