|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.rapidminer.tools.OperatorService
public class OperatorService
This class reads the description of the RapidMiner operators. These descriptions are entries in a XML File like:
<operators>
<operator
name="OperatorName"
class="java.path.OperatorClass"
description="OperatorDescription"
deprecation="OperatorDeprecationInfo"
group="OperatorGroup"
icon="OperatorIcon"
/>
The values (and the whole tag) for deprecation and icon might be omitted. If no deprecation info was specified, the operator is simply not deprecated. If no icon is specified, RapidMiner just uses the icon of the parent group.
NOTE: This class should be used to create operators and is therefore an operator factory.
| Field Summary | |
|---|---|
static java.lang.String |
MAIN_OPERATORS_NAME
|
| Constructor Summary | |
|---|---|
OperatorService()
|
|
| Method Summary | ||
|---|---|---|
static
|
createOperator(java.lang.Class<T> clazz)
Use this method to create an operator from an operator class. |
|
static Operator |
createOperator(OperatorDescription description)
Use this method to create an operator of a given description object. |
|
static Operator |
createOperator(java.lang.String typeName)
Use this method to create an operator from the given class name (from operator description file operators.xml, not from the Java class name). |
|
static void |
defineXMLAliasPairs()
Defines the alias pairs for the XMLSerialization for all IOObject pairs. |
|
static GroupTree |
getGroups()
Returns the group hierarchy of all operators. |
|
static java.lang.Class<IOObject> |
getIOObjectClass(java.lang.String name)
Returns the class for the short name of an IO object. |
|
static java.util.Set<java.lang.String> |
getIOObjectsNames()
Returns a sorted set of all short IO object names. |
|
static java.net.URL |
getMainOperators()
Returns the main operator description file (XML). |
|
static OperatorDescription |
getOperatorDescription(java.lang.String completeName)
Returns the operator description for a given class name from the operators.xml file, e.g. |
|
static OperatorDescription[] |
getOperatorDescriptions(java.lang.Class clazz)
Returns the operator descriptions for the operators which uses the given class. |
|
static java.util.Set<java.lang.String> |
getOperatorNames()
Returns a collection of all operator names. |
|
static java.util.Set<OperatorDescription> |
getOperatorsDelivering(java.lang.Class ioObject)
Returns a collection of all operator descriptions of operators which return the desired IO object as output. |
|
static java.util.Set<OperatorDescription> |
getOperatorsRequiring(java.lang.Class ioObject)
Returns a collection of all operator descriptions which requires the given IO object as input. |
|
static void |
registerOperator(OperatorDescription description)
Registers the given operator description. |
|
static void |
registerOperators(java.lang.String name,
java.io.InputStream operatorsXML,
java.lang.ClassLoader classLoader,
boolean addWekaOperators)
Registers all operators from a given XML input stream. |
|
static void |
reloadIcons()
Reload all icons, e.g. after a look and feel change. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String MAIN_OPERATORS_NAME
| Constructor Detail |
|---|
public OperatorService()
| Method Detail |
|---|
public static java.net.URL getMainOperators()
public static void registerOperators(java.lang.String name,
java.io.InputStream operatorsXML,
java.lang.ClassLoader classLoader,
boolean addWekaOperators)
public static void registerOperator(OperatorDescription description)
throws java.lang.Exception
java.lang.Exceptionpublic static java.util.Set<java.lang.String> getIOObjectsNames()
public static void defineXMLAliasPairs()
XMLSerialization for all IOObject pairs.
public static java.util.Set<OperatorDescription> getOperatorsDelivering(java.lang.Class ioObject)
public static java.util.Set<OperatorDescription> getOperatorsRequiring(java.lang.Class ioObject)
public static java.lang.Class<IOObject> getIOObjectClass(java.lang.String name)
public static java.util.Set<java.lang.String> getOperatorNames()
public static GroupTree getGroups()
public static void reloadIcons()
public static OperatorDescription[] getOperatorDescriptions(java.lang.Class clazz)
public static OperatorDescription getOperatorDescription(java.lang.String completeName)
public static Operator createOperator(java.lang.String typeName)
throws OperatorCreationException
createOperator(Class) which can be checked during compile time.
This is, however, not possible for some generic operators like the
Weka operators. In that case, you have to use this method with the
argument from the operators.xml file, e.g. createOperator("J48")
for a J48 decision tree learner.
OperatorCreationException
public static Operator createOperator(OperatorDescription description)
throws OperatorCreationException
OperatorCreationException
public static <T extends Operator> T createOperator(java.lang.Class<T> clazz)
throws OperatorCreationException
Use this method to create an operator from an operator class. This is the only method which ensures operator existence checks during compile time (and not during runtime) and the usage of this method is therefore the recommended way for operator creation.
It is, however, not possible to create some generic operators
with this method (this mainly applies to the Weka operators). Please
use the method createOperator(String) for those generic
operators.
If you try to create a generic operator with this method, the OperatorDescription will not be unique for the given class and an OperatorCreationException is thrown.
Please note that is is not necessary to cast the operator to the desired class.
TODO: can we remove the supress warning here?
OperatorCreationException
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||