Interface BlockContext<V>
- 
- Type Parameters:
- V- Type of the result
 - All Known Implementing Classes:
- BlockContext.DefaultListContext,- BlockContext.DefaultMapContext,- BlockContext.DefaultObjectContext,- MapEntityContext,- MapEntityContext.MapEntityMappingYamlContext,- MapEntityContext.MapEntitySequenceYamlContext,- StringListMapContext,- StringListMapContext.AttributeValueYamlContext
 
 public interface BlockContext<V>A class implementing aBlockContextinterface represents a transformer from a primitive value / sequence / mapping representation as declared in YAML format into a Java object of typeV, with ability to produce theresulting instanceof parsing.This transformer handles only a values of a single node in structured file, i.e. single value (a primitive value, sequence or mapping). The root level is at the beginning of e.g. YAML or JSON document. Every mapping key and every sequence value then represents next level of nesting. - Author:
- hmlnarik
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static classBlockContext.DefaultListContext<T>static classBlockContext.DefaultMapContext<T>static classBlockContext.DefaultObjectContext<T>
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidadd(Object value)Modifies theresult returnedfrom within this context by providing the read primitive value or a single sequence item in thevalueparameter.default voidadd(String name, Object value)Modifies theresult returnedfrom within this context by providing the read mapping entrynameto givenvalue.BlockContext<?>getContext(String nameOfSubcontext)Called after reading a key of map entry in YAML file and before reading its value.VgetResult()Returns the result of parsing the given part of YAML file.Class<?>getScalarType()voidwriteValue(V value, WritingMechanism mech)Writes the given value usingWritingMechanism.
 
- 
- 
- 
Method Detail- 
writeValuevoid writeValue(V value, WritingMechanism mech) Writes the given value usingWritingMechanism.- Parameters:
- value-
- mech-
 
 - 
getContextBlockContext<?> getContext(String nameOfSubcontext) Called 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.- 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
 
 - 
adddefault void add(String name, Object value) Modifies 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. - Parameters:
- name-
- value-
 
 - 
adddefault void add(Object value) Modifies theresult returnedfrom within this context by providing the read primitive value or a single sequence item in thevalueparameter.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. - Parameters:
- value-
 
 - 
getResultV getResult() Returns the result of parsing the given part of YAML file.- Returns:
 
 - 
getScalarTypeClass<?> getScalarType() 
 
- 
 
-