Class StandardizerXMLReader
- java.lang.Object
-
- chemaxon.standardizer.configuration.reader.StandardizerXMLReader
-
- All Implemented Interfaces:
StandardizerConfigurationReader
@PublicAPI public class StandardizerXMLReader extends Object implements StandardizerConfigurationReader
XML Configuration reader for standardizer configurations.
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
StandardizerActionStringReader.setPath(String)
before getting the configuration. 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-tag, however the basis of the configuration can be viewed in the default configuration
file, that contains no action definition.
- Since:
- 5.11
-
-
Field Summary
-
Fields inherited from interface chemaxon.standardizer.configuration.reader.StandardizerConfigurationReader
DEFAULT_STANDARDIZERS_CONFIG_PATH, USER_STANDARDIZERS_CONFIG_PATH
-
-
Constructor Summary
Constructors Constructor Description StandardizerXMLReader(InputStream inputStream)
Initiate anStandardizerXMLReader
instance with the given inputSteam with the configurationStandardizerXMLReader(InputStream inputStream, StandardizerActionFactory factory)
Initiate anStandardizerXMLReader
instance with the given inputSteam with the configuration
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StandardizerConfiguration
getConfiguration()
Gets the configuration defined by the pre-set configuration file.static boolean
isValidXMLConfiguration(InputStream inputStream)
Checks whether the contents of the provided input stream is a valid configuration XMLvoid
setPath(String path)
Sets the base path of the configuration.
-
-
-
Constructor Detail
-
StandardizerXMLReader
public StandardizerXMLReader(InputStream inputStream)
Initiate anStandardizerXMLReader
instance with the given inputSteam with the configuration- Parameters:
inputStream
- anInputStream
instance
-
StandardizerXMLReader
public StandardizerXMLReader(InputStream inputStream, StandardizerActionFactory factory)
Initiate anStandardizerXMLReader
instance with the given inputSteam with the configuration- Parameters:
inputStream
- anInputStream
instancefactory
- the action factory to be used by the reader
-
-
Method Detail
-
getConfiguration
public StandardizerConfiguration getConfiguration() throws IllegalArgumentException
Description copied from interface:StandardizerConfigurationReader
Gets the configuration defined by the pre-set configuration file.- Specified by:
getConfiguration
in interfaceStandardizerConfigurationReader
- Returns:
- the
StandardizerConfiguration
instance which can be run by aStandardizerActionRunner
instance - Throws:
IllegalArgumentException
-
setPath
public void setPath(String path)
Description copied from interface:StandardizerConfigurationReader
Sets the base path of the configuration. External references within the configuration file mist be based on the path set with this method.- Specified by:
setPath
in interfaceStandardizerConfigurationReader
- Parameters:
path
- the base path of the configuration
-
isValidXMLConfiguration
public static boolean isValidXMLConfiguration(InputStream inputStream)
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
-
-