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

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

public class NamedElementOperations
extends ElementOperations

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

The following operations are supported:


Field Summary
protected static java.lang.String ALL_NAMESPACES__EOCL_EXP
          The cached OCL expression body for the 'All Namespaces' operation
protected static org.eclipse.ocl.expressions.OCLExpression<org.eclipse.emf.ecore.EClassifier> ALL_NAMESPACES__EOCL_QRY
          The cached OCL query for the 'All Namespaces' query operation
protected static java.lang.String HAS_NO_QUALIFIED_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP
          The cached OCL expression body for the 'Has no qualified name' operation
protected static org.eclipse.ocl.ecore.Constraint HAS_NO_QUALIFIED_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_INV
          The cached OCL invariant for the 'Has no qualified name' invariant operation
protected static java.lang.String HAS_QUALIFIED_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP
          The cached OCL expression body for the 'Has qualified name' operation
protected static org.eclipse.ocl.ecore.Constraint HAS_QUALIFIED_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_INV
          The cached OCL invariant for the 'Has qualified name' invariant operation
protected static java.lang.String IS_DISTINGUISHABLE_FROM__NAMED_ELEMENT_NAMESPACE__EOCL_EXP
          The cached OCL expression body for the 'Is Distinguishable From' operation
protected static org.eclipse.ocl.expressions.OCLExpression<org.eclipse.emf.ecore.EClassifier> IS_DISTINGUISHABLE_FROM__NAMED_ELEMENT_NAMESPACE__EOCL_QRY
          The cached OCL query for the 'Is Distinguishable From' query operation
protected static java.lang.String QUALIFIED_NAME__EOCL_EXP
          The cached OCL expression body for the 'Qualified Name' operation
protected static org.eclipse.ocl.expressions.OCLExpression<org.eclipse.emf.ecore.EClassifier> QUALIFIED_NAME__EOCL_QRY
          The cached OCL query for the 'Qualified Name' query operation
protected static java.lang.String SEPARATOR__EOCL_EXP
          The cached OCL expression body for the 'Separator' operation
protected static org.eclipse.ocl.expressions.OCLExpression<org.eclipse.emf.ecore.EClassifier> SEPARATOR__EOCL_QRY
          The cached OCL query for the 'Separator' query operation
 
Fields inherited from class edu.cmu.sei.aadl.aadl2.operations.ElementOperations
ALL_OWNED_ELEMENTS__EOCL_EXP, ALL_OWNED_ELEMENTS__EOCL_QRY, EOCL_ENV, HAS_OWNER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP, HAS_OWNER__DIAGNOSTIC_CHAIN_MAP__EOCL_INV, MUST_BE_OWNED__EOCL_EXP, MUST_BE_OWNED__EOCL_QRY, NOT_OWN_SELF__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP, NOT_OWN_SELF__DIAGNOSTIC_CHAIN_MAP__EOCL_INV
 
Constructor Summary
protected NamedElementOperations()
           
 
Method Summary
static org.eclipse.emf.common.util.EList<Namespace> allNamespaces(NamedElement namedElement)
          The query allNamespaces() gives the sequence of namespaces in which the NamedElement is nested, working outwards.
static boolean has_no_qualified_name(NamedElement namedElement, org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
          If there is no name, or one of the containing namespaces has no name, there is no qualified name.
static boolean has_qualified_name(NamedElement namedElement, org.eclipse.emf.common.util.DiagnosticChain diagnostics, java.util.Map<java.lang.Object,java.lang.Object> context)
          When there is a name, and all of the containing namespaces have a name, the qualified name is constructed from the names of the containing namespaces.
static boolean isDistinguishableFrom(NamedElement namedElement, NamedElement n, Namespace ns)
          The query isDistinguishableFrom() determines whether two NamedElements may logically co-exist within a Namespace.
static java.lang.String qualifiedName(NamedElement namedElement)
          When there is a name, and all of the containing namespaces have a name, the qualified name is constructed from the names of the containing namespaces.
static java.lang.String separator(NamedElement namedElement)
          The query separator() gives the string that is used to separate names when constructing a qualified name
 
Methods inherited from class edu.cmu.sei.aadl.aadl2.operations.ElementOperations
allOwnedElements, has_owner, mustBeOwned, not_own_self
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HAS_NO_QUALIFIED_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP

protected static final java.lang.String HAS_NO_QUALIFIED_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP
The cached OCL expression body for the 'Has no qualified name' operation.

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

HAS_NO_QUALIFIED_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_INV

protected static org.eclipse.ocl.ecore.Constraint HAS_NO_QUALIFIED_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_INV
The cached OCL invariant for the 'Has no qualified name' invariant operation.

See Also:
has_no_qualified_name(NamedElement, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map)

HAS_QUALIFIED_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP

protected static final java.lang.String HAS_QUALIFIED_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP
The cached OCL expression body for the 'Has qualified name' operation.

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

HAS_QUALIFIED_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_INV

protected static org.eclipse.ocl.ecore.Constraint HAS_QUALIFIED_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_INV
The cached OCL invariant for the 'Has qualified name' invariant operation.

See Also:
has_qualified_name(NamedElement, org.eclipse.emf.common.util.DiagnosticChain, java.util.Map)

ALL_NAMESPACES__EOCL_EXP

protected static final java.lang.String ALL_NAMESPACES__EOCL_EXP
The cached OCL expression body for the 'All Namespaces' operation.

See Also:
allNamespaces(NamedElement), Constant Field Values

ALL_NAMESPACES__EOCL_QRY

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

See Also:
allNamespaces(NamedElement)

IS_DISTINGUISHABLE_FROM__NAMED_ELEMENT_NAMESPACE__EOCL_EXP

protected static final java.lang.String IS_DISTINGUISHABLE_FROM__NAMED_ELEMENT_NAMESPACE__EOCL_EXP
The cached OCL expression body for the 'Is Distinguishable From' operation.

See Also:
isDistinguishableFrom(NamedElement, edu.cmu.sei.aadl.aadl2.NamedElement, edu.cmu.sei.aadl.aadl2.Namespace), Constant Field Values

IS_DISTINGUISHABLE_FROM__NAMED_ELEMENT_NAMESPACE__EOCL_QRY

protected static org.eclipse.ocl.expressions.OCLExpression<org.eclipse.emf.ecore.EClassifier> IS_DISTINGUISHABLE_FROM__NAMED_ELEMENT_NAMESPACE__EOCL_QRY
The cached OCL query for the 'Is Distinguishable From' query operation.

See Also:
isDistinguishableFrom(NamedElement, edu.cmu.sei.aadl.aadl2.NamedElement, edu.cmu.sei.aadl.aadl2.Namespace)

SEPARATOR__EOCL_EXP

protected static final java.lang.String SEPARATOR__EOCL_EXP
The cached OCL expression body for the 'Separator' operation.

See Also:
separator(NamedElement), Constant Field Values

SEPARATOR__EOCL_QRY

protected static org.eclipse.ocl.expressions.OCLExpression<org.eclipse.emf.ecore.EClassifier> SEPARATOR__EOCL_QRY
The cached OCL query for the 'Separator' query operation.

See Also:
separator(NamedElement)

QUALIFIED_NAME__EOCL_EXP

protected static final java.lang.String QUALIFIED_NAME__EOCL_EXP
The cached OCL expression body for the 'Qualified Name' operation.

See Also:
qualifiedName(NamedElement), Constant Field Values

QUALIFIED_NAME__EOCL_QRY

protected static org.eclipse.ocl.expressions.OCLExpression<org.eclipse.emf.ecore.EClassifier> QUALIFIED_NAME__EOCL_QRY
The cached OCL query for the 'Qualified Name' query operation.

See Also:
qualifiedName(NamedElement)
Constructor Detail

NamedElementOperations

protected NamedElementOperations()

Method Detail

has_no_qualified_name

public static boolean has_no_qualified_name(NamedElement namedElement,
                                            org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                                            java.util.Map<java.lang.Object,java.lang.Object> context)
If there is no name, or one of the containing namespaces has no name, there is no qualified name. (self.name->isEmpty() or self.allNamespaces()->select(ns | ns.name->isEmpty())->notEmpty()) implies self.qualifiedName->isEmpty()

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

has_qualified_name

public static boolean has_qualified_name(NamedElement namedElement,
                                         org.eclipse.emf.common.util.DiagnosticChain diagnostics,
                                         java.util.Map<java.lang.Object,java.lang.Object> context)
When there is a name, and all of the containing namespaces have a name, the qualified name is constructed from the names of the containing namespaces. (self.name->notEmpty() and self.allNamespaces()->select(ns | ns.name->isEmpty())->isEmpty()) implies self.qualifiedName = self.allNamespaces()->iterate(ns: Namespace; result: String = self.name | ns.name.concat(self.separator()).concat(result))

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

allNamespaces

public static org.eclipse.emf.common.util.EList<Namespace> allNamespaces(NamedElement namedElement)
The query allNamespaces() gives the sequence of namespaces in which the NamedElement is nested, working outwards. if self.namespace->isEmpty() then Sequence{} else self.namespace.allNamespaces()->prepend(self.namespace) endif

Parameters:
namedElement - The receiving 'Named Element' model object.

isDistinguishableFrom

public static boolean isDistinguishableFrom(NamedElement namedElement,
                                            NamedElement n,
                                            Namespace ns)
The query isDistinguishableFrom() determines whether two NamedElements may logically co-exist within a Namespace. By default, two named elements are distinguishable if (a) they have unrelated types or (b) they have related types but different names. if self.oclIsKindOf(n.oclType) or n.oclIsKindOf(self.oclType) then ns.getNamesOfMember(self)->intersection(ns.getNamesOfMember(n))->isEmpty() else true endif

Parameters:
namedElement - The receiving 'Named Element' model object.

separator

public static java.lang.String separator(NamedElement namedElement)
The query separator() gives the string that is used to separate names when constructing a qualified name. '.'

Parameters:
namedElement - The receiving 'Named Element' model object.

qualifiedName

public static java.lang.String qualifiedName(NamedElement namedElement)
When there is a name, and all of the containing namespaces have a name, the qualified name is constructed from the names of the containing namespaces. if self.name->notEmpty() and self.allNamespaces()->select(ns | ns.name->isEmpty())->isEmpty() then self.allNamespaces()->iterate(ns: Namespace; result: String = self.name | ns.name.concat(self.separator()).concat(result)) else '' endif

Parameters:
namedElement - The receiving 'Named Element' model object.