@OpenApiAll public class ValueSpecificationHelper extends CoreHelper
Constructor and Description |
---|
ValueSpecificationHelper() |
Modifier and Type | Method and Description |
---|---|
static ValueSpecification |
cloneValueSpecification(ValueSpecification valueSpecification,
Element newOwner)
Clones value specification
|
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 ValueSpecification |
createValueSpecification(Project project,
Type valueType,
java.lang.Object value,
boolean checkNullValue,
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(Project project,
Type valueType,
java.lang.Object value,
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(Type valueType,
java.lang.Object value,
ElementsFactory elementsFactory,
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 java.lang.Class<? extends ValueSpecification> |
getValueSpecificationClass(Type valueType)
Return a meta type of ValueSpecification which should be used to store values of given type
|
static 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 ValueSpecification
|
static java.lang.String |
getValueString(ValueSpecification valueSpecification)
Return string representation of given ValueSpecification
|
static ValueSpecification |
setValueSpecificationValue(Project project,
ValueSpecification valueSpecification,
Type valueType,
java.lang.Object value)
Sets value to value specification, creates value specification if necessary.
|
static ValueSpecification |
setValueSpecificationValue(Project project,
ValueSpecification valueSpecification,
Type valueType,
java.lang.Object value,
boolean checkNullValue)
Sets value to value specification, creates value specification if necessary.
|
static void |
setValueSpecificationValue(ValueSpecification valueSpecification,
java.lang.Object value)
Set a value of value specification
|
areElementsEditable, canAddChild, canAssignName, canAssignName, canAssignName, canMoveChildInto, canMoveChildInto, dispose, findAcceptableParentFor, findAcceptableParentFor, findOwnerOfStrictType, findOwnerOfStrictTypeIncludingItself, findOwnerOfType, findOwnerOfTypeIncludingItself, findParent, findParent, findParentOfType, getAdditionalElementsIterator, getClientElement, getComment, getCommentElement, getCommentElementOrCreate, getDependentClients, getDependentSuppliers, getFirstMemberEnd, getMultiplicity, getName, getOppositeEnd, getOwnedElementsIncludingAdditional, getSecondMemberEnd, getSupplierElement, getSupplierElement, getSupplierElements, hasParentIn, isChildOf, isDocumentationComment, isMultiplicityMany, isParentOf, isParentOf, isRelationship, isRelationshipAlwaysInClient, parseMultiplicityString, setClientElement, setComment, setCommentElement, setConstraintText, setMultiplicity, setMultiplicity, setSupplierElement
@CheckForNull public static ValueSpecification createValueSpecification(Project project, @CheckForNull Type valueType, @CheckForNull java.lang.Object value, @CheckForNull java.util.Collection<? extends ValueSpecification> reuse)
project
- projectvalueType
- type defining the value specificationvalue
- value value of ValueSpecificationreuse
- a collection of possible value specifications to reuse@CheckForNull public static ValueSpecification createValueSpecification(Project project, @CheckForNull Type valueType, @CheckForNull java.lang.Object value, boolean checkNullValue, @CheckForNull java.util.Collection<? extends ValueSpecification> reuse)
project
- projectvalueType
- type defining the value specificationvalue
- value value of ValueSpecificationcheckNullValue
- if true and value is null, null is returnedreuse
- a collection of possible value specifications to reusepublic static ValueSpecification createValueSpecification(@CheckForNull Type valueType, java.lang.Object value, ElementsFactory elementsFactory, @CheckForNull java.util.Collection<? extends ValueSpecification> reuse)
valueType
- type defining the value specificationvalue
- value value of ValueSpecificationelementsFactory
- factoryreuse
- a collection of possible value specifications to reusepublic 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)
valueSpecificationClass
- meta type of value specificationvalue
- value value of ValueSpecificationfactory
- factoryreuse
- a collection of possible value specifications to reusepublic 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)
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@CheckForNull public static ValueSpecification setValueSpecificationValue(Project project, @CheckForNull ValueSpecification valueSpecification, @CheckForNull Type valueType, @CheckForNull java.lang.Object value)
project
- projectvalueSpecification
- value specificationvalueType
- value typevalue
- value@CheckForNull public static ValueSpecification setValueSpecificationValue(Project project, @CheckForNull ValueSpecification valueSpecification, @CheckForNull Type valueType, @CheckForNull java.lang.Object value, boolean checkNullValue)
project
- projectvalueSpecification
- value specificationvalueType
- value typevalue
- valuecheckNullValue
- check null valuepublic static void setValueSpecificationValue(ValueSpecification valueSpecification, @CheckForNull java.lang.Object value)
valueSpecification
- value specificationvalue
- valuepublic static java.lang.Class<? extends ValueSpecification> getValueSpecificationClass(@CheckForNull Type valueType, @CheckForNull java.lang.Object value)
valueType
- value typepublic static java.lang.Class<? extends ValueSpecification> getValueSpecificationClass(@CheckForNull Type valueType)
valueType
- value type@CheckForNull public static ValueSpecification cloneValueSpecification(ValueSpecification valueSpecification, @CheckForNull Element newOwner)
valueSpecification
- value specification to clonenewOwner
- owner of new value specification. It will not be set as owner, but it should be passed for correct cloningpublic static java.lang.Object getValueSpecificationValue(ValueSpecification valueSpecification)
valueSpecification
- value specificationpublic static java.lang.String getValueString(ValueSpecification valueSpecification)
valueSpecification
- value specification