public class QueryExplorerPatternRegistry
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
QueryExplorerPatternRegistry() |
Modifier and Type | Method and Description |
---|---|
void |
addActivePattern(IQuerySpecification<?> p)
Sets the given pattern as active ("checks on the Query Explorer").
|
void |
addGeneratedPattern(IQuerySpecification<?> specification) |
java.util.List<IQuerySpecification<?>> |
getActivePatterns()
Returns the list of active patterns.
|
java.util.List<IQuerySpecification<?>> |
getAllPatterns()
Return a list of all known patterns.
|
org.eclipse.core.resources.IFile |
getFileForPattern(IQuerySpecification<?> pattern)
Returns the vql file instance that the given pattern can be found in.
|
java.util.Collection<org.eclipse.core.resources.IFile> |
getFiles()
Returns the list of vql files from which patterns are registered.
|
static com.google.common.collect.ImmutableList<IQuerySpecification<?>> |
getGeneratedQuerySpecifications()
access the list of "generated" query specifications
|
java.util.Collection<IQuerySpecification<?>> |
getGenericQuerySpecifications()
Returns the list of (generic) patterns registered in the registry.
|
static QueryExplorerPatternRegistry |
getInstance() |
IQuerySpecification<?> |
getPatternByFqn(java.lang.String patternFqn)
Returns the pattern associated with the given fully qualified name.
|
java.util.Collection<java.lang.String> |
getPatternNames()
Returns the names of the patterns registered in the registry.
|
static com.google.common.base.Optional<java.lang.Boolean> |
getQueryExplorerCheckedValue(IQuerySpecification<?> query)
Returns an Optional that has value if the user
declared "@QueryExplorer(checked=value)" on the pattern.
|
java.util.List<IQuerySpecification<?>> |
getRegisteredPatternsForFile(org.eclipse.core.resources.IFile file)
Returns the (unmodifiable) list of registered patterns from the given file.
|
boolean |
isActive(java.lang.String patternFqn)
Returns true if the given pattern is currently active, false otherwise.
|
boolean |
isEmpty()
Returns true if there are no (generic) patterns registered, false otherwise.
|
boolean |
isGenerated(IQuerySpecification<?> query) |
java.util.Set<IQuerySpecification<?>> |
registerPatternModel(org.eclipse.core.resources.IFile file,
PatternModel patternModel)
Registers the patterns within the given (parsed) pattern model.
|
void |
removeActivePattern(IQuerySpecification<?> p)
Sets the given pattern as passive.
|
void |
removeActivePattern(java.lang.String patternFqn) |
java.util.List<IQuerySpecification<?>> |
unregisterPattern(IQuerySpecification<?> specification)
Unregisters the given pattern from the registry.
|
java.util.List<IQuerySpecification<?>> |
unregisterPatternModel(org.eclipse.core.resources.IFile file)
Unregisters the patterns within the given vql file and returns the list of those patterns that were currently
active from the given file.
|
public static QueryExplorerPatternRegistry getInstance()
public void addGeneratedPattern(IQuerySpecification<?> specification)
public boolean isGenerated(IQuerySpecification<?> query)
public java.util.List<IQuerySpecification<?>> unregisterPattern(IQuerySpecification<?> specification)
specification
- the pattern instance to be unregisteredpublic java.util.Set<IQuerySpecification<?>> registerPatternModel(org.eclipse.core.resources.IFile file, PatternModel patternModel) throws ViatraQueryException
file
- the vql file instancepatternModel
- the parsed pattern modelViatraQueryException
public void addActivePattern(IQuerySpecification<?> p)
p
- the pattern instancepublic java.util.List<IQuerySpecification<?>> getRegisteredPatternsForFile(org.eclipse.core.resources.IFile file)
file
- the vql file instancepublic boolean isEmpty()
public java.util.List<IQuerySpecification<?>> unregisterPatternModel(org.eclipse.core.resources.IFile file)
file
- the vql file instancepublic void removeActivePattern(IQuerySpecification<?> p)
p
- the pattern instancepublic void removeActivePattern(java.lang.String patternFqn)
public IQuerySpecification<?> getPatternByFqn(java.lang.String patternFqn)
patternFqn
- the fqn of the patternpublic java.util.List<IQuerySpecification<?>> getActivePatterns()
public boolean isActive(java.lang.String patternFqn)
patternFqn
- the fqn of the patternpublic java.util.Collection<java.lang.String> getPatternNames()
public java.util.Collection<IQuerySpecification<?>> getGenericQuerySpecifications()
public java.util.List<IQuerySpecification<?>> getAllPatterns()
public java.util.Collection<org.eclipse.core.resources.IFile> getFiles()
public org.eclipse.core.resources.IFile getFileForPattern(IQuerySpecification<?> pattern)
pattern
- the pattern instancepublic static com.google.common.base.Optional<java.lang.Boolean> getQueryExplorerCheckedValue(IQuerySpecification<?> query)
query
- public static com.google.common.collect.ImmutableList<IQuerySpecification<?>> getGeneratedQuerySpecifications()