public class PivotUtil extends 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 |
addAllClasses(EnvironmentView environmentView,
Package pPackage) |
static <T extends NamedElement> |
addAllNamedElements(EnvironmentView environmentView,
Iterable<T> namedElements) |
static void |
checkExpression(ExpressionInOCL expressionInOCL)
Check that expressionInOCL was successfully compiled.
|
static void |
checkResourceErrors(String message,
Resource resource) |
static void |
checkResourceWarnings(String message,
Resource resource) |
static boolean |
conformsTo(EClassifier targetType,
EClassifier contentType) |
static boolean |
conformsTo(EStructuralFeature eStructuralFeature,
EClassifier contentType) |
static AnyType |
createAnyType(EClass eClass) |
static AnyType |
createAnyType(String name) |
static BagType |
createBagType(BagType unspecializedType,
Type elementType) |
static Class |
createClass(EClass eClass) |
static CollectionType |
createCollectionType(CollectionType unspecializedType,
Type elementType) |
static DataType |
createDataType(EDataType eDataType) |
static Enumeration |
createEnumeration(EEnum eEnum) |
static EnumerationLiteral |
createEnumerationLiteral(EEnumLiteral eEnumLiteral) |
static ExpressionInOCL |
createExpressionInOCL(Variable asContextVariable,
OCLExpression asExpression,
Variable... asParameterVariables) |
static ExpressionInOCL |
createExpressionInOCLError(String string) |
static InvalidType |
createInvalidType(EClass eClass) |
static InvalidType |
createInvalidType(String name) |
static Iteration |
createIteration(String name,
Type type,
String implementationClass,
LibraryFeature implementation) |
static LambdaType |
createLambdaType(String name) |
static LetExp |
createLetExp(Variable asVariable,
OCLExpression asIn) |
static MapType |
createMapType(MapType unspecializedType,
Type keyType,
Type valueType) |
static <T extends Model> |
createModel(Class<T> pivotClass,
EClass pivotEClass,
String externalURI) |
static Model |
createModel(String externalURI) |
static NavigationCallExp |
createNavigationCallExp(OCLExpression asSource,
Property asProperty)
Deprecated.
Use PivotHelper.createNavigationCallExp to specialize return types.
|
static Operation |
createOperation(EOperation eOperation,
Type type,
String implementationClass,
LibraryFeature implementation) |
static Operation |
createOperation(String name,
ExpressionInOCL asExpressionInOCL) |
static Operation |
createOperation(String name,
Type type,
String implementationClass,
LibraryFeature implementation) |
static OperationCallExp |
createOperationCallExp(OCLExpression asSource,
Operation asOperation,
OCLExpression... asArguments)
Deprecated.
Use PivotHelper.createOperationCallExp to specialize return types.
|
static OrderedSetType |
createOrderedSetType(OrderedSetType unspecializedType,
Type elementType) |
static Package |
createOwnedPackage(Model parentRoot,
String name) |
static Package |
createOwnedPackage(Package parentPackage,
String name) |
static <T extends Package> |
createPackage(Class<T> pivotClass,
EClass pivotEClass,
String name,
String nsURI,
PackageId packageId) |
static Package |
createPackage(EPackage ePackage,
String nsPrefix,
String nsURI) |
static Package |
createPackage(String name,
String nsPrefix,
String nsURI,
PackageId packageId) |
static Parameter |
createParameter(String name,
Type asType,
boolean isRequired) |
static Precedence |
createPrecedence(String name,
AssociativityKind kind) |
static PrimitiveType |
createPrimitiveType(String name) |
static Property |
createProperty(EStructuralFeature eFeature,
Type type) |
static PropertyCallExp |
createPropertyCallExp(OCLExpression asSource,
Property asProperty) |
static SelfType |
createSelfType(EClass eClass) |
static SelfType |
createSelfType(String name) |
static SequenceType |
createSequenceType(SequenceType unspecializedType,
Type elementType) |
static SetType |
createSetType(SetType unspecializedType,
Type elementType) |
static TemplateBinding |
createTemplateBinding(TemplateParameterSubstitution... templateParameterSubstitutions) |
static TemplateParameter |
createTemplateParameter(String name,
Class... lowerBounds) |
static TemplateParameterSubstitution |
createTemplateParameterSubstitution(TemplateParameter formal,
Type actual) |
static TemplateSignature |
createTemplateSignature(TemplateableElement templateableElement,
TemplateParameter... templateParameters) |
static TupleType |
createTupleType(String name,
Property... properties) |
static String |
createTupleValuedConstraint(String statusText,
Integer severity,
String messageText) |
static Variable |
createVariable(String name,
OCLExpression asInitExpression)
Deprecated.
Use appropriate derived Variable
|
static Variable |
createVariable(String name,
Type asType,
boolean isRequired,
OCLExpression asInitExpression)
Deprecated.
Use appropriate derived Variable
|
static VariableExp |
createVariableExp(Variable asVariable)
Deprecated.
API preserving redundancy
|
static VariableExp |
createVariableExp(VariableDeclaration asVariable) |
static VoidType |
createVoidType(EClass eClass) |
static VoidType |
createVoidType(String name) |
static void |
debugObjectUsage(String prefix,
EObject element) |
static boolean |
debugWellContainedness(Type type) |
static void |
formatDiagnostic(StringBuilder s,
Diagnostic diagnostic,
String newLine) |
static String |
formatDiagnostics(Diagnostic diagnostic,
String newLine) |
static String |
formatResourceDiagnostics(List<Resource.Diagnostic> diagnostics,
String messagePrefix,
String newLine) |
static Element |
getActual(TemplateParameterSubstitution templateParameterSubstitution) |
static Class |
getClass(TypedElement typedElement)
Return the type of a TypedElement, exploiting the known non-null and non-TypeParameter characteristics.
|
static Constraint |
getContainingConstraint(Element element) |
static ExpressionInOCL |
getContainingExpressionInOCL(Element element) |
static Model |
getContainingModel(EObject element) |
static Namespace |
getContainingNamespace(EObject element) |
static Operation |
getContainingOperation(EObject element) |
static Package |
getContainingPackage(EObject element) |
static Model |
getContainingRoot(EObject element)
Deprecated.
use getContainingModel
|
static Type |
getContainingType(EObject element) |
static int |
getContainmentDepth(EObject eObject)
Return the number of containers of eObject, 0 if eObject is a root.
|
static Type |
getContextType(LambdaType lambdaType) |
static Class<?> |
getEcoreInstanceClass(Property asProperty)
Return the Java Class used by Ecore for elements of asProperty, or null if not known.
|
static Type |
getElementalType(Type type) |
static Type |
getElementType(CollectionType collectionType) |
static Model |
getModel(Resource asResource)
Return the Model at the root of asResource.
|
static String |
getMultiplicity(TypedElement typedElement) |
static String |
getName(NamedElement namedElement) |
static Namespace |
getNamespace(EObject element) |
static String |
getNavigationOperator(boolean isSafe,
boolean isAggregate) |
static Property |
getOpposite(Property asProperty) |
static Iterable<Parameter> |
getOwnedAccumulators(Iteration iteration) |
static OCLExpression |
getOwnedArgument(OperationCallExp object,
int index) |
static Iterable<OCLExpression> |
getOwnedArguments(OperationCallExp operationCallExp) |
static Iterable<TemplateBinding> |
getOwnedBindings(TemplateableElement asElement) |
static OCLExpression |
getOwnedBody(ExpressionInOCL asExpression) |
static OCLExpression |
getOwnedBody(LoopExp loopExp) |
static Iterable<Operation> |
getOwnedClasses(Class asClass)
Deprecated.
|
static Iterable<Class> |
getOwnedClasses(Package asPackage) |
static Iterable<Comment> |
getOwnedComments(Element asElement) |
static Iterable<CompleteClass> |
getOwnedCompleteClasses(CompletePackage completePackage) |
static Iterable<CompletePackage> |
getOwnedCompletePackages(CompletePackage completePackage) |
static OCLExpression |
getOwnedCondition(IfExp ifExp) |
static VariableDeclaration |
getOwnedContext(ExpressionInOCL asExpression) |
static OCLExpression |
getOwnedElse(IfExp ifExp) |
static OCLExpression |
getOwnedFirst(CollectionRange collectionRange) |
static Iterable<Import> |
getOwnedImports(Model asModel) |
static OCLExpression |
getOwnedIn(LetExp letExp) |
static OCLExpression |
getOwnedInit(ShadowPart shadowPart) |
static OCLExpression |
getOwnedInit(Variable variable) |
static Iterable<Constraint> |
getOwnedInvariants(Class asClass) |
static OCLExpression |
getOwnedItem(CollectionItem collectionItem) |
static Iterable<Parameter> |
getOwnedIterators(Iteration iteration) |
static Iterable<Variable> |
getOwnedIterators(LoopExp loopExp) |
static OCLExpression |
getOwnedKey(MapLiteralPart mapLiteralPart) |
static OCLExpression |
getOwnedLast(CollectionRange collectionRange) |
static Iterable<Operation> |
getOwnedOperations(Class asClass) |
static Iterable<Package> |
getOwnedPackages(Model asModel) |
static Iterable<Package> |
getOwnedPackages(Package asPackage) |
static Parameter |
getOwnedParameter(Operation operation,
int index) |
static Iterable<Parameter> |
getOwnedParameters(Operation operation) |
static Iterable<TemplateParameter> |
getOwnedParameters(TemplateSignature templateSignature) |
static Iterable<CollectionLiteralPart> |
getOwnedParts(CollectionLiteralExp asCollectionLiteralExp) |
static Iterable<TupleLiteralPart> |
getOwnedParts(TupleLiteralExp asTupleLiteralExp) |
static Iterable<Constraint> |
getOwnedPostconditions(Operation asOperation) |
static Iterable<Constraint> |
getOwnedPreconditions(Operation asOperation) |
static Iterable<Property> |
getOwnedProperties(Class asClass) |
static Variable |
getOwnedResult(IterateExp iterateExp) |
static OCLExpression |
getOwnedSource(CallExp object) |
static Iterable<TemplateParameterSubstitution> |
getOwnedSubstitutions(TemplateBinding asTemplateBinding) |
static OCLExpression |
getOwnedThen(IfExp ifExp) |
static OCLExpression |
getOwnedValue(MapLiteralPart mapLiteralPart) |
static Variable |
getOwnedVariable(LetExp letExp) |
static Class |
getOwningClass(Operation operation) |
static Class |
getOwningClass(Property property) |
static Enumeration |
getOwningEnumeration(EnumerationLiteral enumerationLiteral) |
static Package |
getOwningPackage(Class asClass) |
static Package |
getPackage(EObject object) |
static List<Type> |
getParameterType(LambdaType lambdaType) |
static Iterable<Class> |
getPartialClasses(CompleteClass completeClass) |
static <T extends Element> |
getPivot(Class<T> pivotClass,
Pivotable pivotableElement) |
static Iterable<Operation> |
getRedefinedOperations(Operation operation) |
static Iterable<Property> |
getRedefinedProperties(Property property) |
static Feature |
getReferredFeature(CallExp callExp) |
static Iteration |
getReferredIteration(LoopExp loopExp) |
static EnumerationLiteral |
getReferredLiteral(EnumLiteralExp enumLiteralExp) |
static Operation |
getReferredOperation(CallExp callExp) |
static Property |
getReferredProperty(NavigationCallExp navigationCallExp) |
static Type |
getReferredType(TypeExp typeExp) |
static VariableDeclaration |
getReferredVariable(VariableExp variableExp) |
static Resource |
getResource(EObject eObject) |
static Type |
getResultType(LambdaType lambdaType) |
static int |
getSeverity(EnvironmentFactory environmentFactory) |
static Iterable<Class> |
getSuperClasses(Class asClass) |
static TupleType |
getType(TupleLiteralExp tupleLiteralExp)
Return the type of a TupleLiteralExp, exploiting the known non-null characteristics.
|
static Type |
getType(TypedElement typedElement)
Return the type of a TypedElement, exploiting the known non-null characteristics.
|
static <T extends TemplateableElement> |
getUnspecializedTemplateableElement(T templateableElement) |
static void |
initializeLoadOptionsToSupportSelfReferences(ResourceSet resourceSet)
The default ResourceSet.getLoadOptions() do not support loading models that reference themselves.
|
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(String operatorName) |
static boolean |
isObjectNavigationOperator(String operatorName) |
static boolean |
isSafeNavigationOperator(String operatorName) |
static boolean |
isSameOperation(OperationId operationId1,
OperationId operationId2) |
static void |
replaceChild(EObject oldChild,
EObject newChild)
Replace oldChild at its eContainer.eContainmentFeature by newChild.
|
static void |
rewriteSafeNavigations(EnvironmentFactory environmentFactory,
Element asTree)
Deprecated.
use PivotHelper
|
static void |
setBody(ExpressionInOCL expressionInOCL,
OCLExpression oclExpression,
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,
EObject eObject,
Object... unusedParameters)
Deprecated.
|
public static void addAllClasses(EnvironmentView environmentView, Package pPackage)
public static <T extends NamedElement> void addAllNamedElements(EnvironmentView environmentView, Iterable<T> namedElements)
public static void checkExpression(ExpressionInOCL expressionInOCL)
public static void checkResourceErrors(String message, Resource resource) throws ParserException
ParserException
public static void checkResourceWarnings(String message, Resource resource) throws ParserException
ParserException
public static boolean conformsTo(EClassifier targetType, EClassifier contentType)
public static boolean conformsTo(EStructuralFeature eStructuralFeature, EClassifier contentType)
public static AnyType createAnyType(EClass eClass)
public static Class createClass(EClass eClass)
public static CollectionType createCollectionType(CollectionType unspecializedType, Type elementType)
public static DataType createDataType(EDataType eDataType)
public static Enumeration createEnumeration(EEnum eEnum)
public static EnumerationLiteral createEnumerationLiteral(EEnumLiteral eEnumLiteral)
public static ExpressionInOCL createExpressionInOCL(Variable asContextVariable, OCLExpression asExpression, Variable... asParameterVariables)
public static ExpressionInOCL createExpressionInOCLError(String string)
public static InvalidType createInvalidType(String name)
public static InvalidType createInvalidType(EClass eClass)
public static Iteration createIteration(String name, Type type, String implementationClass, LibraryFeature implementation)
public static LambdaType createLambdaType(String name)
public static LetExp createLetExp(Variable asVariable, OCLExpression asIn)
public static MapType createMapType(MapType unspecializedType, Type keyType, Type valueType)
public static <T extends Model> T createModel(Class<T> pivotClass, EClass pivotEClass, String externalURI)
@Deprecated public static NavigationCallExp createNavigationCallExp(OCLExpression asSource, Property asProperty)
public static Operation createOperation(String name, Type type, String implementationClass, LibraryFeature implementation)
public static Operation createOperation(EOperation eOperation, Type type, String implementationClass, LibraryFeature implementation)
public static Operation createOperation(String name, ExpressionInOCL asExpressionInOCL)
@Deprecated public static OperationCallExp createOperationCallExp(OCLExpression asSource, Operation asOperation, OCLExpression... asArguments)
public static OrderedSetType createOrderedSetType(OrderedSetType unspecializedType, Type elementType)
public static Package createPackage(String name, String nsPrefix, String nsURI, PackageId packageId)
public static <T extends Package> T createPackage(Class<T> pivotClass, EClass pivotEClass, String name, String nsURI, PackageId packageId)
public static Parameter createParameter(String name, Type asType, boolean isRequired)
public static Precedence createPrecedence(String name, AssociativityKind kind)
public static PrimitiveType createPrimitiveType(String name)
public static PropertyCallExp createPropertyCallExp(OCLExpression asSource, Property asProperty)
public static SelfType createSelfType(EClass eClass)
public static SequenceType createSequenceType(SequenceType unspecializedType, Type elementType)
public static TemplateBinding createTemplateBinding(TemplateParameterSubstitution... templateParameterSubstitutions)
public static TemplateParameter createTemplateParameter(String name, Class... lowerBounds)
public static TemplateParameterSubstitution createTemplateParameterSubstitution(TemplateParameter formal, Type actual)
public static TemplateSignature createTemplateSignature(TemplateableElement templateableElement, TemplateParameter... templateParameters)
public static String createTupleValuedConstraint(String statusText, Integer severity, String messageText)
@Deprecated public static Variable createVariable(String name, OCLExpression asInitExpression)
@Deprecated public static Variable createVariable(String name, Type asType, boolean isRequired, OCLExpression asInitExpression)
public static VariableExp createVariableExp(VariableDeclaration asVariable)
@Deprecated public static VariableExp createVariableExp(Variable asVariable)
public static VoidType createVoidType(EClass eClass)
public static void debugObjectUsage(String prefix, EObject element)
public static boolean debugWellContainedness(Type type)
public static void formatDiagnostic(StringBuilder s, Diagnostic diagnostic, String newLine)
public static String formatResourceDiagnostics(List<Resource.Diagnostic> diagnostics, String messagePrefix, String newLine)
public static Element getActual(TemplateParameterSubstitution templateParameterSubstitution)
public static Class getClass(TypedElement typedElement)
IllegalStateException
- for a null typeClassCastException
- for a TypeParameterpublic static Constraint getContainingConstraint(Element element)
public static ExpressionInOCL getContainingExpressionInOCL(Element element)
public static Model getContainingModel(EObject element)
public static Namespace getContainingNamespace(EObject element)
public static Operation getContainingOperation(EObject element)
public static Package getContainingPackage(EObject element)
@Deprecated public static Model getContainingRoot(EObject element)
public static Type getContainingType(EObject element)
public static int getContainmentDepth(EObject eObject)
public static Type getContextType(LambdaType lambdaType)
public static Class<?> getEcoreInstanceClass(Property asProperty)
public static Type getElementType(CollectionType collectionType)
public static Model getModel(Resource asResource)
IllegalStateException
- if none.public static String getMultiplicity(TypedElement typedElement)
public static String getName(NamedElement namedElement)
public static Namespace getNamespace(EObject element)
public static String getNavigationOperator(boolean isSafe, boolean isAggregate)
public static Iterable<Parameter> getOwnedAccumulators(Iteration iteration)
public static OCLExpression getOwnedArgument(OperationCallExp object, int index)
public static Iterable<OCLExpression> getOwnedArguments(OperationCallExp operationCallExp)
public static Iterable<TemplateBinding> getOwnedBindings(TemplateableElement asElement)
public static OCLExpression getOwnedBody(ExpressionInOCL asExpression)
public static OCLExpression getOwnedBody(LoopExp loopExp)
@Deprecated public static Iterable<Operation> getOwnedClasses(Class asClass)
public static Iterable<CompleteClass> getOwnedCompleteClasses(CompletePackage completePackage)
public static Iterable<CompletePackage> getOwnedCompletePackages(CompletePackage completePackage)
public static OCLExpression getOwnedCondition(IfExp ifExp)
public static VariableDeclaration getOwnedContext(ExpressionInOCL asExpression)
public static OCLExpression getOwnedElse(IfExp ifExp)
public static OCLExpression getOwnedFirst(CollectionRange collectionRange)
public static OCLExpression getOwnedIn(LetExp letExp)
public static OCLExpression getOwnedInit(ShadowPart shadowPart)
public static OCLExpression getOwnedInit(Variable variable)
public static Iterable<Constraint> getOwnedInvariants(Class asClass)
public static OCLExpression getOwnedItem(CollectionItem collectionItem)
public static Iterable<Parameter> getOwnedIterators(Iteration iteration)
public static OCLExpression getOwnedKey(MapLiteralPart mapLiteralPart)
public static OCLExpression getOwnedLast(CollectionRange collectionRange)
public static Parameter getOwnedParameter(Operation operation, int index)
public static Iterable<Parameter> getOwnedParameters(Operation operation)
public static Iterable<TemplateParameter> getOwnedParameters(TemplateSignature templateSignature)
public static Iterable<CollectionLiteralPart> getOwnedParts(CollectionLiteralExp asCollectionLiteralExp)
public static Iterable<TupleLiteralPart> getOwnedParts(TupleLiteralExp asTupleLiteralExp)
public static Iterable<Constraint> getOwnedPostconditions(Operation asOperation)
public static Iterable<Constraint> getOwnedPreconditions(Operation asOperation)
public static Variable getOwnedResult(IterateExp iterateExp)
public static OCLExpression getOwnedSource(CallExp object)
public static Iterable<TemplateParameterSubstitution> getOwnedSubstitutions(TemplateBinding asTemplateBinding)
public static OCLExpression getOwnedThen(IfExp ifExp)
public static OCLExpression getOwnedValue(MapLiteralPart mapLiteralPart)
public static Enumeration getOwningEnumeration(EnumerationLiteral enumerationLiteral)
public static Package getPackage(EObject object)
public static List<Type> getParameterType(LambdaType lambdaType)
public static Iterable<Class> getPartialClasses(CompleteClass completeClass)
public static <T extends Element> T getPivot(Class<T> pivotClass, Pivotable pivotableElement)
public static Iterable<Operation> getRedefinedOperations(Operation operation)
public static Iterable<Property> getRedefinedProperties(Property property)
public static EnumerationLiteral getReferredLiteral(EnumLiteralExp enumLiteralExp)
public static Property getReferredProperty(NavigationCallExp navigationCallExp)
public static VariableDeclaration getReferredVariable(VariableExp variableExp)
public static Resource getResource(EObject eObject)
public static int getSeverity(EnvironmentFactory environmentFactory)
public static Type getResultType(LambdaType lambdaType)
public static Type getType(TypedElement typedElement)
IllegalStateException
- for a null typepublic static TupleType getType(TupleLiteralExp tupleLiteralExp)
IllegalStateException
- for a null typepublic static <T extends TemplateableElement> T getUnspecializedTemplateableElement(T templateableElement)
public static Operation initOperation(Operation asOperation, ExpressionInOCL asExpressionInOCL)
public static void initializeLoadOptionsToSupportSelfReferences(ResourceSet resourceSet)
public static boolean isAggregate(Type type)
public static boolean isAggregateNavigationOperator(String operatorName)
public static boolean isObjectNavigationOperator(String operatorName)
public static boolean isSafeNavigationOperator(String operatorName)
public static boolean isSameOperation(OperationId operationId1, OperationId operationId2)
public static void replaceChild(EObject oldChild, EObject newChild)
@Deprecated public static void rewriteSafeNavigations(EnvironmentFactory environmentFactory, Element asTree)
public static void setBody(ExpressionInOCL expressionInOCL, OCLExpression oclExpression, String stringExpression)
@Deprecated public static boolean setParserContext(CSResource csResource, EObject eObject, Object... unusedParameters) throws ParserException
ParserException
- if eObject cannot be converted to a Pivot elementCopyright © 2005, 2018 IBM Corporation and others. All Rights Reserved.