Class BlockContext.DefaultObjectContext<T>

java.lang.Object
org.keycloak.models.map.storage.file.common.BlockContext.DefaultObjectContext<T>
All Implemented Interfaces:
BlockContext<T>
Enclosing interface:
BlockContext<V>

public static class BlockContext.DefaultObjectContext<T> extends Object implements BlockContext<T>
  • Constructor Details

    • DefaultObjectContext

      public DefaultObjectContext(Class<T> objectType)
  • Method Details

    • newDefaultObjectContext

      public static BlockContext.DefaultObjectContext<Object> newDefaultObjectContext()
    • getScalarType

      public Class<T> getScalarType()
      Specified by:
      getScalarType in interface BlockContext<T>
    • add

      public void add(Object value)
      Description copied from interface: BlockContext
      Modifies the result returned from within this context by providing the read primitive value or a single sequence item in the value parameter.

      Called after reading a primitive value or a single sequence item from the YAML file is finished.

      If the parsed YAML part was a sequence, this method is called in the same order as the sequence items appear in the source YAML sequence.

      Specified by:
      add in interface BlockContext<T>
    • getResult

      public T getResult()
      Description copied from interface: BlockContext
      Returns the result of parsing the given part of YAML file.
      Specified by:
      getResult in interface BlockContext<T>
      Returns:
    • writeValue

      public void writeValue(Object value, WritingMechanism mech)
      Description copied from interface: BlockContext
      Writes the given value using WritingMechanism.
      Specified by:
      writeValue in interface BlockContext<T>
    • getContext

      public BlockContext<?> getContext(String nameOfSubcontext)
      Description copied from interface: BlockContext
      Called after reading a key of map entry in YAML file and before reading its value. The key of the entry is represented as nameOfSubcontext parameter, and provides means to specify a YamlContext for transforming the mapping value into appropriate Java object.
      Specified by:
      getContext in interface BlockContext<T>
      Parameters:
      nameOfSubcontext - Key of the map entry
      Returns:
      Context used for transforming the value, or null if the default primitive / sequence / mapping context should be used instead.
      See Also: