Class UnknownBinaryUnit

All Implemented Interfaces:
IUnitCreator, IUserDataSupport, IBinaryUnit, IUnit, IEventSource

@Ser public class UnknownBinaryUnit extends AbstractBinaryUnit
The fallback unit created if all parsers have failed at identifying some input data.
  • Constructor Details

    • UnknownBinaryUnit

      public UnknownBinaryUnit(String name, IInput input, IUnitProcessor unitProcessor, IUnitCreator parent, IPropertyDefinitionManager pdm)
      Create an unknown binary unit.
      Parameters:
      name - unit name
      input - binary input
      unitProcessor - unit processor
      parent - parent unit or artifact
      pdm - property definition manager
  • Method Details

    • process

      public boolean process()
      Description copied from class: AbstractUnit
      The default implementation calls AbstractUnit.processInternal(), and makes sure that a status string is set on error, or nullified on success. processInternal() is never called is AbstractUnit.isProcessed() returns true.

      Plugins may decide to override this method, if they need finer control over processing (we recommend overriding processInternal(); in that case, processInternal() should be ignored.

      Specified by:
      process in interface IUnit
      Overrides:
      process in class AbstractUnit
      Returns:
      true if processing is or was successful (in the latter case, process() should do nothing but return true), or false is processing failed. The unit should also notify clients by issuing a J.UnitProcessed event. If processing succeeded, subsequent calls to IUnit.isProcessed() should return true.
    • setHintWantedType

      public void setHintWantedType(String hintWantedType)
      Set the wanted type hint used when retrying processing.
      Parameters:
      hintWantedType - wanted unit type
    • getKnownUnit

      public IUnit getKnownUnit()
      Retrieve the known replacement unit, if this unknown unit was replaced during processing.
      Returns:
      the known unit, or null if none