- All Superinterfaces:
AutoCloseable
public interface EDIStreamWriter extends AutoCloseable
-
Method Summary
Modifier and Type Method Description voidclose()Close this writer and free any resources associated with the writer.EDIStreamWriterendComponent()EDIStreamWriterendElement()EDIStreamWriterendInterchange()voidflush()Write any cached data to the underlying output mechanism.SchemagetControlSchema()Returns the control schema currently set on the reader.Map<String,Character>getDelimiters()Retrieve a read-only map of delimiters in use for the stream being written.LocationgetLocation()Return the current location of the writer.ObjectgetProperty(String name)Get the value of a feature/property from the underlying implementationStringgetStandard()Get the EDI standard name.voidsetControlSchema(Schema controlSchema)Sets the schema to be used for validation of the control structure for this stream writer.voidsetTransactionSchema(Schema transactionSchema)Sets the schema to be used for validation of the business transaction for this stream writer.EDIStreamWriterstartComponent()EDIStreamWriterstartInterchange()EDIStreamWriterwriteBinaryData(byte[] text, int start, int end)EDIStreamWriterwriteBinaryData(InputStream stream)EDIStreamWriterwriteBinaryData(ByteBuffer buffer)EDIStreamWriterwriteComponent(char[] text, int start, int end)EDIStreamWriterwriteComponent(CharSequence text)EDIStreamWriterwriteElement(char[] text, int start, int end)EDIStreamWriterwriteElement(CharSequence text)EDIStreamWriterwriteElementData(char[] text, int start, int end)EDIStreamWriterwriteElementData(CharSequence text)EDIStreamWriterwriteEmptyComponent()EDIStreamWriterwriteEmptyElement()EDIStreamWriterwriteEndSegment()EDIStreamWriterwriteRepeatElement()EDIStreamWriterwriteStartElement()EDIStreamWriterwriteStartElementBinary()EDIStreamWriterwriteStartSegment(String name)
-
Method Details
-
getProperty
Get the value of a feature/property from the underlying implementation- Parameters:
name- - The name of the property, may not be null- Returns:
- The value of the property
- Throws:
IllegalArgumentException- if name is null
-
close
Close this writer and free any resources associated with the writer. This must not close the underlying output stream.- Specified by:
closein interfaceAutoCloseable- Throws:
EDIStreamException- if there are errors freeing associated resources
-
flush
Write any cached data to the underlying output mechanism.- Throws:
EDIStreamException- if there are errors flushing the cache
-
getControlSchema
Schema getControlSchema()Returns the control schema currently set on the reader. If none has been set, then null will be returned.- Returns:
- the control schema current set on this reader, may be null
- Since:
- 1.8
-
setControlSchema
Sets the schema to be used for validation of the control structure for this stream writer. This schema will be used to validate interchange, group, and transaction/message envelopes.
Calls to this method are only valid before the interchange is started.
- Parameters:
controlSchema- the schema instance to use for validation of control structures- Throws:
IllegalStateException- when the writer is not in its initial state- Since:
- 1.1
-
setTransactionSchema
Sets the schema to be used for validation of the business transaction for this stream writer. This schema will be used to validate only the contents of a transaction/message, not including the begin/end control structures.
This method may be called at any time. However, when non-null, the writer will make use of the transaction schema for output validation. It is the responsibility of the caller to set the transaction schema to null at the end of the business transaction.
- Parameters:
transactionSchema- the schema instance to use for validation of business transaction structures- Since:
- 1.1
-
getLocation
Location getLocation()Return the current location of the writer. If the Location is unknown the processor should return an implementation of Location that returns -1 for the location values. The location information is only valid until the next item is written to the output.- Returns:
- current location of the writer
- Since:
- 1.1
-
getStandard
String getStandard()Get the EDI standard name. Calls to this method are only valid when the interchange type has been determined, after the full interchange header segment has been written.- Returns:
- the name of the EDI standard
- Throws:
IllegalStateException- when the standard has not yet been determined, prior to the start of an interchange header segment being fully written- Since:
- 1.7
-
getDelimiters
Retrieve a read-only map of delimiters in use for the stream being written.- Returns:
- The value of the property
- Throws:
IllegalStateException- when the standard has not yet been determined, prior to the start of an interchange header segment being fully written- Since:
- 1.8
-
startInterchange
- Throws:
EDIStreamException
-
endInterchange
- Throws:
EDIStreamException
-
writeStartSegment
- Throws:
EDIStreamException
-
writeEndSegment
- Throws:
EDIStreamException
-
writeStartElement
- Throws:
EDIStreamException
-
writeStartElementBinary
- Throws:
EDIStreamException
-
endElement
- Throws:
EDIStreamException
-
writeRepeatElement
- Throws:
EDIStreamException
-
startComponent
- Throws:
EDIStreamException
-
endComponent
- Throws:
EDIStreamException
-
writeEmptyElement
- Throws:
EDIStreamException
-
writeElement
- Throws:
EDIStreamException
-
writeElement
- Throws:
EDIStreamException
-
writeEmptyComponent
- Throws:
EDIStreamException
-
writeComponent
- Throws:
EDIStreamException
-
writeComponent
- Throws:
EDIStreamException
-
writeElementData
- Throws:
EDIStreamException
-
writeElementData
- Throws:
EDIStreamException
-
writeBinaryData
- Throws:
EDIStreamException
-
writeBinaryData
- Throws:
EDIStreamException
-
writeBinaryData
- Throws:
EDIStreamException
-