|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SampleGenerator
An SampleGenerator is used to create a sample EDI XML file from a message definition.
The SampleGenerator is created from a ConverterFactory
using
ConverterFactory.newSampleGenerator
.
Sometimes, an SampleGenerator will need an instance of the native data file
to create the sample EDI XML file, so all the methods in SampleGenerator come
in pairs. One of the methods has a Source parameter to provide the native data
file while the other method of the pair has no Source parameter and is used
when no native data file is required. The caller can determine whether a Source
parameter is needed with the requiresSource()
method.
Method Summary | |
---|---|
Configuration |
getConfiguration()
Get the Configuration object for this SampleGenerator. |
void |
getSample(Result result)
Create a sample EDI XML file and write it to the specified result object. |
void |
getSample(Source source,
Result result)
Create a sample EDI XML file and write it to the specified result object. |
boolean |
requiresSource()
Determine whether this SampleGenerator will require an instance of the native data file to generate the sample EDI XML file. |
Method Detail |
---|
void getSample(Result result) throws ConverterException
result
- Specifies where the created sample EDI XML should be written.
ConverterException
void getSample(Source source, Result result) throws ConverterException
source
- A Source
object which specifies an instance of the native data file.result
- Specifies where the created sample EDI XML should be written.
ConverterException
boolean requiresSource() throws ConverterException
If this method returns true, then the caller should use the
getSample(Source, Result)
method which uses a source object.
If this method returns false, then the caller can use either one of the above methods,
or can instead use the getSample(Result)
method which
does not use a source object.
Some converters, such as EDI, will take settings from the source object to set
their values, and allow them to be augmented by URI parameters. In those cases,
it can be useful to specify a source object.
There is never harm in specifying a source object; at the very worst, if it is not
necessary it will be silently ignored.
ConverterException
Configuration getConfiguration()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |