|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ddtek.xmlconverter.Configuration
public class Configuration
A Configuration object contains user settable policies that govern certain aspects of the conversion process.
Each ConverterFactory contains a Configuration object which can be modified by the application; any changes affect all Converter objects created subsequently from that ConverterFactory.
When the user creates a Converter object from the ConverterFactory, the Converter object gets a copy of the factory's Configuration. This copy can also be modified by the application if desired.
The Configuration object is fully Thread-safe, however if one Thread modifies a Configuration object, that may affect the behavior of another Thread's conversion which is using the same Configuration.
Field Summary | |
---|---|
static int |
ABORT
Value for setBufferOverflowPolicy and setTempFilePolicy. |
static int |
UNLIMITED_BUFFER
Value for setMaxBufferSize to indicate there should be no limit. |
static int |
USE_MEMORY
Value for setTempFilePolicy. |
static int |
USE_TEMP_FILE
Value for setBufferOverflowPolicy. |
Constructor Summary |
---|
Method Summary | |
---|---|
int |
getBufferOverflowPolicy()
Get the current value of the memory buffer overflow policy. |
ConverterListener |
getConverterListener()
Return the current ConverterListener |
int |
getMaxBufferSize()
Get the current size limit for the memory buffer. |
String |
getProperty(String property,
String defaultValue)
Get the current value of a property which affects the behavior of an XML Converter. |
int |
getTempFilePolicy()
Get the current value of the temp file policy. |
void |
setBufferOverflowPolicy(int value)
Set the memory buffer overflow policy. |
void |
setConverterListener(ConverterListener listener)
Set a ConverterListener |
void |
setEDIExtension(StreamSource source)
Load a SEF file to be used by EDI converters. |
void |
setMaxBufferSize(int value)
Set the maximum size limit for the memory buffer. |
void |
setProperty(String property,
String value)
Set a property which affects the behavior of an XML Converter. |
void |
setTempFilePolicy(int value)
Set the temp file policy. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int UNLIMITED_BUFFER
public static final int ABORT
public static final int USE_TEMP_FILE
public static final int USE_MEMORY
Constructor Detail |
---|
Method Detail |
---|
public int getMaxBufferSize()
public void setMaxBufferSize(int value)
public int getBufferOverflowPolicy()
public void setBufferOverflowPolicy(int value)
public int getTempFilePolicy()
public void setTempFilePolicy(int value)
public void setProperty(String property, String value)
property
- The property name.value
- The property value.public String getProperty(String property, String defaultValue)
property
- The property name.defaultValue
- The default value if the property is not set.
public ConverterListener getConverterListener()
ConverterListener
null
if no handler is set and the default error handling action should be
taken.public void setConverterListener(ConverterListener listener)
ConverterListener
listener
- The ConverterListener object, or null
to revert to the default error handling behavior. If an error handler
is set at the ConverterFactory
level, then
each instance of a Converter created by that factory will share the
same instance of the ConverterListener set here.public void setEDIExtension(StreamSource source) throws IOException
Converter
objects have an extensive, builtin repository of 100s of EDI standards.
For most uses, it is not necessary to provide a SEF file. However, if you need to do a conversion
where the data varies from the published EDI standards, you can use a SEF file to identify the
necessary modifications to the EDI standards. The SEF file does not need to contain the entire
standard, just those parts which have been changed.
If the SEF file was built by the Stylus Studio EDI to XML editor, then it will contain a converter:EDI URI. The properties in that URI will be used for all conversions which use this Configuration object.
source
- source designates the SEF file. If source contains an InputStream,
that will be used. Otherwise, if it contains a Reader, that will be used. Otherwise,
it must contain a systemID which will be opened using an instance of
ConverterResolver
.
If source is null, the extension object (if any) will be removed from this Configuration.
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |