edu.cmu.sei.aadl.aadl2.operations
Class ElementOperations

java.lang.Object
  extended by edu.cmu.sei.aadl.aadl2.operations.ElementOperations
Direct Known Subclasses:
NamedElementOperations

public class ElementOperations
extends java.lang.Object

A static utility class that provides operations related to 'Element' model objects.

The following operations are supported:


Field Summary
protected static java.lang.String ALL_OWNED_ELEMENTS__EOCL_EXP
          The cached OCL expression body for the 'All Owned Elements' operation
protected static org.eclipse.ocl.expressions.OCLExpression<org.eclipse.emf.ecore.EClassifier> ALL_OWNED_ELEMENTS__EOCL_QRY
          The cached OCL query for the 'All Owned Elements' query operation
protected static org.eclipse.ocl.ecore.OCL EOCL_ENV
          The cached environment for evaluating OCL expressions
protected static java.lang.String HAS_OWNER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP
          The cached OCL expression body for the 'Has owner' operation
protected static org.eclipse.ocl.ecore.Constraint HAS_OWNER__DIAGNOSTIC_CHAIN_MAP__EOCL_INV
          The cached OCL invariant for the 'Has owner' invariant operation
protected static java.lang.String MUST_BE_OWNED__EOCL_EXP
          The cached OCL expression body for the 'Must Be Owned' operation
protected static org.eclipse.ocl.expressions.OCLExpression<org.eclipse.emf.ecore.EClassifier> MUST_BE_OWNED__EOCL_QRY
          The cached OCL query for the 'Must Be Owned' query operation
protected static java.lang.String NOT_OWN_SELF__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP
          The cached OCL expression body for the 'Not own self' operation
protected static org.eclipse.ocl.ecore.Constraint NOT_OWN_SELF__DIAGNOSTIC_CHAIN_MAP__EOCL_INV
          The cached OCL invariant for the 'Not own self' invariant operation
 
Constructor Summary
protected ElementOperations()
           
 
Method Summary
static org.eclipse.emf.common.util.EList<Element> allOwnedElements(Element element)
          The query allOwnedElements() gives all of the direct and indirect owned elements of an element.
static boolean has_owner(Element element, org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
          Elements that must be owned must have an owner.
static boolean mustBeOwned(Element element)
          The query mustBeOwned() indicates whether elements of this type must have an owner.
static boolean not_own_self(Element element, org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
          An element may not directly or indirectly own itself.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EOCL_ENV

protected static final org.eclipse.ocl.ecore.OCL EOCL_ENV
The cached environment for evaluating OCL expressions.


NOT_OWN_SELF__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP

protected static final java.lang.String NOT_OWN_SELF__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP
The cached OCL expression body for the 'Not own self' operation.

See Also:
not_own_self(Element, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map), Constant Field Values

NOT_OWN_SELF__DIAGNOSTIC_CHAIN_MAP__EOCL_INV

protected static org.eclipse.ocl.ecore.Constraint NOT_OWN_SELF__DIAGNOSTIC_CHAIN_MAP__EOCL_INV
The cached OCL invariant for the 'Not own self' invariant operation.

See Also:
not_own_self(Element, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map)

HAS_OWNER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP

protected static final java.lang.String HAS_OWNER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP
The cached OCL expression body for the 'Has owner' operation.

See Also:
has_owner(Element, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map), Constant Field Values

HAS_OWNER__DIAGNOSTIC_CHAIN_MAP__EOCL_INV

protected static org.eclipse.ocl.ecore.Constraint HAS_OWNER__DIAGNOSTIC_CHAIN_MAP__EOCL_INV
The cached OCL invariant for the 'Has owner' invariant operation.

See Also:
has_owner(Element, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map)

ALL_OWNED_ELEMENTS__EOCL_EXP

protected static final java.lang.String ALL_OWNED_ELEMENTS__EOCL_EXP
The cached OCL expression body for the 'All Owned Elements' operation.

See Also:
allOwnedElements(Element), Constant Field Values

ALL_OWNED_ELEMENTS__EOCL_QRY

protected static org.eclipse.ocl.expressions.OCLExpression<org.eclipse.emf.ecore.EClassifier> ALL_OWNED_ELEMENTS__EOCL_QRY
The cached OCL query for the 'All Owned Elements' query operation.

See Also:
allOwnedElements(Element)

MUST_BE_OWNED__EOCL_EXP

protected static final java.lang.String MUST_BE_OWNED__EOCL_EXP
The cached OCL expression body for the 'Must Be Owned' operation.

See Also:
mustBeOwned(Element), Constant Field Values

MUST_BE_OWNED__EOCL_QRY

protected static org.eclipse.ocl.expressions.OCLExpression<org.eclipse.emf.ecore.EClassifier> MUST_BE_OWNED__EOCL_QRY
The cached OCL query for the 'Must Be Owned' query operation.

See Also:
mustBeOwned(Element)
Constructor Detail

ElementOperations

protected ElementOperations()

Method Detail

not_own_self

public static boolean not_own_self(Element element,
                                   org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                                   java.util.Map<java.lang.Object,java.lang.Object> context)
An element may not directly or indirectly own itself. not self.allOwnedElements()->includes(self)

Parameters:
element - The receiving 'Element' model object.
diagnostics - The chain of diagnostics to which problems are to be appended.
context - The cache of context-specific information.

has_owner

public static boolean has_owner(Element element,
                                org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                                java.util.Map<java.lang.Object,java.lang.Object> context)
Elements that must be owned must have an owner. self.mustBeOwned() implies owner->notEmpty()

Parameters:
element - The receiving 'Element' model object.
diagnostics - The chain of diagnostics to which problems are to be appended.
context - The cache of context-specific information.

allOwnedElements

public static org.eclipse.emf.common.util.EList<Element> allOwnedElements(Element element)
The query allOwnedElements() gives all of the direct and indirect owned elements of an element. ownedElement->union(ownedElement->collect(e | e.allOwnedElements()))

Parameters:
element - The receiving 'Element' model object.

mustBeOwned

public static boolean mustBeOwned(Element element)
The query mustBeOwned() indicates whether elements of this type must have an owner. Subclasses of Element that do not require an owner must override this operation. true

Parameters:
element - The receiving 'Element' model object.