public enum SpecialField extends java.lang.Enum<SpecialField> implements VariableDescriptor
Enum Constant and Description |
---|
ARRAY_LENGTH |
COLLECTION_SIZE |
OPTIONAL_VALUE |
STRING_LENGTH |
UNBOX |
Modifier and Type | Method and Description |
---|---|
DfType |
asDfType(DfType fieldValue) |
DfType |
asDfType(DfType fieldValue,
PsiType exactResultType) |
DfaValue |
createValue(DfaValueFactory factory,
DfaValue qualifier)
Returns a DfaValue which represents this special field
|
DfaValue |
createValue(DfaValueFactory factory,
DfaValue qualifier,
boolean forAccessor)
Returns a value which describes the field qualified by given qualifier and described by this descriptor
|
static SpecialField |
findSpecialField(PsiElement accessor)
Finds a special field which corresponds to given accessor (method or field)
|
DfType |
fromConstant(java.lang.Object obj) |
static SpecialField |
fromQualifier(DfaValue value)
Returns a special field which corresponds to given qualifier
|
static SpecialField |
fromQualifierType(PsiType type)
Returns a special field which corresponds to given qualifier type
(currently it's assumed that only one special field may exist for given qualifier type)
|
DfType |
getDefaultValue(boolean forAccessor)
Returns a dfType that describes any possible value this special field may have
|
MethodContract[] |
getEmptyContracts() |
MethodContract[] |
getEqualsContracts() |
DfType |
getFromQualifier(DfType dfType)
Returns a DfType from given DfType qualifier if it's bound to this special field
|
java.lang.String |
getPresentationText(DfType dfType,
PsiType type) |
PsiType |
getType(DfaVariableValue variableValue)
Returns the type of the value which is qualified by given qualifier and described by this descriptor
|
boolean |
isStable() |
java.lang.String |
toString() |
static SpecialField |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static SpecialField[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
getPsiElement, isCall
public static final SpecialField ARRAY_LENGTH
public static final SpecialField STRING_LENGTH
public static final SpecialField COLLECTION_SIZE
public static final SpecialField UNBOX
public static final SpecialField OPTIONAL_VALUE
public static SpecialField[] values()
for (SpecialField c : SpecialField.values()) System.out.println(c);
public static SpecialField valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic boolean isStable()
isStable
in interface VariableDescriptor
public static SpecialField findSpecialField(PsiElement accessor)
accessor
- accessor to find a special field forpublic final DfaValue createValue(DfaValueFactory factory, DfaValue qualifier)
createValue
in interface VariableDescriptor
factory
- a factory to create new values if necessaryqualifier
- a known qualifier valuepublic DfaValue createValue(DfaValueFactory factory, DfaValue qualifier, boolean forAccessor)
VariableDescriptor
createValue
in interface VariableDescriptor
factory
- factory to usequalifier
- qualifier to useforAccessor
- whether the value is created for accessor resultpublic DfType getDefaultValue(boolean forAccessor)
forAccessor
- if true, the default value for accessor result should be returned
(may differ from internal representation of value)public PsiType getType(DfaVariableValue variableValue)
VariableDescriptor
getType
in interface VariableDescriptor
variableValue
- qualifier (may be null if absent)public DfType fromConstant(java.lang.Object obj)
public MethodContract[] getEmptyContracts()
public MethodContract[] getEqualsContracts()
public DfType asDfType(DfType fieldValue)
fieldValue
- dfType of the special field valuepublic DfType asDfType(DfType fieldValue, PsiType exactResultType)
fieldValue
- dfType of the special field valueexactResultType
- exact PSI type of the resultpublic DfType getFromQualifier(DfType dfType)
dfType
- of the qualifierpublic static SpecialField fromQualifierType(PsiType type)
type
- a qualifier typepublic static SpecialField fromQualifier(DfaValue value)
value
- a qualifier valuepublic java.lang.String toString()
toString
in class java.lang.Enum<SpecialField>