org.eclipse.ocl.examples.pivot.ecore
Class Pivot2Ecore

java.lang.Object
  extended by org.eclipse.ocl.examples.pivot.utilities.AbstractConversion
      extended by org.eclipse.ocl.examples.pivot.ecore.Pivot2Ecore

public class Pivot2Ecore
extends AbstractConversion


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.ocl.examples.pivot.utilities.AbstractConversion
AbstractConversion.Predicate<T extends org.eclipse.emf.ecore.EObject>
 
Field Summary
protected  DelegateInstaller delegateInstaller
           
protected  org.eclipse.emf.common.util.URI ecoreURI
           
static org.apache.log4j.Logger logger
           
static java.lang.String OPTION_ADD_INVARIANT_COMMENTS
          True to add comments to the invariant context and doagnostics parameters.
static java.lang.String OPTION_BOOLEAN_INVARIANTS
          True to apply result = () wrapper to invariant body.
static java.lang.String OPTION_SUPPRESS_DUPLICATES
          True to suppress the UML2Ecore duplicates EAnnotation.
protected  java.util.Map<java.lang.String,java.lang.Object> options
           
protected  Pivot2EcoreDeclarationVisitor pass1
           
protected  Pivot2EcoreReferenceVisitor pass2
           
protected  java.lang.String primitiveTypesUriPrefix
           
 
Fields inherited from class org.eclipse.ocl.examples.pivot.utilities.AbstractConversion
metaModelManager
 
Constructor Summary
Pivot2Ecore(MetaModelManager metaModelManager, org.eclipse.emf.common.util.URI ecoreURI, java.util.Map<java.lang.String,java.lang.Object> options)
           
 
Method Summary
protected  java.lang.Object convert(Element pivotObject)
           
 org.eclipse.emf.ecore.xmi.XMLResource convertResource(org.eclipse.emf.ecore.resource.Resource asResource, org.eclipse.emf.common.util.URI ecoreURI)
           
static void copyAnnotationComments(org.eclipse.emf.ecore.EAnnotation eModelElement, Constraint pivotConstraint)
           
static void copyComments(org.eclipse.emf.ecore.EModelElement eModelElement, Element pivotElement)
           
static org.eclipse.emf.ecore.EOperation createConstraintEOperation(Constraint pivotConstraint, java.lang.String operationName)
          Deprecated. 
static org.eclipse.emf.ecore.EOperation createConstraintEOperation(Constraint pivotConstraint, java.lang.String operationName, java.util.Map<java.lang.String,java.lang.Object> options)
           
static org.eclipse.emf.ecore.xmi.XMLResource createResource(MetaModelManager metaModelManager, org.eclipse.emf.ecore.resource.Resource asResource, org.eclipse.emf.common.util.URI ecoreURI, java.util.Map<java.lang.String,java.lang.Object> options)
           
 void defer(Element pivotElement)
           
protected  void error(java.lang.String message)
           
static java.lang.Boolean getBoolean(java.util.Map<java.lang.String,java.lang.Object> options, java.lang.String key)
           
<T extends org.eclipse.emf.ecore.EObject>
T
getCreated(java.lang.Class<T> requiredClass, Element pivotElement)
           
 DelegateInstaller getDelegateInstaller()
           
 org.eclipse.emf.common.util.URI getEcoreURI()
           
static java.lang.String getExportDelegateURI(java.util.Map<java.lang.String,java.lang.Object> options)
           
 java.util.Map<java.lang.String,java.lang.Object> getOptions()
           
 java.lang.String getPrimitiveTypesUriPrefix()
           
static java.lang.String getString(java.util.Map<java.lang.String,java.lang.Object> options, java.lang.String key)
           
static boolean isAddInvariantComments(java.util.Map<java.lang.String,java.lang.Object> options)
           
static boolean isBooleanInvariants(java.util.Map<java.lang.String,java.lang.Object> options)
           
 CollectionType isEcoreCollection(Type asType)
          Return the non-Null CollectionType if asType can use Ecore multiplicities to express the (outer) collection.
 boolean isPivot(Package asPackage)
          Return tre if asPackage is a Pivot Metamodel.
 boolean isSuppressDuplicates()
           
 void putCreated(Element pivotElement, org.eclipse.emf.ecore.EModelElement eModelElement)
           
protected  void setGenerationInProgress(Package asPackage, boolean isGenerating)
           
protected  void setGenerationInProgress(org.eclipse.emf.ecore.resource.Resource asResource, boolean isLoading)
           
 
Methods inherited from class org.eclipse.ocl.examples.pivot.utilities.AbstractConversion
basicGet, getEPackage, getMetaModelManager, isId, refreshList, refreshSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static final org.apache.log4j.Logger logger

OPTION_ADD_INVARIANT_COMMENTS

@NonNull
public static final java.lang.String OPTION_ADD_INVARIANT_COMMENTS
True to add comments to the invariant context and doagnostics parameters.

See Also:
Constant Field Values

OPTION_BOOLEAN_INVARIANTS

@NonNull
public static final java.lang.String OPTION_BOOLEAN_INVARIANTS
True to apply result = () wrapper to invariant body.

See Also:
Constant Field Values

OPTION_SUPPRESS_DUPLICATES

@NonNull
public static final java.lang.String OPTION_SUPPRESS_DUPLICATES
True to suppress the UML2Ecore duplicates EAnnotation. This is an experimental internal option used during the auto-generation of Pivot.ecore..

See Also:
Constant Field Values

options

@NonNull
protected final java.util.Map<java.lang.String,java.lang.Object> options

delegateInstaller

@NonNull
protected final DelegateInstaller delegateInstaller

pass1

@NonNull
protected final Pivot2EcoreDeclarationVisitor pass1

pass2

@NonNull
protected final Pivot2EcoreReferenceVisitor pass2

ecoreURI

@NonNull
protected final org.eclipse.emf.common.util.URI ecoreURI

primitiveTypesUriPrefix

@Nullable
protected final java.lang.String primitiveTypesUriPrefix
Constructor Detail

Pivot2Ecore

public Pivot2Ecore(@NonNull
                   MetaModelManager metaModelManager,
                   @NonNull
                   org.eclipse.emf.common.util.URI ecoreURI,
                   @Nullable
                   java.util.Map<java.lang.String,java.lang.Object> options)
Method Detail

copyAnnotationComments

public static void copyAnnotationComments(@NonNull
                                          org.eclipse.emf.ecore.EAnnotation eModelElement,
                                          @NonNull
                                          Constraint pivotConstraint)

copyComments

public static void copyComments(org.eclipse.emf.ecore.EModelElement eModelElement,
                                Element pivotElement)

createConstraintEOperation

@Deprecated
@NonNull
public static org.eclipse.emf.ecore.EOperation createConstraintEOperation(Constraint pivotConstraint,
                                                                                             java.lang.String operationName)
Deprecated. 


createConstraintEOperation

@NonNull
public static org.eclipse.emf.ecore.EOperation createConstraintEOperation(Constraint pivotConstraint,
                                                                                  java.lang.String operationName,
                                                                                  @Nullable
                                                                                  java.util.Map<java.lang.String,java.lang.Object> options)

createResource

@NonNull
public static org.eclipse.emf.ecore.xmi.XMLResource createResource(@NonNull
                                                                           MetaModelManager metaModelManager,
                                                                           @NonNull
                                                                           org.eclipse.emf.ecore.resource.Resource asResource,
                                                                           @NonNull
                                                                           org.eclipse.emf.common.util.URI ecoreURI,
                                                                           @Nullable
                                                                           java.util.Map<java.lang.String,java.lang.Object> options)

getBoolean

@NonNull
public static java.lang.Boolean getBoolean(@Nullable
                                                   java.util.Map<java.lang.String,java.lang.Object> options,
                                                   @NonNull
                                                   java.lang.String key)

getExportDelegateURI

@Nullable
public static java.lang.String getExportDelegateURI(@Nullable
                                                             java.util.Map<java.lang.String,java.lang.Object> options)

getString

@Nullable
public static java.lang.String getString(@Nullable
                                                  java.util.Map<java.lang.String,java.lang.Object> options,
                                                  @NonNull
                                                  java.lang.String key)

isAddInvariantComments

public static boolean isAddInvariantComments(@NonNull
                                             java.util.Map<java.lang.String,java.lang.Object> options)

isBooleanInvariants

public static boolean isBooleanInvariants(@NonNull
                                          java.util.Map<java.lang.String,java.lang.Object> options)

convert

@Nullable
protected java.lang.Object convert(@NonNull
                                            Element pivotObject)

convertResource

@NonNull
public org.eclipse.emf.ecore.xmi.XMLResource convertResource(@NonNull
                                                                     org.eclipse.emf.ecore.resource.Resource asResource,
                                                                     @NonNull
                                                                     org.eclipse.emf.common.util.URI ecoreURI)

defer

public void defer(@NonNull
                  Element pivotElement)

error

protected void error(@NonNull
                     java.lang.String message)

getCreated

public <T extends org.eclipse.emf.ecore.EObject> T getCreated(@NonNull
                                                              java.lang.Class<T> requiredClass,
                                                              @NonNull
                                                              Element pivotElement)

getDelegateInstaller

@NonNull
public DelegateInstaller getDelegateInstaller()

getEcoreURI

@NonNull
public final org.eclipse.emf.common.util.URI getEcoreURI()

getOptions

@NonNull
public java.util.Map<java.lang.String,java.lang.Object> getOptions()

getPrimitiveTypesUriPrefix

public java.lang.String getPrimitiveTypesUriPrefix()

isEcoreCollection

@Nullable
public CollectionType isEcoreCollection(@Nullable
                                                 Type asType)
Return the non-Null CollectionType if asType can use Ecore multiplicities to express the (outer) collection.


isPivot

public boolean isPivot(@NonNull
                       Package asPackage)
Return tre if asPackage is a Pivot Metamodel.


isSuppressDuplicates

public boolean isSuppressDuplicates()

putCreated

public void putCreated(@NonNull
                       Element pivotElement,
                       @NonNull
                       org.eclipse.emf.ecore.EModelElement eModelElement)

setGenerationInProgress

protected void setGenerationInProgress(@NonNull
                                       org.eclipse.emf.ecore.resource.Resource asResource,
                                       boolean isLoading)

setGenerationInProgress

protected void setGenerationInProgress(@NonNull
                                       Package asPackage,
                                       boolean isGenerating)