public class MappingUtility
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static org.eclipse.core.runtime.IStatus |
getFilename(org.eclipse.uml2.uml.NamedElement element,
ITransformContext context)
Retrieves the alternate filename (specified by the user) for the given
source model element.
|
static org.eclipse.core.runtime.IStatus |
getFilename(org.eclipse.uml2.uml.NamedElement element,
ITransformContext context,
java.lang.Character separator)
Retrieves the alternate filename (specified by the user) for the given
source model element.
|
static org.eclipse.core.runtime.IStatus |
getFilenameIgnoringParent(org.eclipse.uml2.uml.NamedElement element,
ITransformContext context)
Retrieves the alternate filename (specified by the user) for the given
source model element.
|
static boolean |
hasMappingModelContentFor(org.eclipse.uml2.uml.NamedElement element,
ITransformContext context)
Checks if the mapping model has an Artifact for the given source model
element.
|
static org.eclipse.core.runtime.IStatus |
initialize(ITransformContext context)
Creates the mapping model.
|
static org.eclipse.core.runtime.IStatus |
populateMappingModel(java.util.List modelElements,
ITransformContext context)
Populates the mapping model with an Artifact for each source model
element in the given
List . |
static org.eclipse.core.runtime.IStatus |
populateMappingModel(org.eclipse.uml2.uml.NamedElement element,
ITransformContext context)
Populates the mapping model with an Artifact for the given source model
element.
|
static org.eclipse.core.runtime.IStatus |
setMappedName(org.eclipse.uml2.uml.NamedElement element,
java.lang.String mappedName,
ITransformContext context)
Sets the mapped name of the given
NamedElement to be the
given mapped name. |
static org.eclipse.core.runtime.IStatus |
terminate(ITransformContext context)
Saves the mapping model.
|
static org.eclipse.core.runtime.IStatus |
validateContext(ITransformContext context)
Ensures the given context is valid for transformation mapping.
|
public static org.eclipse.core.runtime.IStatus getFilename(org.eclipse.uml2.uml.NamedElement element, ITransformContext context, java.lang.Character separator)
element
- The element in the source model to look for an
alternate filename for.context
- The ITransformContext
that contains
the mapping properties required to extract the
filename.separator
- The separator character to use when calculating
mapped names based on a parent element's mapped
value.IStatus
. The severity will
represent the success of the operation.
ERROR - There was an error that prevented
finding a mapping.
INFO - No mapping was specified.
OK - An alternate filename was found
and is returned as the message.
WARNING - Same as OK, except additional
information is provided that
may indicate that there is a
problem. The code of the
IStatus can be used to
determine what the issue is.Nothing
public static org.eclipse.core.runtime.IStatus getFilename(org.eclipse.uml2.uml.NamedElement element, ITransformContext context)
element
- The element in the source model to look for an
alternate filename for.context
- The ITransformContext
that contains
the mapping properties required to extract the
filename.IStatus
. The severity will
represent the success of the operation.
ERROR - There was an error that prevented
finding a mapping.
INFO - No mapping was specified.
OK - An alternate filename was found
and is returned as the message.
WARNING - Same as OK, except additional
information is provided that
may indicate that there is a
problem. The code of the
IStatus can be used to
determine what the issue is.Nothing
public static org.eclipse.core.runtime.IStatus getFilenameIgnoringParent(org.eclipse.uml2.uml.NamedElement element, ITransformContext context)
element
- The element in the source model to look for an
alternate filename for.context
- The ITransformContext
that contains
the mapping properties required to extract the
filename.IStatus
. The severity will
represent the success of the operation.
ERROR - There was an error that prevented
finding a mapping.
INFO - No mapping was specified.
OK - An alternate filename was found
and is returned as the message.
WARNING - Same as OK, except additional
information is provided that
may indicate that there is a
problem. The code of the
IStatus can be used to
determine what the issue is.Nothing
public static org.eclipse.core.runtime.IStatus populateMappingModel(java.util.List modelElements, ITransformContext context)
List
.modelElements
- The list of source model elements to create
an Artifact for in the mapping model.context
- The ITransformContext
that
contains all the required properties to
populate the mapping model.IStatus
that indicates if
the model was successfully populated. Since
multiple elements will be added to the model
a MultiStatus
is returned.Nothing.
public static org.eclipse.core.runtime.IStatus populateMappingModel(org.eclipse.uml2.uml.NamedElement element, ITransformContext context)
element
- The source model element to create an
Artifact for in the mapping model.context
- The ITransformContext
that
contains the properties required to populate
the mapping model.IStatus
that indicates if
the model was successfully populated.Nothing.
public static boolean hasMappingModelContentFor(org.eclipse.uml2.uml.NamedElement element, ITransformContext context)
element
- The source model element.context
- The ITransformContext
that
contains the properties required to examine
the mapping model.Nothing.
public static org.eclipse.core.runtime.IStatus initialize(ITransformContext context)
Resource
object that represents the mapping
model.context
- The ITransformContext
that contains the
properties required to create the mapping model.IStatus
indicating if the mapping model
was created.Nothing.
public static org.eclipse.core.runtime.IStatus terminate(ITransformContext context)
context
- The ITransformContext
that contains the
properties required to save the mapping model.IStatus
indicating if the mapping model
was saved.Nothing.
public static org.eclipse.core.runtime.IStatus validateContext(ITransformContext context)
context
- The ITransformContext
to validate.IStatus
which indicates if the given
context is valid.Nothing.
public static org.eclipse.core.runtime.IStatus setMappedName(org.eclipse.uml2.uml.NamedElement element, java.lang.String mappedName, ITransformContext context)
NamedElement
to be the
given mapped name.element
- The model element to add a mapped name for.mappedName
- The mapped name.context
- The ITransformContext
that contains
the properties required to add the new mapped
value.IStatus
indicating if the mapped
name was successfully added to the mapping model.