|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fudgemsg.FudgeMsgWriter
public class FudgeMsgWriter
A writer for passing Fudge messages (FudgeFieldContainer
instances) to an underlying FudgeStreamWriter
instance. This implementation
assumes that the whole message (or envelope) is available to the caller before writing starts. This is provided for convenience - greater runtime
efficiency may be possible by working directly with a FudgeStreamWriter
to emit Fudge stream elements as they are generated.
Constructor Summary | |
---|---|
FudgeMsgWriter(FudgeStreamWriter streamWriter)
Creates a new FudgeMsgWriter around an existing FudgeStreamWriter . |
Method Summary | |
---|---|
void |
close()
Flushes and closes the underlying FudgeStreamWriter . |
void |
flush()
Flushes the underlying FudgeStreamWriter . |
int |
getDefaultMessageProcessingDirectives()
Returns the current processing directive flags for messages that are passed without an envelope. |
int |
getDefaultMessageVersion()
Returns the current schema version used for messages that are passed without an envelope. |
int |
getDefaultTaxonomyId()
Returns the current default taxonomy identifier. |
FudgeContext |
getFudgeContext()
Returns the FudgeContext of the current underlying FudgeStreamWriter . |
protected FudgeStreamWriter |
getStreamWriter()
Returns the underlying FudgeStreamWriter . |
void |
setDefaultMessageProcessingDirectives(int processingDirectives)
Sets the processing directive flags to be used for messages that are passed without an envelope. |
void |
setDefaultMessageVersion(int version)
Sets the schema version to be used for messages that are passed without an envelope. |
void |
setDefaultTaxonomyId(int taxonomyId)
Sets the default taxonomy identifier for messages that are passed without an envelope. |
String |
toString()
|
void |
writeMessage(FudgeFieldContainer message)
Writes a message. |
void |
writeMessage(FudgeFieldContainer message,
int taxonomyId)
Writes a message with the given taxonomy. |
void |
writeMessage(FudgeFieldContainer message,
int taxonomyId,
int version,
int processingDirectives)
Writes a message with the given taxonomy, schema version and processing directive flags. |
void |
writeMessageEnvelope(FudgeMsgEnvelope envelope)
Writes a message envelope using the default taxonomy. |
void |
writeMessageEnvelope(FudgeMsgEnvelope envelope,
int taxonomyId)
Writes a message envelope with the given taxonomy. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FudgeMsgWriter(FudgeStreamWriter streamWriter)
FudgeMsgWriter
around an existing FudgeStreamWriter
.
streamWriter
- target to write Fudge stream elements toMethod Detail |
---|
public void flush()
FudgeStreamWriter
.
flush
in interface Flushable
public void close()
FudgeStreamWriter
.
protected FudgeStreamWriter getStreamWriter()
FudgeStreamWriter
.
FudgeStreamWriter
public FudgeContext getFudgeContext()
FudgeContext
of the current underlying FudgeStreamWriter
.
FudgeContext
public String toString()
toString
in class Object
public int getDefaultTaxonomyId()
public void setDefaultTaxonomyId(int taxonomyId)
taxonomyId
- the taxonomy identifierpublic int getDefaultMessageVersion()
public void setDefaultMessageVersion(int version)
version
- new schema version valuepublic int getDefaultMessageProcessingDirectives()
public void setDefaultMessageProcessingDirectives(int processingDirectives)
processingDirectives
- processing directive flagspublic void writeMessage(FudgeFieldContainer message, int taxonomyId, int version, int processingDirectives)
message
- message to writetaxonomyId
- identifier of the taxonomy to use. If the taxonomy is recognized by the FudgeContext
it will be used to reduce field names to ordinals where possible.version
- schema versionprocessingDirectives
- processing directive flagspublic void writeMessage(FudgeFieldContainer message, int taxonomyId)
message
- message to writetaxonomyId
- identifier of the taxonomy to use. If the taxonomy is recognized by the FudgeContext
it will be used to reduce field names to ordinals where possible.public void writeMessage(FudgeFieldContainer message)
message
- message to write
NullPointerException
- if the default taxonomy has not been specifiedpublic void writeMessageEnvelope(FudgeMsgEnvelope envelope, int taxonomyId)
envelope
- message envelope to writetaxonomyId
- identifier of the taxonomy to use. If the taxonomy is recognized by the FudgeContext
it will be used to reduce field names to ordinals where possible.public void writeMessageEnvelope(FudgeMsgEnvelope envelope)
envelope
- message envelope to write
NullPointerException
- if the default taxonomy has not been specified
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |