Class DummyFormatter
- java.lang.Object
-
- de.iip_ecosphere.platform.connectors.formatter.DummyFormatter
-
- All Implemented Interfaces:
OutputFormatter<java.lang.String>
public class DummyFormatter extends java.lang.Object implements OutputFormatter<java.lang.String>
A dummy instance to avoid NPEs.- Author:
- Holger Eichelberger, SSE
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface de.iip_ecosphere.platform.connectors.formatter.OutputFormatter
OutputFormatter.OutputConverter<T>
-
-
Field Summary
-
Fields inherited from interface de.iip_ecosphere.platform.connectors.formatter.OutputFormatter
SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description DummyFormatter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.String name, java.lang.String data)Adds information to one chunk of output.byte[]chunkCompleted()Completes a chunk of output data.voidendStructure()Ends a structure started before.OutputFormatter.OutputConverter<java.lang.String>getConverter()Returns the output converter.voidstartArrayStructure(java.lang.String name)Starts an array structure.voidstartObjectStructure(java.lang.String name)Starts an object structure.
-
-
-
Method Detail
-
add
public void add(java.lang.String name, java.lang.String data) throws java.io.IOExceptionDescription copied from interface:OutputFormatterAdds information to one chunk of output. Hierarchical names separated byOutputFormatter.SEPARATORcan be used, but nested values for the same parent (object) field must be named in sequence.- Specified by:
addin interfaceOutputFormatter<java.lang.String>- Parameters:
name- optional data name field (may be null for none)data- the data to be added- Throws:
java.io.IOException- if adding the data fails for some reason
-
startArrayStructure
public void startArrayStructure(java.lang.String name) throws java.io.IOExceptionDescription copied from interface:OutputFormatterStarts an array structure. FollowingOutputFormatter.add(String, Object)calls will add elements to the array. Must be closed withOutputFormatter.endStructure()- Specified by:
startArrayStructurein interfaceOutputFormatter<java.lang.String>- Parameters:
name- optional data name field holding the array (may be null for none)- Throws:
java.io.IOException- if starting this structure fails
-
startObjectStructure
public void startObjectStructure(java.lang.String name) throws java.io.IOExceptionDescription copied from interface:OutputFormatterStarts an object structure. FollowingOutputFormatter.add(String, Object)calls will add elements to the object. Must be closed withOutputFormatter.endStructure()- Specified by:
startObjectStructurein interfaceOutputFormatter<java.lang.String>- Parameters:
name- optional data name field holding the array (may be null for none)- Throws:
java.io.IOException- if starting this structure fails
-
endStructure
public void endStructure() throws java.io.IOExceptionDescription copied from interface:OutputFormatterEnds a structure started before.- Specified by:
endStructurein interfaceOutputFormatter<java.lang.String>- Throws:
java.io.IOException- if ending the actual structure fails
-
chunkCompleted
public byte[] chunkCompleted() throws java.io.IOExceptionDescription copied from interface:OutputFormatterCompletes a chunk of output data.- Specified by:
chunkCompletedin interfaceOutputFormatter<java.lang.String>- Returns:
- the chunk
- Throws:
java.io.IOException- if creating the chunk fails for some reason
-
getConverter
public OutputFormatter.OutputConverter<java.lang.String> getConverter()
Description copied from interface:OutputFormatterReturns the output converter.- Specified by:
getConverterin interfaceOutputFormatter<java.lang.String>- Returns:
- the output converter
-
-