public interface IPatternService
Modifier and Type | Method and Description |
---|---|
void |
addPattern(Path patternPath)
Install a pattern into the catalog and load it.
|
void |
applyPattern(Path patternPath,
Map<String,Object> parameters)
Execute a pattern with the given parameters.
|
void |
applyPattern(String patternName,
Map<String,Object> parameters)
Execute a pattern with the given parameters.
|
boolean |
canApplyPattern(String patternName)
Check that all module and model components dependencies are resolved before applying a pattern.
|
void |
exportPattern(Package modelPattern,
Path patternPath)
Export a pattern.
|
Collection<String> |
getPatterns()
Get all available patterns.
|
Collection<String> |
getPatterns(Collection<MObject> elements)
Get patterns applicable on these elements from the catalog.
|
void |
removePattern(String patternName)
Remove a pattern from the catalog.
|
void exportPattern(Package modelPattern, Path patternPath) throws IOException
pattern
- the pattern to export.IOException
- when the Pattern can't be exported.void addPattern(Path patternPath) throws IOException
If the pattern already exists in the catalog, it is replaced.
newPattern
- a valid .umlt file.IOException
- when the given file doesn't contain a valid pattern.Collection<String> getPatterns()
Collection<String> getPatterns(Collection<MObject> elements)
elements
- the model elements to filter the patterns with.void removePattern(String patternName) throws InvalidParameterException
pattern
- the pattern to remove.InvalidParameterException
- when no pattern with this name is found in the catalog.void applyPattern(String patternName, Map<String,Object> parameters) throws IOException, InvalidParameterException
pattern
- the name of the pattern to execute.parameters
- the parameters for the pattern to run.IOException
- when the pattern loading fails.InvalidParameterException
- when no pattern with this name is found in the catalog.boolean canApplyPattern(String patternName) throws IOException, InvalidParameterException
pattern
- the name of the pattern to execute.true
when all module and model components the pattern depends on are resolved. false
if at least one of them is missing.IOException
- when the pattern loading fails.InvalidParameterException
- when no pattern with this name is found in the catalog.void applyPattern(Path patternPath, Map<String,Object> parameters) throws IOException
patternPath
- the jar of the pattern to execute.parameters
- the parameters for the pattern to run.IOException
- when the pattern loading fails.