Class JAXXInitialContext

java.lang.Object
jaxx.runtime.context.DefaultJAXXContext
jaxx.runtime.context.JAXXInitialContext
All Implemented Interfaces:
JAXXContext

public class JAXXInitialContext
extends DefaultJAXXContext
An initial context to be inject in a JAXXObject. The method add(Object) register a simple value. The method add(String, Object) register a named value. The method to(JAXXContext) inject in the JAXXObject the values registred in the initial context. The initial context is also a "limited" JAXXContext, since we can only use the two methods DefaultJAXXContext.getContextValue(Class) or DefaultJAXXContext.getContextValue(Class, String).
See Also:
JAXXContext
  • Constructor Details

    • JAXXInitialContext

      public JAXXInitialContext()
  • Method Details

    • add

      public JAXXInitialContext add​(java.lang.Object value)
      Register a simple (none named) value in the context.
      Parameters:
      value - the value to be registred in the context
      Returns:
      the instance of the context
    • add

      public JAXXInitialContext add​(java.lang.String name, java.lang.Object value)
      Register a named value in the context.
      Parameters:
      name - the name of the value
      value - the value to registred
      Returns:
      the instance of the context
    • add

      public <O> JAXXInitialContext add​(JAXXContextEntryDef<O> def, O value)
      Register a named (or not) value in the context.
      Type Parameters:
      O - type of data to add
      Parameters:
      def - definition of entry
      value - the value to registred
      Returns:
      the instance of the context
    • to

      public void to​(JAXXContext dst)
      Inject all the registed values into the JAXXObject
      Parameters:
      dst - the object to fill.
    • setContextValue

      public void setContextValue​(java.lang.Object o)
      Description copied from interface: JAXXContext
      Push in the context a new unamed entry. If a previous entry exists in context (unamed and same class), it will be removed.
      Specified by:
      setContextValue in interface JAXXContext
      Overrides:
      setContextValue in class DefaultJAXXContext
      Parameters:
      o - the value to push in context
    • setContextValue

      public void setContextValue​(java.lang.Object o, java.lang.String name)
      Description copied from interface: JAXXContext
      * Push in the context a new amed entry. If a previous entry exists in context (same name and class), it will be removed.
      Specified by:
      setContextValue in interface JAXXContext
      Overrides:
      setContextValue in class DefaultJAXXContext
      Parameters:
      o - the value to push in context
      name - the name of the new entry
    • removeContextValue

      public <T> void removeContextValue​(java.lang.Class<T> klazz)
      Description copied from interface: JAXXContext
      Remove from context the value with the given klazz as an unamed entry
      Specified by:
      removeContextValue in interface JAXXContext
      Overrides:
      removeContextValue in class DefaultJAXXContext
      Type Parameters:
      T - type of data to remove from context
      Parameters:
      klazz - the klazz entry
    • removeContextValue

      public <T> void removeContextValue​(java.lang.Class<T> klazz, java.lang.String name)
      Description copied from interface: JAXXContext
      Remove from context the value with the given klazz as an unamed (if name is null) or named entry
      Specified by:
      removeContextValue in interface JAXXContext
      Overrides:
      removeContextValue in class DefaultJAXXContext
      Type Parameters:
      T - type of data to remove from context
      Parameters:
      klazz - the klazz entry
      name - extra name of the entry