Package chemaxon.standardizer
Class StandardizerUtil
- java.lang.Object
-
- chemaxon.standardizer.StandardizerUtil
-
@PublicAPI public class StandardizerUtil extends Object
Utility class for standardizer
Functionalities of old standardizer can be simulated using this class.- Since:
- 5.11
-
-
Constructor Summary
Constructors Constructor Description StandardizerUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
addInactiveTasks(Standardizer standardizer, String configuration)
Adds the Standardizer tasks specified in theconfiguration
parameter to the inactive tasks list.static void
clearInactiveTasks(Standardizer standardizer)
Clears the inactive tasks list.static StandardizerConfigurationReader
initializeReader(String configuration)
Initializes a configuration reader based on a configuration stringstatic boolean
isLastTaskClean(Standardizer standardizer)
Returnstrue
if last task is clean or there are no tasks (final clean not needed before output to file).static boolean
removeInactiveTasks(Standardizer standardizer, String configuration)
Removes the Standardizer tasks specified in theconfiguration
parameter from the inactive tasks list.static void
setCleanTemplates(Standardizer standardizer, Molecule[] templates)
Sets the default clean templates.static void
setInactiveTasks(Standardizer standardizer, String configuration)
Sets the tasks with the provided ID inactive.
-
-
-
Method Detail
-
addInactiveTasks
public static boolean addInactiveTasks(Standardizer standardizer, String configuration) throws IllegalArgumentException
Adds the Standardizer tasks specified in theconfiguration
parameter to the inactive tasks list. Only the task type is checked. E.g. if "RemoveExplicitH" tasks are added, then these tasks are always inactivated regardless to the parameters (e.g.:Mapped="true"
) they use. Inactive tasks are not performed during standardization. To remove a task from the inactive task list useremoveInactiveTasks(Standardizer, String)
, to clear the inactive tasks list useclearInactiveTasks(Standardizer)
method. For internal use only.- Parameters:
standardizer
- the target standardizerconfiguration
- is the XML configuration string or else the simple config string, items separated by ".."- Returns:
true
if the inactive task list has changed- Throws:
IllegalArgumentException
- if the configuration string is invalid- See Also:
clearInactiveTasks(Standardizer)
,removeInactiveTasks(Standardizer, String)
-
removeInactiveTasks
public static boolean removeInactiveTasks(Standardizer standardizer, String configuration) throws IllegalArgumentException
Removes the Standardizer tasks specified in theconfiguration
parameter from the inactive tasks list. Only the task type is checked. For internal use only.- Parameters:
standardizer
- the target standardizerconfiguration
- is the XML configuration string or else the simple config string, items separated by ".."- Returns:
true
if the inactive task list has changed- Throws:
IllegalArgumentException
- if the configuration string is invalid- See Also:
setInactiveTasks(Standardizer, String)
,clearInactiveTasks(Standardizer)
-
setInactiveTasks
public static void setInactiveTasks(Standardizer standardizer, String configuration)
Sets the tasks with the provided ID inactive.- Parameters:
standardizer
- the target standardizerconfiguration
- the provided ID
-
clearInactiveTasks
public static void clearInactiveTasks(Standardizer standardizer)
Clears the inactive tasks list. For internal use only.- Parameters:
standardizer
- the target standardizer- See Also:
setInactiveTasks(Standardizer, String)
,removeInactiveTasks(Standardizer, String)
-
initializeReader
public static StandardizerConfigurationReader initializeReader(String configuration)
Initializes a configuration reader based on a configuration string- Parameters:
configuration
- the string representation of the configuration- Returns:
- the configuration reader for the provided configuration
-
isLastTaskClean
public static boolean isLastTaskClean(Standardizer standardizer)
Returnstrue
if last task is clean or there are no tasks (final clean not needed before output to file).- Parameters:
standardizer
- the target standardizer- Returns:
true
if last task is clean or there are no tasks
-
setCleanTemplates
public static void setCleanTemplates(Standardizer standardizer, Molecule[] templates)
Sets the default clean templates. Used in template based clean tasks that do not specify the template file:<Clean Type="TemplateBased"/>
"clean:tb"
- Parameters:
standardizer
- the target standardizer instancetemplates
- is the template molecule array
-
-