-
public interface StructuredFormatInterface providing a structured format such as JSON or XML.- Since:
- 1.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static StringART_BOOLEAN_VALUEThe (XML) attribute for a boolean value.static StringART_NUMBER_VALUEThe (XML) attribute for a numeric value.static StringART_STRING_VALUEThe (XML) attribute for a string value.static StringID_JSONNameof JSON format.static StringID_XMLNameof XML format.static StringID_YAMLNameof YAML format.static StringNS_PREFIX_ARRAYThe (XML) namespace prefix for an array.static StringNS_PREFIX_OBJECTThe (XML) namespace prefix for an object.static StringNS_URI_ARRAYThe (XML) namespace URI for an array.static StringNS_URI_OBJECTThe (XML) namespace URI for an object.static StringTAG_ITEMThe (XML) tag for an array item.static StringTAG_ROOTThe (XML) root tag.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description StringgetId()default voidread(String data, UnmarshallableObject object)default StructuredReaderreader(InputStream in)StructuredReaderreader(Reader reader)default StructuredReaderreader(Object data)default StructuredReaderreader(String data)default Stringwrite(MarshallableObject object)default StructuredWriterwriter(OutputStream out)StructuredWriterwriter(Appendable writer)
-
-
-
Field Detail
-
ID_JSON
static final String ID_JSON
Nameof JSON format.- See Also:
- Constant Field Values
-
ID_XML
static final String ID_XML
Nameof XML format.- See Also:
- Constant Field Values
-
ID_YAML
static final String ID_YAML
Nameof YAML format.- See Also:
- Constant Field Values
-
NS_PREFIX_OBJECT
static final String NS_PREFIX_OBJECT
The (XML) namespace prefix for an object.- See Also:
- Constant Field Values
-
NS_URI_OBJECT
static final String NS_URI_OBJECT
The (XML) namespace URI for an object.- See Also:
- Constant Field Values
-
NS_PREFIX_ARRAY
static final String NS_PREFIX_ARRAY
The (XML) namespace prefix for an array.- See Also:
- Constant Field Values
-
NS_URI_ARRAY
static final String NS_URI_ARRAY
The (XML) namespace URI for an array.- See Also:
- Constant Field Values
-
TAG_ROOT
static final String TAG_ROOT
The (XML) root tag.- See Also:
- Constant Field Values
-
TAG_ITEM
static final String TAG_ITEM
The (XML) tag for an array item.- See Also:
- Constant Field Values
-
ART_STRING_VALUE
static final String ART_STRING_VALUE
The (XML) attribute for a string value.- See Also:
- Constant Field Values
-
ART_BOOLEAN_VALUE
static final String ART_BOOLEAN_VALUE
The (XML) attribute for a boolean value.- See Also:
- Constant Field Values
-
ART_NUMBER_VALUE
static final String ART_NUMBER_VALUE
The (XML) attribute for a numeric value.- See Also:
- Constant Field Values
-
-
Method Detail
-
reader
StructuredReader reader(Reader reader)
- Parameters:
reader- theReaderpointing to the structured data to read and parse.- Returns:
- the
StructuredReader.
-
reader
default StructuredReader reader(InputStream in)
- Parameters:
in- theInputStreampointing to the structured data to read (in UTF-8) and parse.- Returns:
- the
StructuredReader.
-
reader
default StructuredReader reader(String data)
- Parameters:
data- the structured data asString.- Returns:
- the
StructuredReader.
-
read
default void read(String data, UnmarshallableObject object)
- Parameters:
data- the structured data asString.object- theUnmarshallableObjectto read.- See Also:
UnmarshallableObject.read(StructuredReader)
-
reader
default StructuredReader reader(Object data)
- Parameters:
data- the data as a potentially proprietary implementation-specific type.- Returns:
- the
StringReader.
-
writer
StructuredWriter writer(Appendable writer)
- Parameters:
writer- theAppendable(WriterorStringBuilder) where to write the structured data to.- Returns:
- the wrapped
StructuredWriter.
-
writer
default StructuredWriter writer(OutputStream out)
- Parameters:
out- theOutputStreamwhere to write the structured data to (in UTF-8).- Returns:
- the wrapped
StructuredWriter.
-
write
default String write(MarshallableObject object)
- Parameters:
object- theMarshallableObjectto serialize.- Returns:
- the serialized data as
String.
-
-