T
- type of the expected query resultpublic abstract class DefinitionQuery<T> extends Object
Modifier | Constructor and Description |
---|---|
protected |
DefinitionQuery() |
protected |
DefinitionQuery(DefinitionQuery query)
Create a new query instance based on another one.
|
Modifier and Type | Method and Description |
---|---|
DefinitionQuery<T> |
at(Pattern locationRegexPattern) |
DefinitionQuery<T> |
at(String locationRegexPattern) |
static <T> DefinitionQuery<T> |
build(Registry<T> registry)
Start building a DefinitionQuery for a Registry.
|
static <T> DefinitionQuery<T> |
build(Registry<T> registry,
DefinitionQuery<T> baseQuery)
Start building a DefinitionQuery for a Registry, copying properties of an existing query.
|
abstract Collection<DefinitionProvider<T>> |
findMultiple()
Returns all providers matching the given criteria or an empty collection if there are no matches.
|
DefinitionProvider<T> |
findSingle()
Returns a single provider matching the criteria or throws an exception if not unique.
|
DefinitionQuery<T> |
from(String moduleName) |
ConfigurationSourceType |
getConfigurationSourceType() |
Pattern |
getLocationPattern() |
String |
getModule() |
String |
getName() |
DefinitionType |
getType() |
DefinitionQuery<T> |
named(String defName) |
DefinitionQuery<T> |
ofConfigurationSourceType(ConfigurationSourceType configurationSourceType) |
DefinitionQuery<T> |
ofType(DefinitionType type) |
String |
toString() |
protected DefinitionQuery()
protected DefinitionQuery(DefinitionQuery query)
query
- The query to wrap/forkpublic static <T> DefinitionQuery<T> build(Registry<T> registry)
public static <T> DefinitionQuery<T> build(Registry<T> registry, DefinitionQuery<T> baseQuery)
baseQuery
- A DefinitionQuery
to base the new one uponpublic DefinitionQuery<T> from(String moduleName)
public DefinitionQuery<T> named(String defName)
public DefinitionQuery<T> ofType(DefinitionType type)
public DefinitionQuery<T> ofConfigurationSourceType(ConfigurationSourceType configurationSourceType)
public DefinitionQuery<T> at(String locationRegexPattern)
public DefinitionQuery<T> at(Pattern locationRegexPattern)
public String getModule()
public String getName()
public DefinitionType getType()
public ConfigurationSourceType getConfigurationSourceType()
public Pattern getLocationPattern()
public DefinitionProvider<T> findSingle()
Registry.NoSuchDefinitionException
- (which is a RuntimeException) if the query doesn't match any definition.public abstract Collection<DefinitionProvider<T>> findMultiple()
Copyright © 2003–2021 Magnolia International Ltd.. All rights reserved.