Interface DocumentSend
public interface DocumentSend
Represents a version of a document that can be transferred into another document. There are predefined element types
that can be included in a document send:
- Objects
- Arrays
- Primitives
- Null
The document that is receiving a document send is not required to implement all these element types and can silently ignore one when importing or not emitting one when exporting.
- Since:
- 4.0
-
Method Summary
Modifier and TypeMethodDescriptioninto(@NonNull DocumentFactory factory) Receives this document into the given document factory.Get the root element of the document send.
-
Method Details
-
rootElement
Get the root element of the document send. As each document is supposed to use an object element as the root element this method always returns an object element.- Returns:
- the root element of the document send.
-
into
Receives this document into the given document factory. In normal cases the given document factory should create a new, empty document and import all supported key-value pairs that are supplied by this send into it.The receiving process of a document send should never throw an exception unless the given document send contains malformed or invalid data making it impossible to get imported.
- Parameters:
factory- the document factory that is supposed to receive this document send.- Returns:
- a new, empty document containing all supported key-value pairs of the given document send.
- Throws:
NullPointerException- if the given factory is null.
-