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 Details

    • DefinitionSpaceWritable

      public DefinitionSpaceWritable()
  • Method Details

    • 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)
      Checks if this container contains a definition with the specified name.
      Specified by:
      contains in interface DefinitionSpace
      Parameters:
      name - the name of the definition to check
      Returns:
      true if the definition is already registered, false otherwise
    • resolve

      public <D extends Definition> D resolve(String name, Class<D> clazz)
      Resolves a definition from its name and class type.
      Specified by:
      resolve in interface DefinitionSpace
      Type Parameters:
      D - Type of the definition
      Parameters:
      name - the name of the definition to resolve
      clazz - the class type of the definition
      Returns:
      the resolved definition
    • getAllTypes

      public Set<Class<? extends Definition>> getAllTypes()
      Gets a list of all types of definitions managed within this space.
      Specified by:
      getAllTypes in interface DefinitionSpace
      Returns:
      a set of classes representing the types of definitions
    • getAll

      public <C extends Definition> Set<C> getAll(Class<C> clazz)
      Gets an ordered set of all objects for a specified definition type.
      Specified by:
      getAll in interface DefinitionSpace
      Type Parameters:
      C - Type of the definition
      Parameters:
      clazz - the class type of the definition
      Returns:
      an ordered set of all objects for the specified definition type
    • clear

      public void clear()
      Clears all known definitions