Class DefaultOperatorDescriptor

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

public class DefaultOperatorDescriptor extends Object implements OperatorDescriptor
Default implementation of the OperatorDescriptor interface.
Since:
BEAM 5
  • Constructor Details

    • DefaultOperatorDescriptor

      public DefaultOperatorDescriptor(String name, Class<? extends Operator> operatorClass)
  • Method Details

    • 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.
    • 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.
    • fromXml

      public static DefaultOperatorDescriptor 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 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 the operatorClass tag.
      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 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.