Class StandardizerConfigurationXmlReader
java.lang.Object
chemaxon.standardizer.configuration.StandardizerConfigurationXmlReader
- All Implemented Interfaces:
StandardizerConfigurationReader
@PublicApi
public class StandardizerConfigurationXmlReader
extends Object
implements StandardizerConfigurationReader
Standardizer configuration reader for parsing XML configuration files.
If the configuration contains references to molecules/molecule files not
contained by the configuration file, the base path of the configuration must
be set by the method setPath(String) before getting the configuration.
However, it is strongly discouraged to reference external molecule files
from the configuration.
There is no static schema for the configuration file, as the available standardizer actions define their own XML tags. However, the basic structure of the configuration file must be as follows.
<?xml version="1.0" encoding="UTF-8"?> <StandardizerConfiguration> <Actions> </Actions> </StandardizerConfiguration>
- Since:
- 5.11
-
Field Summary
Fields inherited from interface chemaxon.standardizer.configuration.StandardizerConfigurationReader
DEFAULT_STANDARDIZERS_CONFIG_PATH, USER_STANDARDIZERS_CONFIG_PATH -
Constructor Summary
ConstructorsConstructorDescriptionStandardizerConfigurationXmlReader(InputStream inputStream) Initiate anStandardizerConfigurationXmlReaderinstance with the given inputSteam with the configurationStandardizerConfigurationXmlReader(InputStream inputStream, StandardizerActionFactory factory) Initiate anStandardizerConfigurationXmlReaderinstance with the given inputSteam with the configuration -
Method Summary
Modifier and TypeMethodDescriptionGets the configuration defined by the pre-set configuration file.static booleanisValidXMLConfiguration(InputStream inputStream) Checks whether the contents of the provided input stream is a valid configuration XMLvoidSets the base path of the configuration.
-
Constructor Details
-
StandardizerConfigurationXmlReader
Initiate anStandardizerConfigurationXmlReaderinstance with the given inputSteam with the configuration- Parameters:
inputStream- anInputStreaminstance
-
StandardizerConfigurationXmlReader
public StandardizerConfigurationXmlReader(InputStream inputStream, StandardizerActionFactory factory) Initiate anStandardizerConfigurationXmlReaderinstance with the given inputSteam with the configuration- Parameters:
inputStream- anInputStreaminstancefactory- the action factory to be used by the reader
-
-
Method Details
-
getConfiguration
Description copied from interface:StandardizerConfigurationReaderGets the configuration defined by the pre-set configuration file.- Specified by:
getConfigurationin interfaceStandardizerConfigurationReader- Returns:
- the
StandardizerConfigurationinstance - Throws:
IllegalArgumentException
-
setPath
Description copied from interface:StandardizerConfigurationReaderSets the base path of the configuration. External references within the configuration file mist be based on the path set with this method.- Specified by:
setPathin interfaceStandardizerConfigurationReader- Parameters:
path- the base path of the configuration
-
isValidXMLConfiguration
Checks whether the contents of the provided input stream is a valid configuration XML- Parameters:
inputStream- the input stream containing the configuration- Returns:
- true if valid configuration, false otherwise
-