T
- element type of this registry@Multibinding public interface Registry<T> extends DefinitionReferenceIdResolver
DefinitionType
;
these definition can come from various sources.Modifier and Type | Interface and Description |
---|---|
static class |
Registry.InvalidDefinitionException
Thrown by a registry when the underlying bean is not successfully resolved, not valid, or not enabled.
|
static class |
Registry.NoSuchDefinitionException
Thrown by a registry when it doesn't hold an entity that is asked for.
|
Modifier and Type | Method and Description |
---|---|
void |
addDecorator(DefinitionDecorator<T> definitionDecorator) |
Collection<T> |
getAllDefinitions()
Returns all resolvable, valid and enabled definitions.
|
Collection<DefinitionMetadata> |
getAllMetadata() |
Collection<DefinitionProvider<T>> |
getAllProviders() |
DefinitionProvider<T> |
getProvider(DefinitionMetadata id)
Gets a definition provider by its complete id object.
|
DefinitionProvider<T> |
getProvider(String referenceId)
Convenience method, where the given String is what the corresponding
DefinitionMetadata.getReferenceId() would return. |
default DefinitionProviderBuilder<T> |
newDefinitionProviderBuilder() |
DefinitionMetadataBuilder |
newMetadataBuilder()
Implementations of
DefinitionMetadataBuilder determine how referenceId strings for this registry are generated. |
DefinitionQuery<T> |
query()
Deprecated.
as of 5.5 - directly instantiate an implementation of
DefinitionQuery |
void |
register(DefinitionProvider<T> definitionProvider) |
void |
removeDecorator(DefinitionDecorator<T> definitionDecorator) |
void |
start()
Call start() once sources have been added; addSource() should however call source.startWith(registry) so maybe not ?
|
DefinitionType |
type() |
Set<DefinitionMetadata> |
unregisterAndRegister(Collection<DefinitionMetadata> toRemove,
Collection<DefinitionProvider<T>> toAdd) |
getReferenceId
DefinitionType type()
DefinitionMetadataBuilder newMetadataBuilder()
DefinitionMetadataBuilder
determine how referenceId strings for this registry are generated.
FIXME since 5.4.6 historically this method exists so that specific Registry
implementation can provide its own strategy
of converting a DefinitionMetadata
to a string. With introduction of DefinitionReferenceIdResolver
interface metadata can
lose DefinitionMetadata.getReferenceId()
method and will not need a special per-registry metadata builder.default DefinitionProviderBuilder<T> newDefinitionProviderBuilder()
void start()
void register(DefinitionProvider<T> definitionProvider)
void addDecorator(DefinitionDecorator<T> definitionDecorator)
void removeDecorator(DefinitionDecorator<T> definitionDecorator)
Set<DefinitionMetadata> unregisterAndRegister(Collection<DefinitionMetadata> toRemove, Collection<DefinitionProvider<T>> toAdd)
DefinitionProvider<T> getProvider(DefinitionMetadata id)
DefinitionProvider<T> getProvider(String referenceId) throws Registry.NoSuchDefinitionException
DefinitionMetadata.getReferenceId()
would return.Registry.NoSuchDefinitionException
- (which is a RuntimeException) if the given reference is not known.DefinitionMetadata.getReferenceId()
Collection<DefinitionProvider<T>> getAllProviders()
Collection<T> getAllDefinitions()
Collection<DefinitionMetadata> getAllMetadata()
@Deprecated DefinitionQuery<T> query()
DefinitionQuery
Copyright © 2003–2020 Magnolia International Ltd.. All rights reserved.