public interface Value
A boxed value is not needed for Boolean and String that are well-behaved.
A boxed value is needed for Integer and Double, since in OCL 4 is equal to 4.0 and since multiple implementation classes exist to support growth between unlimited numeric ranges.
A boxed value is needed for EnumerationLiterals since distinct Pivot, Ecore, UML variants may exist.
A boxed value is needed for types since distinct Pivot, Ecore, UML variants may exist.
A boxed value is useful/needed for collections to provide OCL polymorphism.
A boxed value is not needed for the large number of ordinary EObjects not in the above list.
asXXX returns a non-null XXX if self is convertible to an XXX and is not NullValue/InvalidValue throws an InvalidValueException for a NullValue/InvalidValue. A Value object may be converted if the conversion to XXX is exact and type conformant.
isXXX returns an XXX-related value if self is an XXX and is not a NullValue/InvalidValue, returns null otherwise.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
INVALID_NAME |
Modifier and Type | Method and Description |
---|---|
BagValue |
asBagValue() |
CollectionValue |
asCollectionValue() |
java.lang.Double |
asDouble() |
java.lang.Object |
asEcoreObject(IdResolver idResolver,
java.lang.Class<?> instanceClass)
Return the Ecore representation of this value, which should be fully compatible with the Ecore return
from a similarly typed eGet().
|
Element |
asElement() |
java.lang.Integer |
asInteger() |
IntegerValue |
asIntegerValue() |
MapValue |
asMapValue() |
org.eclipse.emf.ecore.EObject |
asNavigableObject() |
java.lang.Object |
asObject() |
ObjectValue |
asObjectValue() |
OrderedCollectionValue |
asOrderedCollectionValue() |
OrderedSetValue |
asOrderedSetValue() |
RealValue |
asRealValue() |
SequenceValue |
asSequenceValue() |
SetValue |
asSetValue() |
TupleValue |
asTupleValue() |
java.lang.Object |
asUnboxedObject(IdResolver idResolver)
Return the unboxed representation of this value.
|
UniqueCollectionValue |
asUniqueCollectionValue() |
UnlimitedNaturalValue |
asUnlimitedNaturalValue() |
TypeId |
getTypeId()
Return the type of this value determined from its construction context.
|
boolean |
isInvalid() |
boolean |
isUndefined() |
void |
toString(java.lang.StringBuilder s,
int sizeLimit) |
static final java.lang.String INVALID_NAME
@NonNull BagValue asBagValue()
@NonNull CollectionValue asCollectionValue()
@NonNull java.lang.Double asDouble()
java.lang.Object asEcoreObject(@NonNull IdResolver idResolver, @Nullable java.lang.Class<?> instanceClass)
A thrown exception for an invalid OCL value.
Java-null for a null OCL value
Objects for other things, List<?> for collections
Element asElement()
@NonNull java.lang.Integer asInteger()
@NonNull IntegerValue asIntegerValue()
@NonNull MapValue asMapValue()
@NonNull org.eclipse.emf.ecore.EObject asNavigableObject()
@NonNull java.lang.Object asObject()
@NonNull ObjectValue asObjectValue()
@NonNull OrderedCollectionValue asOrderedCollectionValue()
@NonNull OrderedSetValue asOrderedSetValue()
@NonNull RealValue asRealValue()
@NonNull SequenceValue asSequenceValue()
@NonNull SetValue asSetValue()
@NonNull TupleValue asTupleValue()
java.lang.Object asUnboxedObject(@NonNull IdResolver idResolver)
A thrown exception for an invalid OCL value.
Java-null for a null OCL value
Objects for other things, Bag/Set/OrderedSet/List for collections
@NonNull UniqueCollectionValue asUniqueCollectionValue()
@NonNull UnlimitedNaturalValue asUnlimitedNaturalValue()
@NonNull TypeId getTypeId()
boolean isInvalid()
boolean isUndefined()
void toString(@NonNull java.lang.StringBuilder s, int sizeLimit)