Class ToolAdapterOperatorDescriptor

java.lang.Object
org.esa.snap.core.gpf.descriptor.ToolAdapterOperatorDescriptor
All Implemented Interfaces:
ElementDescriptor, OperatorDescriptor

public class ToolAdapterOperatorDescriptor extends Object implements OperatorDescriptor
Operator descriptor class for ToolAdapterOp.
  • Field Details

  • Constructor Details

    • ToolAdapterOperatorDescriptor

      public ToolAdapterOperatorDescriptor(String name, Class<? extends Operator> operatorClass)
    • ToolAdapterOperatorDescriptor

      public ToolAdapterOperatorDescriptor(String name, Class<? extends Operator> operatorClass, String alias, String label, String version, String description, String authors, String copyright, String menuLocation)
    • ToolAdapterOperatorDescriptor

      public ToolAdapterOperatorDescriptor(ToolAdapterOperatorDescriptor obj)
      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 copied
      newName - The new name of the operator
      newAlias - The new alias of the operator
  • Method Details

    • removeParamDescriptor

      public void removeParamDescriptor(ToolParameterDescriptor descriptor)
      Removes the given parameter descriptor from the internal parameter descriptor list
      Parameters:
      descriptor - The descriptor to be removed
    • removeParamDescriptors

      public void removeParamDescriptors(List<ToolParameterDescriptor> descriptors)
      Removes the given descriptors from the internal parameter descriptor list
      Parameters:
      descriptors - The list of descriptors to be removed
    • getToolParameterDescriptors

      public List<ToolParameterDescriptor> getToolParameterDescriptors()
      Gets all the parameter descriptors
      Returns:
      The list of parameter descriptors
    • getTemplateEngine

      public TemplateEngine getTemplateEngine()
    • setAlias

      public void setAlias(String alias)
      Setter for the Alias field
    • setLabel

      public void setLabel(String label)
      Setter for the Label field
    • seVersion

      public void seVersion(String version)
      Setter for the Version field
    • setDescription

      public void setDescription(String description)
      Setter for the Description field
    • setAuthors

      public void setAuthors(String authors)
      Setter for the Authors field
    • setCopyright

      public void setCopyright(String copyright)
      Setter for the Copyright field
    • setName

      public void setName(String name)
      Setter for the Name field
    • setOperatorClass

      public void setOperatorClass(Class<? extends Operator> operatorClass)
      Setter for the operator class
    • getVersion

      public String getVersion()
      Specified by:
      getVersion in interface OperatorDescriptor
      Returns:
      The version of the operator, or null if not declared.
    • getAuthors

      public String getAuthors()
      Specified by:
      getAuthors in interface OperatorDescriptor
      Returns:
      The author(s) of the operator, or null if not declared.
    • getCopyright

      public String getCopyright()
      Specified by:
      getCopyright in interface OperatorDescriptor
      Returns:
      The copyright notice for the operator code, or null if not declared.
    • isInternal

      public boolean isInternal()
      Specified by:
      isInternal in interface OperatorDescriptor
      Returns:
      If true, this operator is considered for internal use only and thus may not be exposed in user interfaces. The default is false.
    • isAutoWriteDisabled

      public boolean isAutoWriteDisabled()
      Description copied from interface: OperatorDescriptor
      The 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 autoWriteDisabled property 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 Product and/or if it does its own outputting of non-Product targets to external files.

      Specified by:
      isAutoWriteDisabled in interface OperatorDescriptor
      Returns:
      If true, the framework will prevent automatic writing of the target product to the file system.
    • getName

      public String getName()
      Specified by:
      getName in interface ElementDescriptor
      Returns:
      The symbolic name used to unambiguously identify this element. E.g. the fully qualified name of a Java class.
    • getAlias

      public String getAlias()
      Specified by:
      getAlias in interface ElementDescriptor
      Returns:
      A short form of the symbolic name, or null if not declared.
    • getLabel

      public String getLabel()
      Specified by:
      getLabel in interface ElementDescriptor
      Returns:
      A human-readable version of the symbolic name to be used in user interfaces, or null if not declared.
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface ElementDescriptor
      Returns:
      A short description, or null if not declared.
    • getMenuLocation

      public String getMenuLocation()
      Getter for the Menu Location field
    • setMenuLocation

      public void setMenuLocation(String value)
      Setter for the Menu Location field
    • getSource

      public String getSource()
      Getter for the source of the descriptor. The source can be either "package" (coming from a nbm package) or "user" (user-defined).
    • setSource

      public void setSource(String value)
      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

      public String getHelpID()
    • setHelpID

      public void setHelpID(String value)
    • getOperatorClass

      public Class<? extends Operator> getOperatorClass()
      Specified by:
      getOperatorClass in interface OperatorDescriptor
      Returns:
      The operator implementation class.
    • getSourceProductDescriptors

      public SourceProductDescriptor[] getSourceProductDescriptors()
      Specified by:
      getSourceProductDescriptors in interface OperatorDescriptor
      Returns:
      The source product descriptors. The array will be empty if the operator does not have any source products.
    • getSourceProductsDescriptor

      public SourceProductsDescriptor getSourceProductsDescriptor()
      Specified by:
      getSourceProductsDescriptor in interface OperatorDescriptor
      Returns:
      The source products descriptor, or null if none is declared.
    • getParameterDescriptors

      public ParameterDescriptor[] getParameterDescriptors()
      Specified by:
      getParameterDescriptors in interface OperatorDescriptor
      Returns:
      The parameter descriptors. The array will be empty if the operator does not have any parameters.
    • getTargetPropertyDescriptors

      public TargetPropertyDescriptor[] getTargetPropertyDescriptors()
      Specified by:
      getTargetPropertyDescriptors in interface OperatorDescriptor
      Returns:
      The target property descriptors. The array will be empty if the operator does not produce any target properties.
    • getTargetProductDescriptor

      public TargetProductDescriptor getTargetProductDescriptor()
      Specified by:
      getTargetProductDescriptor in interface OperatorDescriptor
      Returns:
      The target product descriptor, or null if none is declared.
    • getTemplate

      public FileTemplate getTemplate()
      Getter for the Template File Location field
    • setTemplate

      public void setTemplate(FileTemplate value) throws TemplateException
      Setter for the Template File Location field
      Throws:
      TemplateException
    • getWorkingDir

      public String getWorkingDir()
      Getter for the Working Directory field
    • setWorkingDir

      public void setWorkingDir(String workingDir)
      Setter for the Working Directory field
    • getMainToolFileLocation

      public String getMainToolFileLocation()
      Getter for the Tool File Location field
    • setMainToolFileLocation

      public void setMainToolFileLocation(String mainToolFileLocation)
      Setter for the Tool File Location field
    • resolveVariables

      public File resolveVariables(String location)
    • resolveVariables

      public File resolveVariables(File file)
    • setProgressPattern

      public void setProgressPattern(String pattern)
      Setter for the Progress Pattern field. The pattern is a regular expression.
    • getProgressPattern

      public String getProgressPattern()
      Getter for the Progress Pattern field
    • setErrorPattern

      public void setErrorPattern(String pattern)
      Setter for the Error Pattern field. The pattern is a regular expression.
    • getErrorPattern

      public String getErrorPattern()
      Getter for the Error Pattern field
    • setStepPattern

      public void setStepPattern(String pattern)
      Setter for the Step progress Pattern field. The pattern is a regular expression.
    • getStepPattern

      public String getStepPattern()
      Getter for the Step progress Pattern field
    • getProcessingWriter

      public String getProcessingWriter()
      Getter for the Pre-processing Writer field
    • setProcessingWriter

      public void setProcessingWriter(String processingWriter)
      Setter for the Pre-processing Writer field
    • shouldWriteBeforeProcessing

      public Boolean shouldWriteBeforeProcessing()
      Getter for the Write Before Processing field
    • writeBeforeProcessing

      public void writeBeforeProcessing(Boolean writeForProcessing)
      Setter for the Write Before Processing field
    • getPreprocessorExternalTool

      public String getPreprocessorExternalTool()
      Getter for the Pre-processing External Tool field
    • setPreprocessorExternalTool

      public void setPreprocessorExternalTool(String preprocessorExternalTool)
      Setter for the Pre-processing External Tool field
    • getPreprocessTool

      public Boolean getPreprocessTool()
      Getter for the Has Pre-processing External Tool field
    • setPreprocessTool

      public void setPreprocessTool(Boolean preprocessTool)
      Setter for the Has Pre-processing External Tool field
    • getWindowsBundle

      public Bundle getWindowsBundle()
    • setWindowsBundle

      public void setWindowsBundle(Bundle bundle)
    • getLinuxBundle

      public Bundle getLinuxBundle()
    • setLinuxBundle

      public void setLinuxBundle(Bundle bundle)
    • getMacosxBundle

      public Bundle getMacosxBundle()
    • setMacosxBundle

      public void setMacosxBundle(Bundle bundle)
    • getBundle

      public Bundle getBundle()
    • setBundles

      public void setBundles(Map<OSFamily,Bundle> bundles)
    • getBundles

      public Map<OSFamily,Bundle> getBundles()
    • getBundle

      public Bundle getBundle(OSFamily osFamily)
    • getVariables

      public List<SystemVariable> getVariables()
      Gets the list of user-defined system variables
    • getVariableValue

      public String getVariableValue(String key)
    • 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 the sourceProductDescriptors array. This is useful in the execution dialog, because it dictates how many selectors should be rendered.
    • addVariable

      public void addVariable(SystemVariable variable)
      Adds a user-defined system variable
      Parameters:
      variable - The variable to be added
    • createCopy

      public ToolAdapterOperatorDescriptor createCopy()
      Creates a deep copy of this operator.
    • fromXml

      public static ToolAdapterOperatorDescriptor fromXml(URL url, ClassLoader classLoader)
      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 the operatorClass tag.
      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 the operatorClass tag.
      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 messages
      classLoader - The class loader is used to load classed specified in the xml. For example the class defined by the operatorClass tag.
      Returns:
      A new operator descriptor.
      Throws:
      OperatorException
    • toXml

      public String toXml(ClassLoader classLoader)
      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 the operatorClass tag.
      Returns:
      A string containing valid operator descriptor XML.