public interface IPatternService
Modifier and Type | Interface and Description |
---|---|
static class |
IPatternService.PatternException
Thrown when a pattern execution fails.
|
Modifier and Type | Method and Description |
---|---|
void |
addPattern(java.nio.file.Path patternPath)
Install a pattern into the catalog and load it.
|
void |
applyPattern(java.nio.file.Path patternPath,
java.util.Map<java.lang.String,java.lang.Object> parameters)
Execute a pattern with the given parameters.
|
void |
applyPattern(java.lang.String pattern,
java.util.Map<java.lang.String,java.lang.Object> parameters)
Execute a pattern with the given parameters.
|
boolean |
canApplyPattern(java.lang.String pattern)
Check that all module and model components dependencies are resolved before applying a pattern.
|
void |
exportPattern(Package pattern,
java.nio.file.Path patternPath)
Export a pattern.
|
java.util.Collection<java.lang.String> |
getPatterns()
Get all available patterns.
|
java.util.Collection<java.lang.String> |
getPatterns(java.util.Collection<MObject> elements)
Get patterns applicable on these elements from the catalog.
|
void |
removePattern(java.lang.String pattern)
Remove a pattern from the catalog.
|
void exportPattern(Package pattern, java.nio.file.Path patternPath) throws IPatternService.PatternException
pattern
- the pattern to export.patternPath
- output path for the export.IPatternService.PatternException
- when the Pattern can't be exported.void addPattern(java.nio.file.Path patternPath) throws IPatternService.PatternException
If the pattern already exists in the catalog, it is replaced.
patternPath
- path to a valid .umlt file.IPatternService.PatternException
- when the given file doesn't contain a valid pattern.java.util.Collection<java.lang.String> getPatterns()
java.util.Collection<java.lang.String> getPatterns(java.util.Collection<MObject> elements)
elements
- the model elements to filter the patterns with.void removePattern(java.lang.String pattern) throws IPatternService.PatternException
pattern
- the pattern to remove.IPatternService.PatternException
- when no pattern with this name is found in the catalog.void applyPattern(java.lang.String pattern, java.util.Map<java.lang.String,java.lang.Object> parameters) throws IPatternService.PatternException
pattern
- name of the pattern to execute.parameters
- the parameters for the pattern to run.IPatternService.PatternException
- when the pattern execution fails.boolean canApplyPattern(java.lang.String pattern) throws IPatternService.PatternException
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.IPatternService.PatternException
- when the pattern execution fails.void applyPattern(java.nio.file.Path patternPath, java.util.Map<java.lang.String,java.lang.Object> parameters) throws IPatternService.PatternException
patternPath
- the jar of the pattern to execute.parameters
- the parameters for the pattern to run.IPatternService.PatternException
- when the pattern execution fails.