public class PivotUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
PivotUtil.PrecedenceComparator
'Highest' precedence first
|
static class |
PivotUtil.TemplateParameterSubstitutionComparator
In TemplateSignature order.
|
Constructor and Description |
---|
PivotUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
checkExpression(ExpressionInOCL expressionInOCL)
Check that expressionInOCL was successfully compiled.
|
static void |
checkResourceErrors(java.lang.String message,
org.eclipse.emf.ecore.resource.Resource resource) |
static boolean |
conformsTo(org.eclipse.emf.ecore.EClassifier targetType,
org.eclipse.emf.ecore.EClassifier contentType) |
static boolean |
conformsTo(org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature,
org.eclipse.emf.ecore.EClassifier contentType) |
static AnyType |
createAnyType(java.lang.String name) |
static BagType |
createBagType(BagType unspecializedType,
Type elementType) |
static Class |
createClass(org.eclipse.emf.ecore.EClass eClass) |
static Class |
createClass(java.lang.String name) |
static CollectionType |
createCollectionType(CollectionType unspecializedType,
Type elementType) |
protected static <T extends CollectionType> |
createCollectionType(T specializedType,
T unspecializedType,
Type instanceType) |
static DataType |
createDataType(org.eclipse.emf.ecore.EDataType eDataType) |
static DataType |
createDataType(java.lang.String name) |
static Enumeration |
createEnumeration(org.eclipse.emf.ecore.EEnum eEnum) |
static Enumeration |
createEnumeration(java.lang.String name) |
static EnumerationLiteral |
createEnumerationLiteral(org.eclipse.emf.ecore.EEnumLiteral eEnumLiteral) |
static EnumerationLiteral |
createEnumerationLiteral(java.lang.String name) |
static ExpressionInOCL |
createExpressionInOCL(Variable asContextVariable,
OCLExpression asExpression,
Variable... asParameterVariables) |
static ExpressionInOCL |
createExpressionInOCLError(java.lang.String string) |
static InvalidType |
createInvalidType(java.lang.String name) |
static Iteration |
createIteration(java.lang.String name,
Type type,
java.lang.String implementationClass,
LibraryFeature implementation) |
static LambdaType |
createLambdaType(java.lang.String name) |
static LetExp |
createLetExp(Variable asVariable,
OCLExpression asIn) |
static MapType |
createMapType(MapType unspecializedType,
Type keyType,
Type valueType) |
protected static <T extends MapType> |
createMapType(T specializedType,
T unspecializedType,
Type keyType,
Type valueType) |
static <T extends Model> |
createModel(java.lang.Class<T> pivotClass,
org.eclipse.emf.ecore.EClass pivotEClass,
java.lang.String externalURI) |
static Model |
createModel(java.lang.String externalURI) |
static NavigationCallExp |
createNavigationCallExp(OCLExpression asSource,
Property asProperty) |
static Operation |
createOperation(org.eclipse.emf.ecore.EOperation eOperation,
Type type,
java.lang.String implementationClass,
LibraryFeature implementation) |
static Operation |
createOperation(java.lang.String name,
ExpressionInOCL asExpressionInOCL) |
static Operation |
createOperation(java.lang.String name,
Type type,
java.lang.String implementationClass,
LibraryFeature implementation) |
static OperationCallExp |
createOperationCallExp(OCLExpression asSource,
Operation asOperation,
OCLExpression... asArguments) |
static OrderedSetType |
createOrderedSetType(OrderedSetType unspecializedType,
Type elementType) |
static Package |
createOwnedPackage(Model parentRoot,
java.lang.String name) |
static Package |
createOwnedPackage(Package parentPackage,
java.lang.String name) |
static <T extends Package> |
createPackage(java.lang.Class<T> pivotClass,
org.eclipse.emf.ecore.EClass pivotEClass,
java.lang.String name,
java.lang.String nsURI,
PackageId packageId) |
static Package |
createPackage(org.eclipse.emf.ecore.EPackage ePackage,
java.lang.String nsPrefix,
java.lang.String nsURI) |
static Package |
createPackage(java.lang.String name,
java.lang.String nsPrefix,
java.lang.String nsURI,
PackageId packageId) |
static Parameter |
createParameter(java.lang.String name,
Type asType,
boolean isRequired) |
static Precedence |
createPrecedence(java.lang.String name,
AssociativityKind kind) |
static PrimitiveType |
createPrimitiveType(java.lang.String name) |
static Property |
createProperty(org.eclipse.emf.ecore.EStructuralFeature eFeature,
Type type) |
static Property |
createProperty(java.lang.String name,
Type type) |
static PropertyCallExp |
createPropertyCallExp(OCLExpression asSource,
Property asProperty) |
static SelfType |
createSelfType(java.lang.String name) |
static SequenceType |
createSequenceType(SequenceType unspecializedType,
Type elementType) |
static SetType |
createSetType(SetType unspecializedType,
Type elementType) |
static TemplateBinding |
createTemplateBinding(TemplateParameterSubstitution... templateParameterSubstitutions) |
static TemplateParameter |
createTemplateParameter(java.lang.String name,
Class... lowerBounds) |
static TemplateParameterSubstitution |
createTemplateParameterSubstitution(TemplateParameter formal,
Type actual) |
static TemplateSignature |
createTemplateSignature(TemplateableElement templateableElement,
TemplateParameter... templateParameters) |
static TupleType |
createTupleType(java.lang.String name,
Property... properties) |
static java.lang.String |
createTupleValuedConstraint(java.lang.String statusText,
java.lang.Integer severity,
java.lang.String messageText) |
static Variable |
createVariable(java.lang.String name,
OCLExpression asInitExpression) |
static Variable |
createVariable(java.lang.String name,
Type asType,
boolean isRequired,
OCLExpression asInitExpression) |
static VariableExp |
createVariableExp(Variable asVariable) |
static VoidType |
createVoidType(java.lang.String name) |
static void |
debugObjectUsage(java.lang.String prefix,
org.eclipse.emf.ecore.EObject element) |
static boolean |
debugWellContainedness(Type type) |
static void |
formatDiagnostic(java.lang.StringBuilder s,
org.eclipse.emf.common.util.Diagnostic diagnostic,
java.lang.String newLine) |
static java.lang.String |
formatDiagnostics(org.eclipse.emf.common.util.Diagnostic diagnostic,
java.lang.String newLine) |
static java.lang.String |
formatResourceDiagnostics(java.util.List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> diagnostics,
java.lang.String messagePrefix,
java.lang.String newLine) |
static Constraint |
getContainingConstraint(Element element) |
static ExpressionInOCL |
getContainingExpressionInOCL(Element element) |
static Model |
getContainingModel(org.eclipse.emf.ecore.EObject element) |
static Namespace |
getContainingNamespace(org.eclipse.emf.ecore.EObject element) |
static Operation |
getContainingOperation(org.eclipse.emf.ecore.EObject element) |
static Package |
getContainingPackage(org.eclipse.emf.ecore.EObject element) |
static Model |
getContainingRoot(org.eclipse.emf.ecore.EObject element)
Deprecated.
use getContainingModel
|
static Type |
getContainingType(org.eclipse.emf.ecore.EObject element) |
static int |
getContainmentDepth(org.eclipse.emf.ecore.EObject eObject)
Return the number of containers of eObject, 0 if eObject is a root.
|
static java.lang.Class<?> |
getEcoreInstanceClass(Property asProperty)
Return the Java Class used by Ecore for elements of asProperty, or null if not known.
|
static Namespace |
getNamespace(org.eclipse.emf.ecore.EObject element) |
static java.lang.String |
getNavigationOperator(boolean isSafe,
boolean isAggregate) |
static Package |
getPackage(org.eclipse.emf.ecore.EObject object) |
static <T extends Element> |
getPivot(java.lang.Class<T> pivotClass,
Pivotable pivotableElement) |
static Feature |
getReferredFeature(CallExp callExp) |
static Operation |
getReferredOperation(CallExp callExp) |
static Property |
getReferredProperty(NavigationCallExp navigationCallExp) |
static <T extends TemplateableElement> |
getUnspecializedTemplateableElement(T templateableElement) |
static Operation |
initOperation(Operation asOperation,
ExpressionInOCL asExpressionInOCL) |
static boolean |
isAggregate(Type type)
Return true if type uses an aggregate (->) rather than object (.) navigation operator.
|
static boolean |
isAggregateNavigationOperator(java.lang.String operatorName) |
static boolean |
isObjectNavigationOperator(java.lang.String operatorName) |
static boolean |
isSafeNavigationOperator(java.lang.String operatorName) |
static boolean |
isSameOperation(OperationId operationId1,
OperationId operationId2) |
static void |
setBody(ExpressionInOCL expressionInOCL,
OCLExpression oclExpression,
java.lang.String stringExpression)
Define oclExpression as the bodyExpression of an expressionInOCL, and if non-null
also define stringExpression as the OCL-languaged body.
|
static boolean |
setParserContext(CSResource csResource,
org.eclipse.emf.ecore.EObject eObject,
java.lang.Object... todoParameters)
Configure resource to support parsing in the context of an eObject.
|
public static void checkExpression(@NonNull ExpressionInOCL expressionInOCL)
public static void checkResourceErrors(@NonNull java.lang.String message, @NonNull org.eclipse.emf.ecore.resource.Resource resource) throws ParserException
ParserException
public static boolean conformsTo(@Nullable org.eclipse.emf.ecore.EClassifier targetType, @NonNull org.eclipse.emf.ecore.EClassifier contentType)
public static boolean conformsTo(@Nullable org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature, @NonNull org.eclipse.emf.ecore.EClassifier contentType)
@NonNull public static AnyType createAnyType(@NonNull java.lang.String name)
@NonNull public static BagType createBagType(@NonNull BagType unspecializedType, @NonNull Type elementType)
public static Class createClass(org.eclipse.emf.ecore.EClass eClass)
public static Class createClass(@NonNull java.lang.String name)
@NonNull public static CollectionType createCollectionType(@NonNull CollectionType unspecializedType, @NonNull Type elementType)
@NonNull protected static <T extends CollectionType> T createCollectionType(T specializedType, @NonNull T unspecializedType, @NonNull Type instanceType)
@NonNull public static DataType createDataType(org.eclipse.emf.ecore.EDataType eDataType)
@NonNull public static DataType createDataType(@NonNull java.lang.String name)
@NonNull public static Enumeration createEnumeration(org.eclipse.emf.ecore.EEnum eEnum)
@NonNull public static Enumeration createEnumeration(@NonNull java.lang.String name)
@NonNull public static EnumerationLiteral createEnumerationLiteral(org.eclipse.emf.ecore.EEnumLiteral eEnumLiteral)
@NonNull public static EnumerationLiteral createEnumerationLiteral(@NonNull java.lang.String name)
@NonNull public static ExpressionInOCL createExpressionInOCL(@Nullable Variable asContextVariable, @NonNull OCLExpression asExpression, Variable... asParameterVariables)
@NonNull public static ExpressionInOCL createExpressionInOCLError(@NonNull java.lang.String string)
@NonNull public static InvalidType createInvalidType(@NonNull java.lang.String name)
@NonNull public static Iteration createIteration(@NonNull java.lang.String name, @NonNull Type type, @Nullable java.lang.String implementationClass, @NonNull LibraryFeature implementation)
@NonNull public static LambdaType createLambdaType(@NonNull java.lang.String name)
@NonNull public static LetExp createLetExp(@NonNull Variable asVariable, @NonNull OCLExpression asIn)
@NonNull public static Model createModel(java.lang.String externalURI)
@NonNull public static MapType createMapType(@NonNull MapType unspecializedType, @NonNull Type keyType, @NonNull Type valueType)
@NonNull protected static <T extends MapType> T createMapType(T specializedType, T unspecializedType, @NonNull Type keyType, @NonNull Type valueType)
@NonNull public static <T extends Model> T createModel(@NonNull java.lang.Class<T> pivotClass, org.eclipse.emf.ecore.EClass pivotEClass, java.lang.String externalURI)
@NonNull public static NavigationCallExp createNavigationCallExp(@NonNull OCLExpression asSource, @NonNull Property asProperty)
@NonNull public static Operation createOperation(@NonNull java.lang.String name, @NonNull Type type, @Nullable java.lang.String implementationClass, @Nullable LibraryFeature implementation)
@NonNull public static Operation createOperation(org.eclipse.emf.ecore.EOperation eOperation, @NonNull Type type, @Nullable java.lang.String implementationClass, @Nullable LibraryFeature implementation)
@NonNull public static Operation createOperation(@NonNull java.lang.String name, @NonNull ExpressionInOCL asExpressionInOCL)
@NonNull public static OperationCallExp createOperationCallExp(@NonNull OCLExpression asSource, @NonNull Operation asOperation, OCLExpression... asArguments)
@NonNull public static OrderedSetType createOrderedSetType(@NonNull OrderedSetType unspecializedType, @NonNull Type elementType)
public static Package createOwnedPackage(@NonNull Model parentRoot, @NonNull java.lang.String name)
public static Package createOwnedPackage(Package parentPackage, @NonNull java.lang.String name)
public static Package createPackage(org.eclipse.emf.ecore.EPackage ePackage, @Nullable java.lang.String nsPrefix, @NonNull java.lang.String nsURI)
public static Package createPackage(@NonNull java.lang.String name, @Nullable java.lang.String nsPrefix, @NonNull java.lang.String nsURI, @Nullable PackageId packageId)
@NonNull public static <T extends Package> T createPackage(@NonNull java.lang.Class<T> pivotClass, @NonNull org.eclipse.emf.ecore.EClass pivotEClass, @NonNull java.lang.String name, @Nullable java.lang.String nsURI, @Nullable PackageId packageId)
@NonNull public static Parameter createParameter(@NonNull java.lang.String name, @NonNull Type asType, boolean isRequired)
@NonNull public static Precedence createPrecedence(@NonNull java.lang.String name, AssociativityKind kind)
@NonNull public static PrimitiveType createPrimitiveType(@NonNull java.lang.String name)
@NonNull public static Property createProperty(org.eclipse.emf.ecore.EStructuralFeature eFeature, @NonNull Type type)
@NonNull public static Property createProperty(@NonNull java.lang.String name, @NonNull Type type)
@NonNull public static PropertyCallExp createPropertyCallExp(@NonNull OCLExpression asSource, @NonNull Property asProperty)
@NonNull public static SelfType createSelfType(@NonNull java.lang.String name)
@NonNull public static SequenceType createSequenceType(@NonNull SequenceType unspecializedType, @NonNull Type elementType)
@NonNull public static SetType createSetType(@NonNull SetType unspecializedType, @NonNull Type elementType)
@NonNull public static TemplateBinding createTemplateBinding(TemplateParameterSubstitution... templateParameterSubstitutions)
@NonNull public static TemplateParameter createTemplateParameter(@NonNull java.lang.String name, Class... lowerBounds)
@NonNull public static TemplateParameterSubstitution createTemplateParameterSubstitution(@NonNull TemplateParameter formal, @NonNull Type actual)
@NonNull public static TemplateSignature createTemplateSignature(@NonNull TemplateableElement templateableElement, TemplateParameter... templateParameters)
@NonNull public static TupleType createTupleType(@NonNull java.lang.String name, Property... properties)
@NonNull public static java.lang.String createTupleValuedConstraint(@NonNull java.lang.String statusText, @Nullable java.lang.Integer severity, @Nullable java.lang.String messageText)
@NonNull public static Variable createVariable(@NonNull java.lang.String name, @NonNull OCLExpression asInitExpression)
@NonNull public static Variable createVariable(@NonNull java.lang.String name, @NonNull Type asType, boolean isRequired, @Nullable OCLExpression asInitExpression)
@NonNull public static VariableExp createVariableExp(@NonNull Variable asVariable)
@NonNull public static VoidType createVoidType(@NonNull java.lang.String name)
public static void debugObjectUsage(java.lang.String prefix, org.eclipse.emf.ecore.EObject element)
public static boolean debugWellContainedness(Type type)
public static java.lang.String formatDiagnostics(@NonNull org.eclipse.emf.common.util.Diagnostic diagnostic, @NonNull java.lang.String newLine)
public static void formatDiagnostic(@NonNull java.lang.StringBuilder s, @NonNull org.eclipse.emf.common.util.Diagnostic diagnostic, @NonNull java.lang.String newLine)
public static java.lang.String formatResourceDiagnostics(@NonNull java.util.List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> diagnostics, @NonNull java.lang.String messagePrefix, @NonNull java.lang.String newLine)
@Nullable public static Constraint getContainingConstraint(@Nullable Element element)
@Nullable public static ExpressionInOCL getContainingExpressionInOCL(@Nullable Element element)
@Nullable public static Model getContainingModel(@Nullable org.eclipse.emf.ecore.EObject element)
@Nullable public static Namespace getContainingNamespace(@Nullable org.eclipse.emf.ecore.EObject element)
@Nullable public static Operation getContainingOperation(@Nullable org.eclipse.emf.ecore.EObject element)
public static Package getContainingPackage(@Nullable org.eclipse.emf.ecore.EObject element)
@Deprecated @Nullable public static Model getContainingRoot(@Nullable org.eclipse.emf.ecore.EObject element)
@Nullable public static Type getContainingType(@Nullable org.eclipse.emf.ecore.EObject element)
public static int getContainmentDepth(org.eclipse.emf.ecore.EObject eObject)
@Nullable public static java.lang.Class<?> getEcoreInstanceClass(@Nullable Property asProperty)
@Nullable public static Namespace getNamespace(@Nullable org.eclipse.emf.ecore.EObject element)
@NonNull public static java.lang.String getNavigationOperator(boolean isSafe, boolean isAggregate)
public static Package getPackage(@NonNull org.eclipse.emf.ecore.EObject object)
@Nullable public static <T extends Element> T getPivot(@NonNull java.lang.Class<T> pivotClass, @Nullable Pivotable pivotableElement)
@NonNull public static Operation getReferredOperation(@NonNull CallExp callExp)
@NonNull public static Property getReferredProperty(@NonNull NavigationCallExp navigationCallExp)
@NonNull public static <T extends TemplateableElement> T getUnspecializedTemplateableElement(@NonNull T templateableElement)
@NonNull public static Operation initOperation(@NonNull Operation asOperation, @NonNull ExpressionInOCL asExpressionInOCL)
public static boolean isAggregate(Type type)
public static boolean isAggregateNavigationOperator(java.lang.String operatorName)
public static boolean isObjectNavigationOperator(java.lang.String operatorName)
public static boolean isSafeNavigationOperator(java.lang.String operatorName)
public static boolean isSameOperation(@NonNull OperationId operationId1, @NonNull OperationId operationId2)
public static void setBody(@NonNull ExpressionInOCL expressionInOCL, @Nullable OCLExpression oclExpression, @Nullable java.lang.String stringExpression)
public static boolean setParserContext(@NonNull CSResource csResource, @NonNull org.eclipse.emf.ecore.EObject eObject, java.lang.Object... todoParameters) throws ParserException
ParserException
- if eObject cannot be converted to a Pivot element