Package proguard.evaluation.value.object
Class AnalyzedObjectFactory
java.lang.Object
proguard.evaluation.value.object.AnalyzedObjectFactory
Factory methods to create
AnalyzedObject.-
Method Summary
Modifier and TypeMethodDescriptionstatic AnalyzedObjectCreate aAnalyzedObject, representing the tracked value for a reference type.static AnalyzedObjectcreateDetailedArray(Value[] values, String type) Create a modeled object representing a detailed array (i.e., it's model is aArrayModel.static AnalyzedObjectcreateModeled(@NotNull Model value) Create an object the value of which is modeled.static AnalyzedObjectCreate an object with unknown type and null value.static AnalyzedObjectcreateNullOfType(@NotNull String type) Create an object with null value and known type.static AnalyzedObjectcreatePrecise(@NotNull Object value) Create a precise object wrapping the value.
-
Method Details
-
create
public static AnalyzedObject create(@Nullable @Nullable Object value, @Nullable @Nullable String type, @Nullable @Nullable Clazz referencedClass) Create aAnalyzedObject, representing the tracked value for a reference type. If an object is created successfully it is guaranteed to be modeled if the passed value was an instance ofModel.Consistency checks on the arguments are performed:
- If "value" is null and "referencedClass" isn't, "type" should match the type of "referencedClass"
- If "type" represents a primitive type or primitive array "referencedClass" should be null
- If "referencedClass" is not null, the type of "value" (or of the type modeled by "value"
if it is a
Model) has to be the same type of "referencedClass" or of a class inheriting from it. - If "referencedClass" is null, "type" needs to match the type of "value" (or of the type
modeled by "value" if it is a
Model)
- Parameters:
value- the value of the tracked object. Can be the actual value or aModel. null iff the tracked value is nulltype- the type of the value. This should be the static type specified in the method signature, might not correspond to the type returned by the createdAnalyzedObject.getType()because dynamic typing might be taken into consideration.referencedClass- the class referenced when the value is created (e.g., the class of the return value of a method call). Always null for primitive types (or arrays of primitive); can be null if the library class pool is missing or the class pool references have not been initialized; can also be null in some cases even if everything has been initialized. For this reason this is used just for sanity checks when not-null, while it being null is not considered in any way as something incorrect.
-
createPrecise
Create a precise object wrapping the value.- Parameters:
value- The wrapped value
-
createModeled
Create an object the value of which is modeled.- Parameters:
value- The wrapped model
-
createNullOfType
Create an object with null value and known type.- Parameters:
type- The known type of the null object
-
createNull
Create an object with unknown type and null value. -
createDetailedArray
Create a modeled object representing a detailed array (i.e., it's model is aArrayModel.
-