Class DefinitionSpaceWritable
- java.lang.Object
-
- io.vertigo.core.node.definition.loader.DefinitionSpaceWritable
-
- All Implemented Interfaces:
DefinitionSpace
public final class DefinitionSpaceWritable extends Object implements DefinitionSpace
The space to access and register all the definitions. The registration is only accessible during the boot phase. Consequently, the registration is not threadSafe. (The boot phase occuring on a single thread)- Author:
- pchretien
-
-
Constructor Summary
Constructors Constructor Description DefinitionSpaceWritable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears all known definitionsbooleancontains(String name)Returns true if this container contains the specified definition<C extends Definition>
Set<C>getAll(Class<C> clazz)Set<Class<? extends Definition>>getAllTypes()voidregisterDefinition(Definition definition)Registers a new definition.<D extends Definition>
Dresolve(String name, Class<D> clazz)Resolve a definition from its name and class.
-
-
-
Method Detail
-
registerDefinition
public void registerDefinition(Definition definition)
Registers a new definition. The definition must not be already registered.- Parameters:
definition- the definition
-
contains
public boolean contains(String name)
Returns true if this container contains the specified definition- Specified by:
containsin interfaceDefinitionSpace- Parameters:
name- the name of the expected definition- Returns:
- true if the definition is already registered.
-
resolve
public <D extends Definition> D resolve(String name, Class<D> clazz)
Resolve a definition from its name and class.- Specified by:
resolvein interfaceDefinitionSpace- Parameters:
name- the name of the expected definitionclazz- Type of the definition- Returns:
- the definition
-
getAllTypes
public Set<Class<? extends Definition>> getAllTypes()
- Specified by:
getAllTypesin interfaceDefinitionSpace- Returns:
- Liste de tous les types de définition gérés.
-
getAll
public <C extends Definition> Set<C> getAll(Class<C> clazz)
- Specified by:
getAllin interfaceDefinitionSpace- Type Parameters:
C- Type of the definition- Parameters:
clazz- Class of the definition- Returns:
- Ordered Set of all objects for a type defined by its class
-
clear
public void clear()
Clears all known definitions
-
-