Package proguard.evaluation.value
Class BasicValueFactory
- java.lang.Object
-
- proguard.evaluation.value.BasicValueFactory
-
- All Implemented Interfaces:
ValueFactory
- Direct Known Subclasses:
ParticularValueFactory
,PrimitiveTypedReferenceValueFactory
,TypedReferenceValueFactory
public class BasicValueFactory extends java.lang.Object implements ValueFactory
This class provides methods to create and reuse Value instances.
-
-
Field Summary
Fields Modifier and Type Field Description static DoubleValue
DOUBLE_VALUE
static FloatValue
FLOAT_VALUE
static IntegerValue
INTEGER_VALUE
static LongValue
LONG_VALUE
static ReferenceValue
REFERENCE_VALUE
static UnknownValue
UNKNOWN_VALUE
-
Constructor Summary
Constructors Constructor Description BasicValueFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected static void
checkCreationLocation(CodeLocation creationLocation)
protected static void
checkReferenceValue(AnalyzedObject value)
ReferenceValue
createArrayReferenceValue(java.lang.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.ReferenceValue
createArrayReferenceValue(java.lang.String type, Clazz referencedClass, IntegerValue arrayLength, java.lang.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.DoubleValue
createDoubleValue()
Creates a new DoubleValue with an undefined value.DoubleValue
createDoubleValue(double value)
Creates a new DoubleValue with a given particular value.FloatValue
createFloatValue()
Creates a new FloatValue with an undefined value.FloatValue
createFloatValue(float value)
Creates a new FloatValue with a given particular value.IntegerValue
createIntegerValue()
Creates a new IntegerValue with an undefined value.IntegerValue
createIntegerValue(int value)
Creates a new IntegerValue with a given particular value.IntegerValue
createIntegerValue(int min, int max)
Creates a new IntegerValue with a given possible range.LongValue
createLongValue()
Creates a new LongValue with an undefined value.LongValue
createLongValue(long value)
Creates a new LongValue with a given particular value.ReferenceValue
createReferenceValue()
Creates a new ReferenceValue of an undefined type.ReferenceValue
createReferenceValue(java.lang.String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull)
Creates a new ReferenceValue that represents the given type.ReferenceValue
createReferenceValue(java.lang.String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, java.lang.Object value)
Deprecated.ReferenceValue
createReferenceValue(java.lang.String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, Clazz creationClass, Method creationMethod, int creationOffset)
Creates a new ReferenceValue that represents the given type, created at the specified code location.ReferenceValue
createReferenceValue(java.lang.String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, Clazz creationClass, Method creationMethod, int creationOffset, java.lang.Object value)
Deprecated.ReferenceValue
createReferenceValue(Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, @NotNull AnalyzedObject value)
Creates a new ReferenceValue that represents the given type.ReferenceValue
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.ReferenceValue
createReferenceValueForId(java.lang.String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, java.lang.Object id)
Creates a new ReferenceValue that represents the given type with a specified ID.ReferenceValue
createReferenceValueForId(java.lang.String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, java.lang.Object id, java.lang.Object value)
Deprecated.ReferenceValue
createReferenceValueForId(Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, java.lang.Object id, @NotNull AnalyzedObject value)
Creates a new ReferenceValue that represents the given type with a specified ID.ReferenceValue
createReferenceValueNull()
Creates a new ReferenceValue that representsnull
.Value
createValue(java.lang.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, wait
-
Methods inherited from interface proguard.evaluation.value.ValueFactory
createReferenceValue, createReferenceValue, createReferenceValue
-
-
-
-
Field Detail
-
UNKNOWN_VALUE
public static final UnknownValue UNKNOWN_VALUE
-
INTEGER_VALUE
public static final IntegerValue INTEGER_VALUE
-
LONG_VALUE
public static final LongValue LONG_VALUE
-
FLOAT_VALUE
public static final FloatValue FLOAT_VALUE
-
DOUBLE_VALUE
public static final DoubleValue DOUBLE_VALUE
-
REFERENCE_VALUE
public static final ReferenceValue REFERENCE_VALUE
-
-
Method Detail
-
createValue
public Value createValue(java.lang.String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull)
Description copied from interface:ValueFactory
Creates a new Value of the given type. The type must be a fully specified internal type for primitives, classes, or arrays.- Specified by:
createValue
in interfaceValueFactory
-
createIntegerValue
public IntegerValue createIntegerValue()
Description copied from interface:ValueFactory
Creates a new IntegerValue with an undefined value.- Specified by:
createIntegerValue
in interfaceValueFactory
-
createIntegerValue
public IntegerValue createIntegerValue(int value)
Description copied from interface:ValueFactory
Creates a new IntegerValue with a given particular value.- Specified by:
createIntegerValue
in interfaceValueFactory
-
createIntegerValue
public IntegerValue createIntegerValue(int min, int max)
Description copied from interface:ValueFactory
Creates a new IntegerValue with a given possible range.- Specified by:
createIntegerValue
in interfaceValueFactory
-
createLongValue
public LongValue createLongValue()
Description copied from interface:ValueFactory
Creates a new LongValue with an undefined value.- Specified by:
createLongValue
in interfaceValueFactory
-
createLongValue
public LongValue createLongValue(long value)
Description copied from interface:ValueFactory
Creates a new LongValue with a given particular value.- Specified by:
createLongValue
in interfaceValueFactory
-
createFloatValue
public FloatValue createFloatValue()
Description copied from interface:ValueFactory
Creates a new FloatValue with an undefined value.- Specified by:
createFloatValue
in interfaceValueFactory
-
createFloatValue
public FloatValue createFloatValue(float value)
Description copied from interface:ValueFactory
Creates a new FloatValue with a given particular value.- Specified by:
createFloatValue
in interfaceValueFactory
-
createDoubleValue
public DoubleValue createDoubleValue()
Description copied from interface:ValueFactory
Creates a new DoubleValue with an undefined value.- Specified by:
createDoubleValue
in interfaceValueFactory
-
createDoubleValue
public DoubleValue createDoubleValue(double value)
Description copied from interface:ValueFactory
Creates a new DoubleValue with a given particular value.- Specified by:
createDoubleValue
in interfaceValueFactory
-
createReferenceValue
public ReferenceValue createReferenceValue()
Description copied from interface:ValueFactory
Creates a new ReferenceValue of an undefined type.- Specified by:
createReferenceValue
in interfaceValueFactory
-
createReferenceValueNull
public ReferenceValue createReferenceValueNull()
Description copied from interface:ValueFactory
Creates a new ReferenceValue that representsnull
.- Specified by:
createReferenceValueNull
in interfaceValueFactory
-
createReferenceValue
public ReferenceValue createReferenceValue(java.lang.String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull)
Description copied from interface:ValueFactory
Creates 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:
createReferenceValue
in interfaceValueFactory
-
createReferenceValue
@Deprecated public ReferenceValue createReferenceValue(java.lang.String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, java.lang.Object value)
Deprecated.Deprecated, usecreateReferenceValue(Clazz, boolean, boolean, AnalyzedObject)
.- Specified by:
createReferenceValue
in interfaceValueFactory
-
createReferenceValue
public ReferenceValue createReferenceValue(Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, @NotNull @NotNull AnalyzedObject value)
Description copied from interface:ValueFactory
Creates 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
AnalyzedObject
is either the value of the reference during execution or aModel
of it.- Specified by:
createReferenceValue
in interfaceValueFactory
-
createReferenceValue
public ReferenceValue createReferenceValue(java.lang.String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, Clazz creationClass, Method creationMethod, int creationOffset)
Description copied from interface:ValueFactory
Creates 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:
createReferenceValue
in interfaceValueFactory
-
createReferenceValue
@Deprecated public ReferenceValue createReferenceValue(java.lang.String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, Clazz creationClass, Method creationMethod, int creationOffset, java.lang.Object value)
Deprecated.- Specified by:
createReferenceValue
in interfaceValueFactory
-
createReferenceValue
public ReferenceValue createReferenceValue(Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, CodeLocation creationLocation, @NotNull @NotNull AnalyzedObject value)
Description copied from interface:ValueFactory
Creates 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
AnalyzedObject
is either the value of the reference during execution or aModel
of it.- Specified by:
createReferenceValue
in interfaceValueFactory
-
createReferenceValueForId
public ReferenceValue createReferenceValueForId(java.lang.String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, java.lang.Object id)
Description copied from interface:ValueFactory
Creates 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:
createReferenceValueForId
in interfaceValueFactory
-
createReferenceValueForId
@Deprecated public ReferenceValue createReferenceValueForId(java.lang.String type, Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, java.lang.Object id, java.lang.Object value)
Deprecated.- Specified by:
createReferenceValueForId
in interfaceValueFactory
-
createReferenceValueForId
public ReferenceValue createReferenceValueForId(Clazz referencedClass, boolean mayBeExtension, boolean mayBeNull, java.lang.Object id, @NotNull @NotNull AnalyzedObject value)
Description copied from interface:ValueFactory
Creates 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
AnalyzedObject
is either the value of the reference during execution or aModel
of it.- Specified by:
createReferenceValueForId
in interfaceValueFactory
-
createArrayReferenceValue
public ReferenceValue createArrayReferenceValue(java.lang.String type, Clazz referencedClass, IntegerValue arrayLength)
Description copied from interface:ValueFactory
Creates a new ReferenceValue that represents a non-null array with elements of the given type, with the given length.- Specified by:
createArrayReferenceValue
in interfaceValueFactory
-
createArrayReferenceValue
public ReferenceValue createArrayReferenceValue(java.lang.String type, Clazz referencedClass, IntegerValue arrayLength, java.lang.Object elementValues)
Description copied from interface:ValueFactory
Creates 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:
createArrayReferenceValue
in interfaceValueFactory
-
checkReferenceValue
protected static void checkReferenceValue(AnalyzedObject value)
-
checkCreationLocation
protected static void checkCreationLocation(CodeLocation creationLocation)
-
-