java.lang.Object
org.praxislive.base.MapTreeWriter
- All Implemented Interfaces:
TreeWriter
A TreeWriter implementation that builds the data in the format specified by
.
invalid reference
SerializableProtocol
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the data map.clear()Clear the writer for reuse.writeAnnotation(String key, String value) Write a custom annotation.writeChild(String id, Consumer<TreeWriter> processor) Write the data for a child component.writeConnection(Connection connection) Write a port connection between two child component.writeInfo(ComponentInfo info) Write the component info.writeProperty(String id, Value value) Write the value of a property.writeType(ComponentType type) Write the component type.
-
Constructor Details
-
MapTreeWriter
public MapTreeWriter()Create a new writer.
-
-
Method Details
-
writeAnnotation
Description copied from interface:TreeWriterWrite a custom annotation.- Specified by:
writeAnnotationin interfaceTreeWriter- Parameters:
key- annotation idvalue- annotation value- Returns:
- this writer
-
writeChild
Description copied from interface:TreeWriterWrite the data for a child component.The processor will be called during the execution of this method. The passed in writer may be the same writer, configured to refer to the child, or a new writer instance. The writer should not be cached or used outside of the processor.
- Specified by:
writeChildin interfaceTreeWriter- Parameters:
id- child IDprocessor- writer consumer to process and write child- Returns:
- this writer
-
writeConnection
Description copied from interface:TreeWriterWrite a port connection between two child component.- Specified by:
writeConnectionin interfaceTreeWriter- Parameters:
connection- port connection- Returns:
- this writer
-
writeInfo
Description copied from interface:TreeWriterWrite the component info.- Specified by:
writeInfoin interfaceTreeWriter- Parameters:
info- component info- Returns:
- this writer
-
writeProperty
Description copied from interface:TreeWriterWrite the value of a property.A component may write properties that are at their defaults if this is more efficient. Consumers of the resulting data may verify against the provided info.
- Specified by:
writePropertyin interfaceTreeWriter- Parameters:
id-value-- Returns:
- this writer
-
writeType
Description copied from interface:TreeWriterWrite the component type.- Specified by:
writeTypein interfaceTreeWriter- Parameters:
type- component type- Returns:
- this writer
-
build
Build the data map.- Returns:
- data map
-
clear
Clear the writer for reuse.- Returns:
- this writer
-