Package io.permazen.core.util
Class XMLObjectSerializer.OutputOptions.Builder
java.lang.Object
io.permazen.core.util.XMLObjectSerializer.OutputOptions.Builder
- All Implemented Interfaces:
Cloneable
- Enclosing class:
- XMLObjectSerializer.OutputOptions
public static final class XMLObjectSerializer.OutputOptions.Builder
extends Object
implements Cloneable
Builder for
XMLObjectSerializer.OutputOptions
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Create a newXMLObjectSerializer.OutputOptions
from this instance.clone()
Clone this instance.elementsAsNames
(boolean elementsAsNames) Configure whether to output XML element names that are based on the corresponding object or field name.includeStorageIds
(boolean includeStorageIds) Configure whether to include storage ID's in the output.objectGenerator
(Function<? super Transaction, ? extends Stream<? extends ObjId>> objectGenerator) Configure a custom function that streams the objects to include in the output (identified byObjId
).prettyPrint
(boolean prettyPrint) Configure whether to pretty-print the XML, i.e., indent and include storage ID comments.schemaGenerator
(Function<? super Transaction, ? extends Stream<? extends SchemaModel>> schemaGenerator) Configure a custom function that streams theSchemaModel
s to include in the output.
-
Method Details
-
schemaGenerator
public XMLObjectSerializer.OutputOptions.Builder schemaGenerator(Function<? super Transaction, ? extends Stream<? extends SchemaModel>> schemaGenerator) Configure a custom function that streams theSchemaModel
s to include in the output.The generated
SchemaModel
s should always include storage ID's, so that theincludeStorageIds
option can decide whether they are expressed in the output.- Parameters:
schemaGenerator
- customSchemaModel
streaming function, or null to stream all schemas in the database
-
objectGenerator
public XMLObjectSerializer.OutputOptions.Builder objectGenerator(Function<? super Transaction, ? extends Stream<? extends ObjId>> objectGenerator) Configure a custom function that streams the objects to include in the output (identified byObjId
).- Returns:
- custom
ObjId
streaming function, or null to stream all objects in the database
-
elementsAsNames
Configure whether to output XML element names that are based on the corresponding object or field name.The default value is true.
- Parameters:
elementsAsNames
- whether to use custom XML element names- Returns:
- this instance
-
includeStorageIds
Configure whether to include storage ID's in the output.The default value is false.
- Parameters:
includeStorageIds
- whether to include storage ID's- Returns:
- this instance
-
prettyPrint
Configure whether to pretty-print the XML, i.e., indent and include storage ID comments.The default value is true.
- Parameters:
prettyPrint
- whether to pretty-print- Returns:
- this instance
-
build
Create a newXMLObjectSerializer.OutputOptions
from this instance.- Returns:
- new output config
-
clone
Clone this instance.
-