Package com.nomagic.magicdraw.uml2
Class ValueSpecifications
java.lang.Object
com.nomagic.magicdraw.uml2.ValueSpecifications
Convenience static methods that operate on or return ValueSpecification elements.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ValueSpecification
createValueSpecification
(Class<? extends ValueSpecification> valueSpecificationClass, Type valueType, Object value, ElementsFactory factory, Collection<? extends ValueSpecification> reuse) Create a new value specification for a given value or returns a suitable from the given specifications to reuse.static ValueSpecification
createValueSpecification
(Class<? extends ValueSpecification> valueSpecificationClass, Type valueType, Object value, ElementsFactory factory, Collection<? extends ValueSpecification> reuse, boolean ignoreValuesOfReuse) Create a new value specification for a given value or returns a suitable from the given specifications to reuse.static EnumerationLiteral
getEnumerationLiteral
(Enumeration enumeration, String literalName) Gets EnumerationLiteral from Enumeration by name.static Class<? extends ValueSpecification>
getValueSpecificationClass
(Type valueType) Return a meta type of ValueSpecification which should be used to store values of given typestatic Class<? extends ValueSpecification>
getValueSpecificationClass
(Type valueType, Object value) Return a meta type of ValueSpecification which should be used to store values of given type or value.static Object
getValueSpecificationValue
(ValueSpecification valueSpecification) Return value of given ValueSpecificationstatic boolean
isValueSpecificationClassElementValue
(Type valueType) static void
setIntervalValueParser
(Function<Interval, Object> intervalParser)
-
Constructor Details
-
ValueSpecifications
public ValueSpecifications()
-
-
Method Details
-
setIntervalValueParser
-
getValueSpecificationValue
@CheckForNull public static Object getValueSpecificationValue(@CheckForNull ValueSpecification valueSpecification) Return value of given ValueSpecification- Parameters:
valueSpecification
- value specification- Returns:
- value
-
createValueSpecification
@CheckForNull public static ValueSpecification createValueSpecification(@CheckForNull Class<? extends ValueSpecification> valueSpecificationClass, @CheckForNull Type valueType, @CheckForNull Object value, ElementsFactory factory, @CheckForNull Collection<? extends ValueSpecification> reuse) Create a new value specification for a given value or returns a suitable from the given specifications to reuse.- Parameters:
valueSpecificationClass
- meta type of value specificationvalue
- value value of ValueSpecificationfactory
- factoryreuse
- a collection of possible value specifications to reuse- Returns:
- specification
-
createValueSpecification
@CheckForNull public static ValueSpecification createValueSpecification(@CheckForNull Class<? extends ValueSpecification> valueSpecificationClass, @CheckForNull Type valueType, @CheckForNull Object value, ElementsFactory factory, @CheckForNull Collection<? extends ValueSpecification> reuse, boolean ignoreValuesOfReuse) Create a new value specification for a given value or returns a suitable from the given specifications to reuse.- Parameters:
valueSpecificationClass
- meta type of value specificationvalue
- value value of ValueSpecificationfactory
- factoryreuse
- a collection of possible value specifications to reuseignoreValuesOfReuse
- if false, checks is value if reuse candidate is suitable, not only the meta type. If true, checks just a metatype and overwrites the value- Returns:
- specification
-
getEnumerationLiteral
@CheckForNull public static EnumerationLiteral getEnumerationLiteral(Enumeration enumeration, String literalName) Gets EnumerationLiteral from Enumeration by name.- Parameters:
enumeration
- enumeration which literals will be searched.literalName
- name of the EnumerationLiteral.- Returns:
- EnumerationLiteral from Enumeration by name.
-
getValueSpecificationClass
public static Class<? extends ValueSpecification> getValueSpecificationClass(@CheckForNull Type valueType, @CheckForNull Object value) Return a meta type of ValueSpecification which should be used to store values of given type or value. If valueType is null, value is used to define a meta type of value specification.- Parameters:
valueType
- value type- Returns:
- meta type of value specification
-
getValueSpecificationClass
public static Class<? extends ValueSpecification> getValueSpecificationClass(@CheckForNull Type valueType) Return a meta type of ValueSpecification which should be used to store values of given type- Parameters:
valueType
- value type- Returns:
- meta type of value specification
-
isValueSpecificationClassElementValue
- Parameters:
valueType
- value type- Returns:
- true if ValueSpecification for given type should be ElementValue
-