Package proguard.evaluation.value
Class BasicValueFactory
java.lang.Object
proguard.evaluation.value.BasicValueFactory
- All Implemented Interfaces:
ValueFactory
- Direct Known Subclasses:
ParticularValueFactory,PrimitiveTypedReferenceValueFactory,TypedReferenceValueFactory
This class provides methods to create and reuse Value instances.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DoubleValuestatic final FloatValuestatic final IntegerValuestatic final LongValuestatic final ReferenceValuestatic final UnknownValue -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidcheckCreationLocation(CodeLocation creationLocation) protected static voidcreateArrayReferenceValue(String type, Clazz referencedClass, IntegerValue arrayLength) Creates a new ReferenceValue that represents a non-null array with elements of the given type, with the given length.createArrayReferenceValue(String type, Clazz referencedClass, IntegerValue arrayLength, Object elementValues) Creates a new ReferenceValue that represents a non-null array with elements of the given type, with the given length and initial element values.Creates a new DoubleValue with an undefined value.createDoubleValue(double value) Creates a new DoubleValue with a given particular value.Creates a new FloatValue with an undefined value.createFloatValue(float value) Creates a new FloatValue with a given particular value.Creates a new IntegerValue with an undefined value.createIntegerValue(int value) Creates a new IntegerValue with a given particular value.createIntegerValue(int min, int max) Creates a new IntegerValue with a given possible range.Creates a new LongValue with an undefined value.createLongValue(long value) Creates a new LongValue with a given particular value.Creates a new ReferenceValue of an undefined type.createReferenceValue(String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull) Creates a new ReferenceValue that represents the given type.createReferenceValue(String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, Object value) Deprecated.createReferenceValue(String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, CodeLocation creationLocation) Creates a new ReferenceValue that represents the given type, created at the specified code location.createReferenceValue(String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, Clazz creationClass, Method creationMethod, int creationOffset) Deprecated.createReferenceValue(String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, Clazz creationClass, Method creationMethod, int creationOffset, Object value) Deprecated.createReferenceValue(Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, @NotNull AnalyzedObject value) Creates a new ReferenceValue that represents the given type.createReferenceValue(Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, CodeLocation creationLocation, @NotNull AnalyzedObject value) Creates a new ReferenceValue that represents the given type, created at the specified code location.createReferenceValueForId(String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, Object id) Creates a new ReferenceValue that represents the given type with a specified ID.createReferenceValueForId(String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, Object id, Object value) Deprecated.createReferenceValueForId(Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, Object id, @NotNull AnalyzedObject value) Creates a new ReferenceValue that represents the given type with a specified ID.Creates a new ReferenceValue that representsnull.createValue(String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull) Creates a new Value of the given type.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface proguard.evaluation.value.ValueFactory
createReferenceValue, createReferenceValue, createReferenceValue
-
Field Details
-
UNKNOWN_VALUE
-
INTEGER_VALUE
-
LONG_VALUE
-
FLOAT_VALUE
-
DOUBLE_VALUE
-
REFERENCE_VALUE
-
-
Constructor Details
-
BasicValueFactory
public BasicValueFactory()
-
-
Method Details
-
createValue
public Value createValue(String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull) Description copied from interface:ValueFactoryCreates a new Value of the given type. The type must be a fully specified internal type for primitives, classes, or arrays.- Specified by:
createValuein interfaceValueFactory
-
createIntegerValue
Description copied from interface:ValueFactoryCreates a new IntegerValue with an undefined value.- Specified by:
createIntegerValuein interfaceValueFactory
-
createIntegerValue
Description copied from interface:ValueFactoryCreates a new IntegerValue with a given particular value.- Specified by:
createIntegerValuein interfaceValueFactory
-
createIntegerValue
Description copied from interface:ValueFactoryCreates a new IntegerValue with a given possible range.- Specified by:
createIntegerValuein interfaceValueFactory
-
createLongValue
Description copied from interface:ValueFactoryCreates a new LongValue with an undefined value.- Specified by:
createLongValuein interfaceValueFactory
-
createLongValue
Description copied from interface:ValueFactoryCreates a new LongValue with a given particular value.- Specified by:
createLongValuein interfaceValueFactory
-
createFloatValue
Description copied from interface:ValueFactoryCreates a new FloatValue with an undefined value.- Specified by:
createFloatValuein interfaceValueFactory
-
createFloatValue
Description copied from interface:ValueFactoryCreates a new FloatValue with a given particular value.- Specified by:
createFloatValuein interfaceValueFactory
-
createDoubleValue
Description copied from interface:ValueFactoryCreates a new DoubleValue with an undefined value.- Specified by:
createDoubleValuein interfaceValueFactory
-
createDoubleValue
Description copied from interface:ValueFactoryCreates a new DoubleValue with a given particular value.- Specified by:
createDoubleValuein interfaceValueFactory
-
createReferenceValue
Description copied from interface:ValueFactoryCreates a new ReferenceValue of an undefined type.- Specified by:
createReferenceValuein interfaceValueFactory
-
createReferenceValueNull
Description copied from interface:ValueFactoryCreates a new ReferenceValue that representsnull.- Specified by:
createReferenceValueNullin interfaceValueFactory
-
createReferenceValue
public ReferenceValue createReferenceValue(String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull) Description copied from interface:ValueFactoryCreates a new ReferenceValue that represents the given type. The type must be an internal class name or an array type. If the type isnull, the ReferenceValue representsnull.- Specified by:
createReferenceValuein interfaceValueFactory
-
createReferenceValue
@Deprecated public ReferenceValue createReferenceValue(String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, Object value) Deprecated.Deprecated, usecreateReferenceValue(Clazz, boolean, boolean, AnalyzedObject).- Specified by:
createReferenceValuein interfaceValueFactory
-
createReferenceValue
public ReferenceValue createReferenceValue(Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, @NotNull @NotNull AnalyzedObject value) Description copied from interface:ValueFactoryCreates a new ReferenceValue that represents the given type. The type must be an internal class name or an array type. If the type isnull, the ReferenceValue representsnull.The object wrapped by
AnalyzedObjectis either the value of the reference during execution or aModelof it.- Specified by:
createReferenceValuein interfaceValueFactory
-
createReferenceValue
@Deprecated public ReferenceValue createReferenceValue(String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, Clazz creationClass, Method creationMethod, int creationOffset) Deprecated.- Specified by:
createReferenceValuein interfaceValueFactory
-
createReferenceValue
public ReferenceValue createReferenceValue(String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, CodeLocation creationLocation) Description copied from interface:ValueFactoryCreates a new ReferenceValue that represents the given type, created at the specified code location. The type must be an internal class name or an array type. If the type isnull, the ReferenceValue representsnull.- Specified by:
createReferenceValuein interfaceValueFactory
-
createReferenceValue
@Deprecated public ReferenceValue createReferenceValue(String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, Clazz creationClass, Method creationMethod, int creationOffset, Object value) Deprecated.- Specified by:
createReferenceValuein interfaceValueFactory
-
createReferenceValue
public ReferenceValue createReferenceValue(Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, CodeLocation creationLocation, @NotNull @NotNull AnalyzedObject value) Description copied from interface:ValueFactoryCreates a new ReferenceValue that represents the given type, created at the specified code location. The type must be an internal class name or an array type. If the type isnull, the ReferenceValue representsnull.The object wrapped by
AnalyzedObjectis either the value of the reference during execution or aModelof it.- Specified by:
createReferenceValuein interfaceValueFactory
-
createReferenceValueForId
public ReferenceValue createReferenceValueForId(String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, Object id) Description copied from interface:ValueFactoryCreates a new ReferenceValue that represents the given type with a specified ID. The type must be an internal class name or an array type. If the type isnull, the ReferenceValue representsnull.- Specified by:
createReferenceValueForIdin interfaceValueFactory
-
createReferenceValueForId
@Deprecated public ReferenceValue createReferenceValueForId(String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, Object id, Object value) Deprecated.- Specified by:
createReferenceValueForIdin interfaceValueFactory
-
createReferenceValueForId
public ReferenceValue createReferenceValueForId(Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, Object id, @NotNull @NotNull AnalyzedObject value) Description copied from interface:ValueFactoryCreates a new ReferenceValue that represents the given type with a specified ID. The type must be an internal class name or an array type. If the type isnull, the ReferenceValue representsnull.The object wrapped by
AnalyzedObjectis either the value of the reference during execution or aModelof it.- Specified by:
createReferenceValueForIdin interfaceValueFactory
-
createArrayReferenceValue
public ReferenceValue createArrayReferenceValue(String type, Clazz referencedClass, IntegerValue arrayLength) Description copied from interface:ValueFactoryCreates a new ReferenceValue that represents a non-null array with elements of the given type, with the given length.- Specified by:
createArrayReferenceValuein interfaceValueFactory
-
createArrayReferenceValue
public ReferenceValue createArrayReferenceValue(String type, Clazz referencedClass, IntegerValue arrayLength, Object elementValues) Description copied from interface:ValueFactoryCreates a new ReferenceValue that represents a non-null array with elements of the given type, with the given length and initial element values.- Specified by:
createArrayReferenceValuein interfaceValueFactory
-
checkReferenceValue
-
checkCreationLocation
-