Please have a look at the interfaces {@link Int.ecb.gesmescb.event.GESMESCBWriter}, {@link Int.ecb.gesmescb.event.StructureListener}, {@link Int.ecb.gesmescb.event.DataListener}, and the class {@link Int.ecb.gesmescb.event.GESMESCBEventListenerAdapter}. The roles of these are described in the documentation for the package {@link Int.ecb.gesmescb.event}.
So there are mainly three things to implement:
handle
for all types of
{@link Int.ecb.gesmescb.GESMESCBObject}s that your class
should process.
The handle
Methods available are
{@link Int.ecb.gesmescb.event.GESMESCBEventListenerAdapter#handle(Int.ecb.gesmescb.InterchangeBegin)},
{@link Int.ecb.gesmescb.event.GESMESCBEventListenerAdapter#handle(Int.ecb.gesmescb.MessageBegin)},
{@link Int.ecb.gesmescb.event.StructureListener#handle(Int.ecb.gesmescb.CodeList)},
{@link Int.ecb.gesmescb.event.StructureListener#handle(Int.ecb.gesmescb.StatisticalConcept)},
{@link Int.ecb.gesmescb.event.StructureListener#handle(Int.ecb.gesmescb.KeyFamily)},
{@link Int.ecb.gesmescb.event.DataListener#handle(Int.ecb.gesmescb.TimeSeries)},
{@link Int.ecb.gesmescb.event.DataListener#handle(Int.ecb.gesmescb.Attribute)},
{@link Int.ecb.gesmescb.event.GESMESCBEventListenerAdapter#handle(Int.ecb.gesmescb.MessageEnd)}, and
{@link Int.ecb.gesmescb.event.GESMESCBEventListenerAdapter#handle(Int.ecb.gesmescb.InterchangeEnd)}.
Of course, if your GESMESCBWriter
writes only data, then you will not implement
StructureListener
with its methods to handle
CodeList
s, StatisticalConcept
s,
and KetFamily
objects.
In this case you should simply extend
{@link Int.ecb.gesmescb.event.GESMESCBEventListenerAdapter}
and implement {@link Int.ecb.gesmescb.event.DataListener}.
The operation handle
is the one most dependent
on the kind of destination and syntax you are going to write to.Similar to what is mentioned in
How to write a GESMESCBReader
,
you may want to also implement the
interface {@link Int.ecb.gesmescb.util.Named}.
You find one way of how to do it in
YourWriter.java
.
A GESMESCBWriter
handles GESMESCBObjects
in the same order as the {@link Int.ecb.gesmescb.event.GESMESCBReader}
dispatches them. To learn about the possible sequences
you may want to have a look at
How to write a GESMESCBReader
.
Since a {@link Int.ecb.gesmescb.MessageBegin} contains a lot of
information which is needed as reference context for successive
GESMESCBObjects
within the message, it is in many cases
a good idea to store the last MessageBegin
encountered
into a private field of the GESMESCBWriter
, so that
information can be linked to the appropriate context. The same in principle
also applies to {@link Int.ecb.gesmescb.InterchangeBegin}, which, however,
carries less interesting information for most applications.