Class 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 Detail

      • DefinitionSpaceWritable

        public DefinitionSpaceWritable()
    • 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:
        contains in interface DefinitionSpace
        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:
        resolve in interface DefinitionSpace
        Parameters:
        name - the name of the expected definition
        clazz - Type of the definition
        Returns:
        the definition
      • getAll

        public <C extends DefinitionSet<C> getAll​(Class<C> clazz)
        Specified by:
        getAll in interface DefinitionSpace
        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