Class AbstractBinaryUnit

All Implemented Interfaces:
IUnitCreator, IUserDataSupport, IBinaryUnit, IUnit, IEventSource
Direct Known Subclasses:
AbstractCodeObjectUnit, AbstractInteractiveBinaryUnit, UnknownBinaryUnit

@Ser public abstract class AbstractBinaryUnit extends AbstractUnit implements IBinaryUnit
This extension class provides basic implementations for methods specific to binary units.

Implementors must implement their own constructor; the default constructor is used for deserialization only. Example of a typical binary unit constructor:

 public DerivedClass(String name, IInput input, IUnitProcessor unitProcessor, IUnitCreator parent,
         IPropertyDefinitionManager pdm) {
     super(..., input, ..., name, unitProcessor, parent, pdm);
     ...
 }
 
  • Constructor Details

    • AbstractBinaryUnit

      protected AbstractBinaryUnit(String mimeType, IInput input, String formatType, String name, IUnit parent)
      Create a binary unit using the parent unit's processor and property definitions.
      Parameters:
      mimeType - MIME type; defaults to application/octet-stream if null or empty
      input - mandatory binary input
      formatType - unit format type
      name - unit name
      parent - parent unit
    • AbstractBinaryUnit

      protected AbstractBinaryUnit(String mimeType, IInput input, String formatType, String name, IUnitProcessor unitProcessor, IUnitCreator parent, IPropertyDefinitionManager pdm)
      Create a binary unit.
      Parameters:
      mimeType - MIME type; defaults to application/octet-stream if null or empty
      input - mandatory binary input
      formatType - unit format type
      name - unit name
      unitProcessor - unit processor
      parent - parent unit or artifact
      pdm - property definition manager
  • Method Details

    • getMimeType

      public String getMimeType()
      The default implementation returns the MIME type provided to the constructor.
      Specified by:
      getMimeType in interface IBinaryUnit
      Returns:
      optional content-type
    • setMimeType

      public void setMimeType(String mimeType)
      Set the MIME type.
      Parameters:
      mimeType - MIME type
    • getInput

      public IInput getInput()
      The default implementation returns the input provided to the constructor.
      Specified by:
      getInput in interface IBinaryUnit
      Specified by:
      getInput in interface IUnit
      Specified by:
      getInput in interface IUnitCreator
      Returns:
      a mandatory input object
    • setInput

      public void setInput(IInput input)
      Set the binary input.
      Parameters:
      input - binary input