|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SchemaGenerator
A SchemaGenerator is used to create XML Schema files which describe the
structure of xml files read or created by a Converter
,
ConvertToXML
or ConvertFromXML
object.
The SchemaGenerator is created from a ConverterFactory
using either
of the ConverterFactory.newSchemaGenerator
overloads.
The parameter to the newSchemaGenerator
method describes the specific to XML or from XML conversion which will be
performed.
Sometimes, a SchemaGenerator will need an instance of the native data file
to create the correct XML Schema file, so all the methods in SchemaGenerator 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 SchemaGenerator. |
SAXSource |
getSAXSource()
Create an XML Schema and make it available as a SAXSource . |
SAXSource |
getSAXSource(Source source)
Create an XML Schema and make it available as a SAXSource . |
void |
getSchema(Result result)
Create an XML Schema and write it to the specified result object. |
void |
getSchema(Source source,
Result result)
Create an XML Schema and write it to the specified result object. |
javax.xml.stream.XMLStreamReader |
getXMLStreamReader()
Create an XML Schema and make it available as an XMLStreamReader . |
javax.xml.stream.XMLStreamReader |
getXMLStreamReader(Source source)
Create an XML Schema and make it available as an XMLStreamReader . |
boolean |
requiresSource()
Determine whether this SchemaGenerator will require an instance of the native data file to generate the XML Schema. |
Method Detail |
---|
void getSchema(Result result) throws ConverterException
result
- Specifies where the created XML Schema should be written.
ConverterException
void getSchema(Source source, Result result) throws ConverterException
source
- A Source
object which specifies an instance of the native data file.result
- Specifies where the created XML Schema should be written.
ConverterException
SAXSource getSAXSource() throws ConverterException
SAXSource
.
This method should be used if the native data file is not needed to
generate the XML Schema.
ConverterException
SAXSource getSAXSource(Source source) throws ConverterException
SAXSource
.
This method should be used if an instance of the native data file is needed
to generate the XML Schema.
source
- A Source
object which specifies an instance of the native data file.
ConverterException
javax.xml.stream.XMLStreamReader getXMLStreamReader() throws javax.xml.stream.XMLStreamException
XMLStreamReader
.
This method should be used if the native data file is not needed to
generate the XML Schema.
javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamReader getXMLStreamReader(Source source) throws javax.xml.stream.XMLStreamException
XMLStreamReader
.
This method should be used if an instance of the native data file is needed
to generate the XML Schema.
source
- A Source
object which specifies an instance of the native data file.
javax.xml.stream.XMLStreamException
boolean requiresSource() throws ConverterException
If this method returns true, then the caller should use one of the methods which
uses a source object: getSchema(Source, Result)
, getSAXSource(Source)
or getXMLStreamReader(Source)
.
If this method returns false, then the caller can use either one of the above methods,
or can instead use one of the methods which
do not use a source object: getSchema(Result)
, getSAXSource()
or getXMLStreamReader()
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 |