org.eclipse.ocl.examples.pivot.utilities
Class PivotUtil

java.lang.Object
  extended by org.eclipse.ocl.examples.domain.utilities.DomainUtil
      extended by org.eclipse.ocl.examples.pivot.utilities.PivotUtil

public class PivotUtil
extends DomainUtil


Nested Class Summary
static class PivotUtil.PrecedenceComparator
          'Highest' precedence first
static class PivotUtil.TemplateParameterSubstitutionComparator
          In TemplateSignature order.
 
Field Summary
static java.lang.String SCHEME_PIVOT
           
 
Constructor Summary
PivotUtil()
           
 
Method Summary
static void appendMultiplicity(java.lang.StringBuilder s, int lower, int upper)
           
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 java.lang.String convertFromOCLString(java.lang.String javaString)
          Mostly copied from Properties.loadConvert(char[], int, int, char[]) via Strings.convertFromJavaString(java.lang.String, boolean)
static java.lang.String convertToOCLString(java.lang.String theString)
          Mostly copied from Properties.saveConvert(java.lang.String, boolean, boolean) via Strings.convertToJavaString(java.lang.String)
static void debugObjectUsage(java.lang.String prefix, org.eclipse.emf.ecore.EObject element)
           
static boolean debugWellContainedness(Type type)
           
static Type findTypeOf(MetaModelManager metaModelManager, org.eclipse.emf.ecore.EClassifier eClass)
           
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
<T> T
getAdapter(java.lang.Class<T> adapterClass, java.util.List<org.eclipse.emf.common.notify.Adapter> eAdapters)
           
static
<T> T
getAdapter(java.lang.Class<T> adapterClass, org.eclipse.emf.common.notify.Notifier notifier)
           
static java.util.List<java.util.List<TemplateParameter>> getAllTemplateParameterLists(org.eclipse.emf.ecore.EObject eObject)
           
static java.util.List<TemplateParameter> getAllTemplateParameters(java.util.Collection<TemplateBinding> templateBindings)
           
static java.util.List<TemplateParameter> getAllTemplateParameters(org.eclipse.emf.ecore.EObject eObject)
           
static java.util.Map<TemplateParameter,ParameterableElement> getAllTemplateParametersAsBindings(org.eclipse.emf.ecore.EObject eObject)
           
static java.util.Map<TemplateParameter,ParameterableElement> getAllTemplateParameterSubstitutions(java.util.Map<TemplateParameter,ParameterableElement> map, TemplateableElement templateableElement)
           
static java.util.Map<TemplateParameter,ParameterableElement> getAllTemplateParameterSubstitutions(java.util.Map<TemplateParameter,ParameterableElement> bindings, Type argumentType, LambdaType lambdaType)
           
static Attribution getAttribution(org.eclipse.emf.ecore.EObject eObject)
           
static Type getBehavioralType(Type type)
           
static java.lang.String getBody(OpaqueExpression specification)
           
static CollectionKind getCollectionKind(CollectionType collectionType)
           
static java.lang.String getConstraintTypeName(Constraint constraint)
           
static java.lang.String getConstraintTypeName(ExpressionInOCL expression)
           
static int getContainmentDepth(org.eclipse.emf.ecore.EObject eObject)
          Return the number of containers of eObject, 0 if eObject is a root.
static Element getLowerBound(Element element)
          Return the lower bound for scope resolution lookups in element.
static java.lang.String getMessage(OpaqueExpression specification)
           
static MetaModelManager getMetaModelManager(org.eclipse.emf.ecore.resource.Resource resource)
           
static
<T extends NamedElement>
T
getNamedElement(java.lang.Iterable<T> elements, java.lang.String name)
           
static Namespace getNamespace(org.eclipse.emf.ecore.EObject element)
           
static org.eclipse.emf.common.util.URI getNonPivotURI(org.eclipse.emf.common.util.URI uri)
           
static java.lang.String getNsURI(Element element)
          Return a URI based on the nsURI of the immediate parent package.
static java.lang.String getNsURI(org.eclipse.emf.ecore.EModelElement element)
          Return a URI based on the nsURI of the immediate parent package.
static Type getOwningType(Feature feature)
           
static Package getPackage(org.eclipse.emf.ecore.EObject object)
           
static
<T extends Element>
T
getPivot(java.lang.Class<T> pivotClass, Pivotable pivotableElement)
           
static org.eclipse.emf.common.util.URI getPivotURI(org.eclipse.emf.common.util.URI uri)
           
static Feature getReferredFeature(CallExp callExp)
           
static Operation getReferredOperation(CallExp callExp)
           
static java.util.List<ParameterableElement> getTemplateParameterables(TemplateableElement templateableElement)
           
static java.util.List<TemplateParameter> getTemplateParameters(TemplateableElement templateableElement)
           
static java.util.List<Type> getTypeTemplateParameterables(TemplateableElement templateableElement)
           
static
<T extends Type>
T
getUnspecializedTemplateableElement(T templateableElement)
           
static boolean isLibraryType(Type type)
           
static boolean isPivotURI(org.eclipse.emf.common.util.URI uri)
           
static boolean isValidIdentifier(java.lang.String value)
           
static void localizeSpecializations(org.eclipse.emf.ecore.resource.Resource pivotResource)
          Create local copies of specializations in a local orphanage so that pivotResource can be saved without dangling references to the global orphanage.
static
<T extends org.eclipse.emf.ecore.EObject>
void
refreshList(java.util.List<? super T> elements, java.util.List<? extends T> newElements)
           
static
<T extends org.eclipse.emf.ecore.EObject>
void
refreshSet(java.util.List<? super T> oldElements, java.util.Collection<? extends T> newElements)
           
static char toHex(int nibble)
          Copied from Properties
 
Methods inherited from class org.eclipse.ocl.examples.domain.utilities.DomainUtil
bind, debugFullName, debugSimpleName, getLabel, getLabel, suppressThrowWarnings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCHEME_PIVOT

public static final java.lang.String SCHEME_PIVOT
See Also:
Constant Field Values
Constructor Detail

PivotUtil

public PivotUtil()
Method Detail

appendMultiplicity

public static void appendMultiplicity(java.lang.StringBuilder s,
                                      int lower,
                                      int upper)

checkResourceErrors

public static void checkResourceErrors(java.lang.String message,
                                       org.eclipse.emf.ecore.resource.Resource resource)
                                throws ParserException
Throws:
ParserException

conformsTo

public static boolean conformsTo(org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature,
                                 org.eclipse.emf.ecore.EClassifier contentType)

conformsTo

public static boolean conformsTo(org.eclipse.emf.ecore.EClassifier targetType,
                                 org.eclipse.emf.ecore.EClassifier contentType)

convertFromOCLString

public static java.lang.String convertFromOCLString(java.lang.String javaString)
Mostly copied from Properties.loadConvert(char[], int, int, char[]) via Strings.convertFromJavaString(java.lang.String, boolean)


convertToOCLString

public static java.lang.String convertToOCLString(java.lang.String theString)
Mostly copied from Properties.saveConvert(java.lang.String, boolean, boolean) via Strings.convertToJavaString(java.lang.String)


debugObjectUsage

public static void debugObjectUsage(java.lang.String prefix,
                                    org.eclipse.emf.ecore.EObject element)

debugWellContainedness

public static boolean debugWellContainedness(Type type)

findTypeOf

public static Type findTypeOf(MetaModelManager metaModelManager,
                              org.eclipse.emf.ecore.EClassifier eClass)

formatResourceDiagnostics

public static java.lang.String formatResourceDiagnostics(java.util.List<org.eclipse.emf.ecore.resource.Resource.Diagnostic> diagnostics,
                                                         java.lang.String messagePrefix,
                                                         java.lang.String newLine)

getAdapter

public static <T> T getAdapter(java.lang.Class<T> adapterClass,
                               org.eclipse.emf.common.notify.Notifier notifier)

getAdapter

public static <T> T getAdapter(java.lang.Class<T> adapterClass,
                               java.util.List<org.eclipse.emf.common.notify.Adapter> eAdapters)

getAllTemplateParameters

public static java.util.List<TemplateParameter> getAllTemplateParameters(java.util.Collection<TemplateBinding> templateBindings)

getAllTemplateParameterLists

public static java.util.List<java.util.List<TemplateParameter>> getAllTemplateParameterLists(org.eclipse.emf.ecore.EObject eObject)

getAllTemplateParameters

public static java.util.List<TemplateParameter> getAllTemplateParameters(org.eclipse.emf.ecore.EObject eObject)

getAllTemplateParametersAsBindings

public static java.util.Map<TemplateParameter,ParameterableElement> getAllTemplateParametersAsBindings(org.eclipse.emf.ecore.EObject eObject)

getAllTemplateParameterSubstitutions

public static java.util.Map<TemplateParameter,ParameterableElement> getAllTemplateParameterSubstitutions(java.util.Map<TemplateParameter,ParameterableElement> map,
                                                                                                         TemplateableElement templateableElement)

getAllTemplateParameterSubstitutions

public static java.util.Map<TemplateParameter,ParameterableElement> getAllTemplateParameterSubstitutions(java.util.Map<TemplateParameter,ParameterableElement> bindings,
                                                                                                         Type argumentType,
                                                                                                         LambdaType lambdaType)

getAttribution

public static Attribution getAttribution(org.eclipse.emf.ecore.EObject eObject)

getBehavioralType

public static Type getBehavioralType(Type type)

getBody

public static java.lang.String getBody(OpaqueExpression specification)

getCollectionKind

public static CollectionKind getCollectionKind(CollectionType collectionType)

getConstraintTypeName

public static java.lang.String getConstraintTypeName(ExpressionInOCL expression)

getConstraintTypeName

public static java.lang.String getConstraintTypeName(Constraint constraint)

getContainmentDepth

public static int getContainmentDepth(org.eclipse.emf.ecore.EObject eObject)
Return the number of containers of eObject, 0 if eObject is a root.


getNamedElement

public static <T extends NamedElement> T getNamedElement(java.lang.Iterable<T> elements,
                                                         java.lang.String name)

getOwningType

public static Type getOwningType(Feature feature)

getPackage

public static Package getPackage(org.eclipse.emf.ecore.EObject object)

getLowerBound

public static Element getLowerBound(Element element)
Return the lower bound for scope resolution lookups in element. This is element unless element is an UnspecifiedType in which case the derived type is returned.


getMessage

public static java.lang.String getMessage(OpaqueExpression specification)

getNamespace

public static Namespace getNamespace(org.eclipse.emf.ecore.EObject element)

getNonPivotURI

public static org.eclipse.emf.common.util.URI getNonPivotURI(org.eclipse.emf.common.util.URI uri)

getPivot

public static <T extends Element> T getPivot(java.lang.Class<T> pivotClass,
                                             Pivotable pivotableElement)

getPivotURI

public static org.eclipse.emf.common.util.URI getPivotURI(org.eclipse.emf.common.util.URI uri)

getReferredFeature

public static Feature getReferredFeature(CallExp callExp)

getReferredOperation

public static Operation getReferredOperation(CallExp callExp)

getTemplateParameters

public static java.util.List<TemplateParameter> getTemplateParameters(TemplateableElement templateableElement)

getTemplateParameterables

public static java.util.List<ParameterableElement> getTemplateParameterables(TemplateableElement templateableElement)

getMetaModelManager

public static MetaModelManager getMetaModelManager(org.eclipse.emf.ecore.resource.Resource resource)

getNsURI

public static java.lang.String getNsURI(org.eclipse.emf.ecore.EModelElement element)
Return a URI based on the nsURI of the immediate parent package.


getNsURI

public static java.lang.String getNsURI(Element element)
Return a URI based on the nsURI of the immediate parent package.


getTypeTemplateParameterables

public static java.util.List<Type> getTypeTemplateParameterables(TemplateableElement templateableElement)

getUnspecializedTemplateableElement

public static <T extends Type> T getUnspecializedTemplateableElement(T templateableElement)

isLibraryType

public static boolean isLibraryType(Type type)

isPivotURI

public static boolean isPivotURI(org.eclipse.emf.common.util.URI uri)

isValidIdentifier

public static boolean isValidIdentifier(java.lang.String value)

localizeSpecializations

public static void localizeSpecializations(org.eclipse.emf.ecore.resource.Resource pivotResource)
Create local copies of specializations in a local orphanage so that pivotResource can be saved without dangling references to the global orphanage.


refreshList

public static <T extends org.eclipse.emf.ecore.EObject> void refreshList(java.util.List<? super T> elements,
                                                                         java.util.List<? extends T> newElements)

refreshSet

public static <T extends org.eclipse.emf.ecore.EObject> void refreshSet(java.util.List<? super T> oldElements,
                                                                        java.util.Collection<? extends T> newElements)

toHex

public static char toHex(int nibble)
Copied from Properties