Package proguard.evaluation.value
Class ParticularValueFactory
- java.lang.Object
-
- proguard.evaluation.value.BasicValueFactory
-
- proguard.evaluation.value.ParticularValueFactory
-
- All Implemented Interfaces:
ValueFactory
- Direct Known Subclasses:
BasicRangeValueFactory
,IdentifiedValueFactory
public class ParticularValueFactory extends BasicValueFactory implements ValueFactory
This class provides methods to create and reuse Value instances that have particular values, whenever they are known.
-
-
Field Summary
Fields Modifier and Type Field Description protected ValueFactory
referenceValueFactory
-
Fields inherited from class proguard.evaluation.value.BasicValueFactory
DOUBLE_VALUE, FLOAT_VALUE, INTEGER_VALUE, LONG_VALUE, REFERENCE_VALUE, UNKNOWN_VALUE
-
-
Constructor Summary
Constructors Constructor Description ParticularValueFactory()
Creates a new ParticularValueFactory which does not keep track of particular references.ParticularValueFactory(ValueFactory referenceValueFactory)
Creates a new ParticularValueFactory, which uses the given valuefactory for both array and non-array reference construction.ParticularValueFactory(ValueFactory arrayReferenceValueFactory, ValueFactory referenceValueFactory)
Creates a new ParticularValueFactory.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description 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(double value)
Creates a new DoubleValue with a given particular value.FloatValue
createFloatValue(float value)
Creates a new FloatValue with a given particular value.IntegerValue
createIntegerValue(int value)
Creates a new IntegerValue with a given particular 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
.-
Methods inherited from class proguard.evaluation.value.BasicValueFactory
checkCreationLocation, checkReferenceValue, createDoubleValue, createFloatValue, createIntegerValue, createIntegerValue, createLongValue, createValue
-
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
createDoubleValue, createFloatValue, createIntegerValue, createIntegerValue, createLongValue, createReferenceValue, createReferenceValue, createReferenceValue, createValue
-
-
-
-
Field Detail
-
referenceValueFactory
protected final ValueFactory referenceValueFactory
-
-
Constructor Detail
-
ParticularValueFactory
public ParticularValueFactory()
Creates a new ParticularValueFactory which does not keep track of particular references.
-
ParticularValueFactory
public ParticularValueFactory(ValueFactory referenceValueFactory)
Creates a new ParticularValueFactory, which uses the given valuefactory for both array and non-array reference construction.
-
ParticularValueFactory
public ParticularValueFactory(ValueFactory arrayReferenceValueFactory, ValueFactory referenceValueFactory)
Creates a new ParticularValueFactory.- Parameters:
arrayReferenceValueFactory
- the valuefactory to delegate new array references to.referenceValueFactory
- the valuefactory to delegate new references to.
-
-
Method Detail
-
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
- Overrides:
createIntegerValue
in classBasicValueFactory
-
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
- Overrides:
createLongValue
in classBasicValueFactory
-
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
- Overrides:
createFloatValue
in classBasicValueFactory
-
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
- Overrides:
createDoubleValue
in classBasicValueFactory
-
createReferenceValue
public ReferenceValue createReferenceValue()
Description copied from interface:ValueFactory
Creates a new ReferenceValue of an undefined type.- Specified by:
createReferenceValue
in interfaceValueFactory
- Overrides:
createReferenceValue
in classBasicValueFactory
-
createReferenceValueNull
public ReferenceValue createReferenceValueNull()
Description copied from interface:ValueFactory
Creates a new ReferenceValue that representsnull
.- Specified by:
createReferenceValueNull
in interfaceValueFactory
- Overrides:
createReferenceValueNull
in classBasicValueFactory
-
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
- Overrides:
createReferenceValue
in classBasicValueFactory
-
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
- Overrides:
createReferenceValue
in classBasicValueFactory
-
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
- Overrides:
createReferenceValue
in classBasicValueFactory
-
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
- Overrides:
createReferenceValue
in classBasicValueFactory
-
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
- Overrides:
createReferenceValue
in classBasicValueFactory
-
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
- Overrides:
createReferenceValue
in classBasicValueFactory
-
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
- Overrides:
createReferenceValueForId
in classBasicValueFactory
-
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
- Overrides:
createReferenceValueForId
in classBasicValueFactory
-
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
- Overrides:
createReferenceValueForId
in classBasicValueFactory
-
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
- Overrides:
createArrayReferenceValue
in classBasicValueFactory
-
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
- Overrides:
createArrayReferenceValue
in classBasicValueFactory
-
-