Class BlockContext.DefaultMapContext<T>
- java.lang.Object
-
- org.keycloak.models.map.storage.file.common.BlockContext.DefaultMapContext<T>
-
- All Implemented Interfaces:
BlockContext<Map<String,T>>
- Direct Known Subclasses:
MapEntityContext.MapEntityMappingYamlContext
,StringListMapContext
- Enclosing interface:
- BlockContext<V>
public static class BlockContext.DefaultMapContext<T> extends Object implements BlockContext<Map<String,T>>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.keycloak.models.map.storage.file.common.BlockContext
BlockContext.DefaultListContext<T>, BlockContext.DefaultMapContext<T>, BlockContext.DefaultObjectContext<T>
-
-
Constructor Summary
Constructors Constructor Description DefaultMapContext(Class<T> itemClass)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(String name, Object value)
Modifies theresult returned
from within this context by providing the read mapping entryname
to givenvalue
.BlockContext<T>
getContext(String nameOfSubcontext)
Called after reading a key of map entry in YAML file and before reading its value.Map<String,T>
getResult()
Returns the result of parsing the given part of YAML file.Class<T>
getScalarType()
static BlockContext.DefaultMapContext<Object>
newDefaultMapContext()
void
writeValue(Map<String,T> value, WritingMechanism mech)
Writes the given value usingWritingMechanism
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.keycloak.models.map.storage.file.common.BlockContext
add
-
-
-
-
Method Detail
-
newDefaultMapContext
public static BlockContext.DefaultMapContext<Object> newDefaultMapContext()
-
getScalarType
public Class<T> getScalarType()
- Specified by:
getScalarType
in interfaceBlockContext<T>
-
add
public void add(String name, Object value)
Description copied from interface:BlockContext
Modifies theresult returned
from within this context by providing the read mapping entryname
to givenvalue
.Called after reading a map entry (both key and value) from the YAML file is finished. The entry is represented as
name
parameter (key part of the entry) andvalue
(value part of the entry).The method is called in the same order as the mapping items appear in the source YAML mapping.
- Specified by:
add
in interfaceBlockContext<T>
-
getResult
public Map<String,T> getResult()
Description copied from interface:BlockContext
Returns the result of parsing the given part of YAML file.- Specified by:
getResult
in interfaceBlockContext<T>
- Returns:
-
writeValue
public void writeValue(Map<String,T> value, WritingMechanism mech)
Description copied from interface:BlockContext
Writes the given value usingWritingMechanism
.- Specified by:
writeValue
in interfaceBlockContext<T>
-
getContext
public BlockContext<T> 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 asnameOfSubcontext
parameter, and provides means to specify aYamlContext
for transforming the mapping value into appropriate Java object.- Specified by:
getContext
in interfaceBlockContext<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:
BlockContext.DefaultObjectContext
,BlockContext.DefaultListContext
,BlockContext.DefaultMapContext
-
-