Package org.esa.snap.core.gpf.descriptor
Class ToolAdapterOperatorDescriptor
java.lang.Object
org.esa.snap.core.gpf.descriptor.ToolAdapterOperatorDescriptor
- All Implemented Interfaces:
ElementDescriptor,OperatorDescriptor
Operator descriptor class for ToolAdapterOp.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionToolAdapterOperatorDescriptor(String name, Class<? extends Operator> operatorClass) ToolAdapterOperatorDescriptor(String name, Class<? extends Operator> operatorClass, String alias, String label, String version, String description, String authors, String copyright, String menuLocation) Copy constructorToolAdapterOperatorDescriptor(ToolAdapterOperatorDescriptor obj, String newName, String newAlias) Variant of the copy constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidaddVariable(SystemVariable variable) Adds a user-defined system variableCreates a deep copy of this operator.fromXml(File file, ClassLoader classLoader) Loads an operator descriptor from an XML document.fromXml(Reader reader, String resourceName, ClassLoader classLoader) Loads an operator descriptor from an XML document.fromXml(URL url, ClassLoader classLoader) Loads an operator descriptor from an XML document.getAlias()Getter for the Error Pattern fieldgetLabel()Getter for the Tool File Location fieldGetter for the Menu Location fieldgetName()Getter for the Pre-processing External Tool fieldGetter for the Has Pre-processing External Tool fieldGetter for the Pre-processing Writer fieldGetter for the Progress Pattern fieldGetter for the source of the descriptor.intReturns the number of source productsGetter for the Step progress Pattern fieldGetter for the Template File Location fieldGets all the parameter descriptorsGets the list of user-defined system variablesgetVariableValue(String key) Getter for the Working Directory fieldbooleanThe 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.booleanDetermines if the source of this descriptor is from a package or creadet/modified by user.booleanDetermines if the tool would produce by itself the name of the output product.booleanvoidremoveParamDescriptor(ToolParameterDescriptor descriptor) Removes the given parameter descriptor from the internal parameter descriptor listvoidremoveParamDescriptors(List<ToolParameterDescriptor> descriptors) Removes the given descriptors from the internal parameter descriptor listresolveVariables(File file) resolveVariables(String location) voidSetter for the Alias fieldvoidsetAuthors(String authors) Setter for the Authors fieldvoidsetBundles(Map<OSFamily, Bundle> bundles) voidsetCopyright(String copyright) Setter for the Copyright fieldvoidsetDescription(String description) Setter for the Description fieldvoidsetErrorPattern(String pattern) Setter for the Error Pattern field.voidsetHandlingOutputName(boolean value) Setter for the isHandlingOutputName member.voidvoidSetter for the Label fieldvoidsetLinuxBundle(Bundle bundle) voidsetMacosxBundle(Bundle bundle) voidsetMainToolFileLocation(String mainToolFileLocation) Setter for the Tool File Location fieldvoidsetMenuLocation(String value) Setter for the Menu Location fieldvoidSetter for the Name fieldvoidsetOperatorClass(Class<? extends Operator> operatorClass) Setter for the operator classvoidsetPreprocessorExternalTool(String preprocessorExternalTool) Setter for the Pre-processing External Tool fieldvoidsetPreprocessTool(Boolean preprocessTool) Setter for the Has Pre-processing External Tool fieldvoidsetProcessingWriter(String processingWriter) Setter for the Pre-processing Writer fieldvoidsetProgressPattern(String pattern) Setter for the Progress Pattern field.voidSetter for the Source field.voidsetSourceProductCount(int value) Sets the number of source products.voidsetStepPattern(String pattern) Setter for the Step progress Pattern field.voidsetTemplate(FileTemplate value) Setter for the Template File Location fieldvoidsetWindowsBundle(Bundle bundle) voidsetWorkingDir(String workingDir) Setter for the Working Directory fieldvoidSetter for the Version fieldGetter for the Write Before Processing fieldtoXml(ClassLoader classLoader) Converts an operator descriptor to XML.voidwriteBeforeProcessing(Boolean writeForProcessing) Setter for the Write Before Processing field
-
Field Details
-
SOURCE_PACKAGE
- See Also:
-
SOURCE_USER
- See Also:
-
annotatedClasses
-
-
Constructor Details
-
ToolAdapterOperatorDescriptor
-
ToolAdapterOperatorDescriptor
-
ToolAdapterOperatorDescriptor
Copy constructor- Parameters:
obj- The descriptor to be copied
-
ToolAdapterOperatorDescriptor
public ToolAdapterOperatorDescriptor(ToolAdapterOperatorDescriptor obj, String newName, String newAlias) Variant of the copy constructor- Parameters:
obj- The descriptor to be copiednewName- The new name of the operatornewAlias- The new alias of the operator
-
-
Method Details
-
removeParamDescriptor
Removes the given parameter descriptor from the internal parameter descriptor list- Parameters:
descriptor- The descriptor to be removed
-
removeParamDescriptors
Removes the given descriptors from the internal parameter descriptor list- Parameters:
descriptors- The list of descriptors to be removed
-
getToolParameterDescriptors
Gets all the parameter descriptors- Returns:
- The list of parameter descriptors
-
getTemplateEngine
-
setAlias
Setter for the Alias field -
setLabel
Setter for the Label field -
seVersion
Setter for the Version field -
setDescription
Setter for the Description field -
setAuthors
Setter for the Authors field -
setCopyright
Setter for the Copyright field -
setName
Setter for the Name field -
setOperatorClass
Setter for the operator class -
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.
-
getMenuLocation
Getter for the Menu Location field -
setMenuLocation
Setter for the Menu Location field -
getSource
Getter for the source of the descriptor. The source can be either "package" (coming from a nbm package) or "user" (user-defined). -
setSource
Setter for the Source field. -
isFromPackage
public boolean isFromPackage()Determines if the source of this descriptor is from a package or creadet/modified by user. -
isHandlingOutputName
public boolean isHandlingOutputName()Determines if the tool would produce by itself the name of the output product. -
setHandlingOutputName
public void setHandlingOutputName(boolean value) Setter for the isHandlingOutputName member. -
getHelpID
-
setHelpID
-
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.
-
getTemplate
Getter for the Template File Location field -
setTemplate
Setter for the Template File Location field- Throws:
TemplateException
-
getWorkingDir
Getter for the Working Directory field -
setWorkingDir
Setter for the Working Directory field -
getMainToolFileLocation
Getter for the Tool File Location field -
setMainToolFileLocation
Setter for the Tool File Location field -
resolveVariables
-
resolveVariables
-
setProgressPattern
Setter for the Progress Pattern field. The pattern is a regular expression. -
getProgressPattern
Getter for the Progress Pattern field -
setErrorPattern
Setter for the Error Pattern field. The pattern is a regular expression. -
getErrorPattern
Getter for the Error Pattern field -
setStepPattern
Setter for the Step progress Pattern field. The pattern is a regular expression. -
getStepPattern
Getter for the Step progress Pattern field -
getProcessingWriter
Getter for the Pre-processing Writer field -
setProcessingWriter
Setter for the Pre-processing Writer field -
shouldWriteBeforeProcessing
Getter for the Write Before Processing field -
writeBeforeProcessing
Setter for the Write Before Processing field -
getPreprocessorExternalTool
Getter for the Pre-processing External Tool field -
setPreprocessorExternalTool
Setter for the Pre-processing External Tool field -
getPreprocessTool
Getter for the Has Pre-processing External Tool field -
setPreprocessTool
Setter for the Has Pre-processing External Tool field -
getWindowsBundle
-
setWindowsBundle
-
getLinuxBundle
-
setLinuxBundle
-
getMacosxBundle
-
setMacosxBundle
-
getBundle
-
setBundles
-
getBundles
-
getBundle
-
getVariables
Gets the list of user-defined system variables -
getVariableValue
-
getSourceProductCount
public int getSourceProductCount()Returns the number of source products -
setSourceProductCount
public void setSourceProductCount(int value) Sets the number of source products. It re-dimensions internally thesourceProductDescriptorsarray. This is useful in the execution dialog, because it dictates how many selectors should be rendered. -
addVariable
Adds a user-defined system variable- Parameters:
variable- The variable to be added
-
createCopy
Creates a deep copy of this operator. -
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 ToolAdapterOperatorDescriptor 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 ToolAdapterOperatorDescriptor 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.
-