Package com.nomagic.magicdraw.uml2
Class ValueSpecifications
- java.lang.Object
-
- com.nomagic.magicdraw.uml2.ValueSpecifications
-
public class ValueSpecifications extends java.lang.Object
Convenience static methods that operate on or return ValueSpecification elements.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.function.Function<Interval,java.lang.Object>
INTERVAL_VALUE_PARSER
-
Constructor Summary
Constructors Constructor Description ValueSpecifications()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ValueSpecification
createValueSpecification(java.lang.Class<? extends ValueSpecification> valueSpecificationClass, Type valueType, java.lang.Object value, ElementsFactory factory, java.util.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(java.lang.Class<? extends ValueSpecification> valueSpecificationClass, Type valueType, java.lang.Object value, ElementsFactory factory, java.util.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, java.lang.String literalName)
Gets EnumerationLiteral from Enumeration by name.private static org.apache.logging.log4j.Logger
getLogger()
static java.lang.Class<? extends ValueSpecification>
getValueSpecificationClass(Type valueType)
Return a meta type of ValueSpecification which should be used to store values of given typestatic java.lang.Class<? extends ValueSpecification>
getValueSpecificationClass(Type valueType, java.lang.Object value)
Return a meta type of ValueSpecification which should be used to store values of given type or value.static java.lang.Object
getValueSpecificationValue(ValueSpecification valueSpecification)
Return value of given ValueSpecificationprivate static boolean
isDataTypeWithAttribute(DataType dataType)
static boolean
isValueSpecificationClassElementValue(Type valueType)
static void
setIntervalValueParser(java.util.function.Function<Interval,java.lang.Object> intervalParser)
-
-
-
Field Detail
-
INTERVAL_VALUE_PARSER
@CheckForNull private static java.util.function.Function<Interval,java.lang.Object> INTERVAL_VALUE_PARSER
-
-
Method Detail
-
setIntervalValueParser
public static void setIntervalValueParser(@CheckForNull java.util.function.Function<Interval,java.lang.Object> intervalParser)
-
getValueSpecificationValue
@CheckForNull public static java.lang.Object getValueSpecificationValue(@CheckForNull ValueSpecification valueSpecification)
Return value of given ValueSpecification- Parameters:
valueSpecification
- value specification- Returns:
- value
-
createValueSpecification
@CheckForNull public static ValueSpecification createValueSpecification(@CheckForNull java.lang.Class<? extends ValueSpecification> valueSpecificationClass, @CheckForNull Type valueType, @CheckForNull java.lang.Object value, ElementsFactory factory, @CheckForNull java.util.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 java.lang.Class<? extends ValueSpecification> valueSpecificationClass, @CheckForNull Type valueType, @CheckForNull java.lang.Object value, ElementsFactory factory, @CheckForNull java.util.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, java.lang.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 java.lang.Class<? extends ValueSpecification> getValueSpecificationClass(@CheckForNull Type valueType, @CheckForNull java.lang.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 java.lang.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
public static boolean isValueSpecificationClassElementValue(@CheckForNull Type valueType)
- Parameters:
valueType
- value type- Returns:
- true if ValueSpecification for given type should be ElementValue
-
isDataTypeWithAttribute
private static boolean isDataTypeWithAttribute(DataType dataType)
-
getLogger
private static org.apache.logging.log4j.Logger getLogger()
-
-