@PublicAPI public class StandardizerActionFactory extends java.lang.Object
StandardizerAction
objects DEFAULT_CONFIGURATION_SCHEMA
:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="configuration">
<xsd:complexType>
<xsd:sequence maxOccurs="1" minOccurs="1">
<xsd:element name="bundle">
<xsd:complexType>
<xsd:attribute name="base" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="standardizer-action-list">
<xsd:complexType>
<xsd:sequence maxOccurs="unbounded" minOccurs="0">
<xsd:element name="standardizer-action">
<xsd:complexType>
<xsd:attribute name="id" type="xsd:string" use="required"/>
<xsd:attribute name="class" type="xsd:string" use="required"/>
<xsd:attribute name="editor-class" type="xsd:string" use="optional"/>
<xsd:attribute name="jar" type="xsd:string" use="optional"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
getAvailableStandardizerActions()
or,getStandardizerAction(String, Map)
, however
with this functionality the action can be initialized with special
parameters.StandardizerActionFactory.Builder builder = new StandardizerActionFactory.Builder(); builder.add(StandardizerTest.class.getResourceAsStream(StandardizerActionFactory.DEFAULT_CONFIGURATION_PATH)); try { builder.add(DotfileUtil.open(StandardizerActionFactory.USER_DEFINED_STANDARDIZERCONFIG_XML)); } catch (IOException e) { // no user defined standardizer configuration found } builder.add(StandardizerTest.class.getResourceAsStream(StandardizerActionFactory.PRE_CONFIGURED_TRANSFORMATIONS)); StandardizerActionFactory factory = builder.build();
Modifier and Type | Class and Description |
---|---|
static class |
StandardizerActionFactory.Builder
Builder class for
StandardizerActionFactory . |
static class |
StandardizerActionFactory.StandardizerClassDescriptor
Descriptor of a standardizer class
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT
default factory id
|
static java.lang.String |
DEFAULT_CONFIGURATION_PATH
ChemAxon's default standardizer action configuration path
|
static java.lang.String |
DEFAULT_CONFIGURATION_SCHEMA
ChemAxon's default standardizer action configuration file schema path
|
static java.lang.String |
PRE_CONFIGURED_TRANSFORMATIONS
Pre-configured transformation configuration path
|
static java.lang.String |
STANDARDIZERCONFIG_XML
ChemAxon's default standardizer action configuration file name
|
static java.lang.String |
USER_DEFINED_STANDARDIZERCONFIG_XML
Users standardizer action configuration file name
|
Constructor and Description |
---|
StandardizerActionFactory()
Default constructor.
|
StandardizerActionFactory(java.lang.String path,
java.lang.String externalPath)
With this constructor inner and external configuration location can be
defined.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<StandardizerAction> |
getAvailableStandardizerActions()
Returns the list of standardizer actions that are available
|
StandardizerAction |
getStandardizerAction(java.lang.String standardizerActionId,
java.util.Map<java.lang.String,java.lang.String> params)
This method creates a requested (type represented in actionId)
StandardizerAction instance with the give parameters |
void |
writeConfiguration(java.io.OutputStream outputstream)
Writes the factory configuration to the output stream
|
public static final java.lang.String STANDARDIZERCONFIG_XML
public static final java.lang.String USER_DEFINED_STANDARDIZERCONFIG_XML
public static final java.lang.String DEFAULT_CONFIGURATION_PATH
public static final java.lang.String PRE_CONFIGURED_TRANSFORMATIONS
public static final java.lang.String DEFAULT_CONFIGURATION_SCHEMA
public static final java.lang.String DEFAULT
public StandardizerActionFactory()
DEFAULT_CONFIGURATION_PATH
, and the
USER_DEFINED_STANDARDIZERCONFIG_XML
will be read, the default
list of Standardizer Actions will be reachable by the factorypublic StandardizerActionFactory(java.lang.String path, java.lang.String externalPath)
path
- the location of the configuration XML for the inner
standardizer action classesexternalPath
- the location of the configuration XML for the external
standardizer action classespublic java.util.List<StandardizerAction> getAvailableStandardizerActions()
public StandardizerAction getStandardizerAction(java.lang.String standardizerActionId, java.util.Map<java.lang.String,java.lang.String> params)
StandardizerAction
instance with the give parametersstandardizerActionId
- the Id of the standardizer actionparams
- is a Map
contains String
pairs representing a
property bag should be passed to the standardizer action
instanceStandardizerAction
instancepublic void writeConfiguration(java.io.OutputStream outputstream)
outputstream
- the target output stream