public class AnalyzedObjectFactory
extends java.lang.Object
AnalyzedObject
.Modifier and Type | Method and Description |
---|---|
static AnalyzedObject |
create(@Nullable java.lang.Object value,
@Nullable java.lang.String type,
@Nullable Clazz referencedClass)
Create a
AnalyzedObject , representing the tracked value for a reference type. |
static AnalyzedObject |
createDetailedArray(Value[] values,
java.lang.String type)
Create a modeled object representing a detailed array (i.e., it's model is a
ArrayModel . |
static AnalyzedObject |
createModeled(@NotNull Model value)
Create an object the value of which is modeled.
|
static AnalyzedObject |
createNull()
Create an object with unknown type and null value.
|
static AnalyzedObject |
createNullOfType(@NotNull java.lang.String type)
Create an object with null value and known type.
|
static AnalyzedObject |
createPrecise(@NotNull java.lang.Object value)
Create a precise object wrapping the value.
|
public static AnalyzedObject create(@Nullable @Nullable java.lang.Object value, @Nullable @Nullable java.lang.String type, @Nullable @Nullable Clazz referencedClass)
AnalyzedObject
, 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 of Model
.
Consistency checks on the arguments are performed:
Model
) has to be the same type of "referencedClass" or of a class
inheriting from it.
Model
)
value
- the value of the tracked object. Can be the actual value or a Model
. 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 created AnalyzedObject.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.public static AnalyzedObject createPrecise(@NotNull @NotNull java.lang.Object value)
value
- The wrapped valuepublic static AnalyzedObject createModeled(@NotNull @NotNull Model value)
value
- The wrapped modelpublic static AnalyzedObject createNullOfType(@NotNull @NotNull java.lang.String type)
type
- The known type of the null objectpublic static AnalyzedObject createNull()
public static AnalyzedObject createDetailedArray(Value[] values, java.lang.String type)
ArrayModel
.