Class MapEntityContext<T>
- java.lang.Object
- 
- org.keycloak.models.map.storage.file.common.MapEntityContext<T>
 
- 
- All Implemented Interfaces:
- BlockContext<T>
 
 public class MapEntityContext<T> extends Object implements BlockContext<T> BlockContextwhich handles any entity accompanied withEntityFieldfield getters and setters, namelyMap*Entityclasses.- Author:
- hmlnarik
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classMapEntityContext.MapEntityMappingYamlContext<T>static classMapEntityContext.MapEntitySequenceYamlContext<T>- 
Nested classes/interfaces inherited from interface org.keycloak.models.map.storage.file.common.BlockContextBlockContext.DefaultListContext<T>, BlockContext.DefaultMapContext<T>, BlockContext.DefaultObjectContext<T>
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected static StringATTRIBUTES_NAMEprotected Class<T>objectClassprotected Tresultstatic StringSCHEMA_VERSION
 - 
Constructor SummaryConstructors Modifier Constructor Description MapEntityContext(Class<T> clazz)MapEntityContext(Class<T> clazz, boolean topContext)protectedMapEntityContext(Class<T> clazz, Map<String,EntityField<?>> nameToEntityField, Map<String,Supplier<? extends BlockContext<?>>> contextCreators, boolean topContext)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(String name, Object value)Modifies theresult returnedfrom within this context by providing the read mapping entrynameto givenvalue.protected static <T> Map<String,Supplier<? extends BlockContext<?>>>fieldsToContextCreators(Class<T> type)static <T> Map<String,EntityField<?>>fieldsToEntityField(Class<T> type)BlockContext<?>getContext(String nameOfSubcontext)Called after reading a key of map entry in YAML file and before reading its value.TgetResult()Returns the result of parsing the given part of YAML file.Class<T>getScalarType()static <T> booleansetEntityField(T result, EntityField<? super T> ef, Object value)voidwriteValue(T entity, WritingMechanism mech)Writes the given value usingWritingMechanism.- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.keycloak.models.map.storage.file.common.BlockContextadd
 
- 
 
- 
- 
- 
Constructor Detail- 
MapEntityContextprotected MapEntityContext(Class<T> clazz, Map<String,EntityField<?>> nameToEntityField, Map<String,Supplier<? extends BlockContext<?>>> contextCreators, boolean topContext) 
 
- 
 - 
Method Detail- 
fieldsToContextCreatorsprotected static <T> Map<String,Supplier<? extends BlockContext<?>>> fieldsToContextCreators(Class<T> type) 
 - 
fieldsToEntityFieldpublic static <T> Map<String,EntityField<?>> fieldsToEntityField(Class<T> type) 
 - 
setEntityFieldpublic static <T> boolean setEntityField(T result, EntityField<? super T> ef, Object value)
 - 
addpublic void add(String name, Object value) Description copied from interface:BlockContextModifies theresult returnedfrom within this context by providing the read mapping entrynameto givenvalue.Called after reading a map entry (both key and value) from the YAML file is finished. The entry is represented as nameparameter (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:
- addin interface- BlockContext<T>
 
 - 
getScalarTypepublic Class<T> getScalarType() - Specified by:
- getScalarTypein interface- BlockContext<T>
 
 - 
getResultpublic T getResult() Description copied from interface:BlockContextReturns the result of parsing the given part of YAML file.- Specified by:
- getResultin interface- BlockContext<T>
- Returns:
 
 - 
getContextpublic BlockContext<?> getContext(String nameOfSubcontext) Description copied from interface:BlockContextCalled after reading a key of map entry in YAML file and before reading its value. The key of the entry is represented asnameOfSubcontextparameter, and provides means to specify aYamlContextfor transforming the mapping value into appropriate Java object.- Specified by:
- getContextin interface- BlockContext<T>
- Parameters:
- nameOfSubcontext- Key of the map entry
- Returns:
- Context used for transforming the value,
 or nullif the default primitive / sequence / mapping context should be used instead.
- See Also:
- BlockContext.DefaultObjectContext,- BlockContext.DefaultListContext,- BlockContext.DefaultMapContext
 
 - 
writeValuepublic void writeValue(T entity, WritingMechanism mech) Description copied from interface:BlockContextWrites the given value usingWritingMechanism.- Specified by:
- writeValuein interface- BlockContext<T>
 
 
- 
 
-