Class ValueSpecifications

java.lang.Object
com.nomagic.magicdraw.uml2.ValueSpecifications

public class ValueSpecifications extends Object
Convenience static methods that operate on or return ValueSpecification elements.
  • Constructor Details

    • ValueSpecifications

      public ValueSpecifications()
  • Method Details

    • setIntervalValueParser

      public static void setIntervalValueParser(@CheckForNull Function<Interval,Object> intervalParser)
    • 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 specification
      value - value value of ValueSpecification
      factory - factory
      reuse - 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 specification
      value - value value of ValueSpecification
      factory - factory
      reuse - a collection of possible value specifications to reuse
      ignoreValuesOfReuse - 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

      public static boolean isValueSpecificationClassElementValue(@CheckForNull Type valueType)
      Parameters:
      valueType - value type
      Returns:
      true if ValueSpecification for given type should be ElementValue