Package org.esa.snap.core.gpf.descriptor
Class DefaultOperatorDescriptor
java.lang.Object
org.esa.snap.core.gpf.descriptor.DefaultOperatorDescriptor
- All Implemented Interfaces:
ElementDescriptor,OperatorDescriptor
Default implementation of the
OperatorDescriptor interface.- Since:
- BEAM 5
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultOperatorDescriptor(String name, Class<? extends Operator> operatorClass) -
Method Summary
Modifier and TypeMethodDescriptionstatic DefaultOperatorDescriptorfromXml(File file, ClassLoader classLoader) Loads an operator descriptor from an XML document.static DefaultOperatorDescriptorfromXml(Reader reader, String resourceName, ClassLoader classLoader) Loads an operator descriptor from an XML document.static DefaultOperatorDescriptorfromXml(URL url, ClassLoader classLoader) Loads an operator descriptor from an XML document.getAlias()getLabel()getName()booleanThe GPF framework usually writes the target product of either single operators or processing graphs to the file system when executed from the GPT command-line interface or the operator GUI.booleantoXml(ClassLoader classLoader) Converts an operator descriptor to XML.
-
Constructor Details
-
DefaultOperatorDescriptor
-
-
Method Details
-
getVersion
- Specified by:
getVersionin interfaceOperatorDescriptor- Returns:
- The version of the operator, or
nullif not declared.
-
getAuthors
- Specified by:
getAuthorsin interfaceOperatorDescriptor- Returns:
- The author(s) of the operator, or
nullif not declared.
-
getCopyright
- Specified by:
getCopyrightin interfaceOperatorDescriptor- Returns:
- The copyright notice for the operator code, or
nullif not declared.
-
isInternal
public boolean isInternal()- Specified by:
isInternalin interfaceOperatorDescriptor- Returns:
- If
true, this operator is considered for internal use only and thus may not be exposed in user interfaces. The default isfalse.
-
isAutoWriteDisabled
public boolean isAutoWriteDisabled()Description copied from interface:OperatorDescriptorThe GPF framework usually writes the target product of either single operators or processing graphs to the file system when executed from the GPT command-line interface or the operator GUI.If the
autoWriteDisabledproperty is set, this default behaviour is switched off and hence, the operator or graph is responsible for outputting any computed results.Setting this property on an operator will only be useful, if it either does not generate a new target
Productand/or if it does its own outputting of non-Producttargets to external files.- Specified by:
isAutoWriteDisabledin interfaceOperatorDescriptor- Returns:
- If
true, the framework will prevent automatic writing of the target product to the file system.
-
getName
- Specified by:
getNamein interfaceElementDescriptor- Returns:
- The symbolic name used to unambiguously identify this element. E.g. the fully qualified name of a Java class.
-
getAlias
- Specified by:
getAliasin interfaceElementDescriptor- Returns:
- A short form of the symbolic name, or
nullif not declared.
-
getLabel
- Specified by:
getLabelin interfaceElementDescriptor- Returns:
- A human-readable version of the symbolic name to be used in user interfaces, or
nullif not declared.
-
getDescription
- Specified by:
getDescriptionin interfaceElementDescriptor- Returns:
- A short description, or
nullif not declared.
-
getOperatorClass
- Specified by:
getOperatorClassin interfaceOperatorDescriptor- Returns:
- The operator implementation class.
-
getSourceProductDescriptors
- Specified by:
getSourceProductDescriptorsin interfaceOperatorDescriptor- Returns:
- The source product descriptors. The array will be empty if the operator does not have any source products.
-
getSourceProductsDescriptor
- Specified by:
getSourceProductsDescriptorin interfaceOperatorDescriptor- Returns:
- The source products descriptor, or
nullif none is declared.
-
getParameterDescriptors
- Specified by:
getParameterDescriptorsin interfaceOperatorDescriptor- Returns:
- The parameter descriptors. The array will be empty if the operator does not have any parameters.
-
getTargetPropertyDescriptors
- Specified by:
getTargetPropertyDescriptorsin interfaceOperatorDescriptor- Returns:
- The target property descriptors. The array will be empty if the operator does not produce any target properties.
-
getTargetProductDescriptor
- Specified by:
getTargetProductDescriptorin interfaceOperatorDescriptor- Returns:
- The target product descriptor, or
nullif none is declared.
-
fromXml
Loads an operator descriptor from an XML document.- Parameters:
url- The URL pointing to a valid operator descriptor XML document.classLoader- The class loader is used to load classed specified in the xml. For example the class defined by theoperatorClasstag.- Returns:
- A new operator descriptor.
-
fromXml
public static DefaultOperatorDescriptor fromXml(File file, ClassLoader classLoader) throws OperatorException Loads an operator descriptor from an XML document.- Parameters:
file- The file containing a valid operator descriptor XML document.classLoader- The class loader is used to load classed specified in the xml. For example the class defined by theoperatorClasstag.- Returns:
- A new operator descriptor.
- Throws:
OperatorException
-
fromXml
public static DefaultOperatorDescriptor fromXml(Reader reader, String resourceName, ClassLoader classLoader) throws OperatorException Loads an operator descriptor from an XML document.- Parameters:
reader- The reader providing a valid operator descriptor XML document.resourceName- Used in error messagesclassLoader- The class loader is used to load classed specified in the xml. For example the class defined by theoperatorClasstag.- Returns:
- A new operator descriptor.
- Throws:
OperatorException
-
toXml
Converts an operator descriptor to XML.- Parameters:
classLoader- The class loader is used to load classed specified in the xml. For example the class defined by theoperatorClasstag.- Returns:
- A string containing valid operator descriptor XML.
-