Package com.pnfsoftware.jeb.core.units
Class UnknownBinaryUnit
java.lang.Object
com.pnfsoftware.jeb.core.events.JebEventSource
com.pnfsoftware.jeb.core.units.AbstractUnit
com.pnfsoftware.jeb.core.units.AbstractBinaryUnit
com.pnfsoftware.jeb.core.units.UnknownBinaryUnit
- All Implemented Interfaces:
IUnitCreator,IUserDataSupport,IBinaryUnit,IUnit,IEventSource
The fallback unit created if all parsers have failed at identifying some input data.
-
Field Summary
Fields inherited from class com.pnfsoftware.jeb.core.events.JebEventSource
onEventCallCount -
Constructor Summary
ConstructorsConstructorDescriptionUnknownBinaryUnit(String name, IInput input, IUnitProcessor unitProcessor, IUnitCreator parent, IPropertyDefinitionManager pdm) Create an unknown binary unit. -
Method Summary
Modifier and TypeMethodDescriptionRetrieve the known replacement unit, if this unknown unit was replaced during processing.booleanprocess()The default implementation callsAbstractUnit.processInternal(), and makes sure that a status string is set on error, or nullified on success.voidsetHintWantedType(String hintWantedType) Set the wanted type hint used when retrying processing.Methods inherited from class com.pnfsoftware.jeb.core.units.AbstractBinaryUnit
getInput, getMimeType, setInput, setMimeTypeMethods inherited from class com.pnfsoftware.jeb.core.units.AbstractUnit
addChild, addChild, addChild, addNotification, canBePersisted, clearAllData, dispose, finalize, generateQuickState, getAllData, getChildren, getContributions, getCreationTimestamp, getData, getDescription, getFormatter, getFormatType, getIconData, getInterpreters, getLock, getName, getNotes, getNotificationManager, getParent, getPropertyDefinitionManager, getPropertyManager, getRealName, getStatus, getUid, getUnitProcessor, hasChildren, initializePropertyObjects, internalSwapChildren, isDeserialized, isDisposed, isProcessed, isStale, isTransientChild, logError, logException, logInfo, logTrace, logWarn, onPropertyChange, postDeserialization, processInternal, removeChild, removeChild, setChild, setChild, setData, setName, setNotes, setParent, setProcessed, setProcessed, setRealName, setStatus, setStatus, setUnitProcessor, toStringMethods inherited from class com.pnfsoftware.jeb.core.events.JebEventSource
addListener, countListeners, getListeners, getParentSource, insertListener, notifyListeners, notifyListeners, notifyListeners, removeListener, setParentSourceMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.pnfsoftware.jeb.util.events.IEventSource
addListener, countListeners, getListeners, getParentSource, insertListener, notifyListeners, removeListener, setParentSourceMethods inherited from interface com.pnfsoftware.jeb.core.units.IUnit
addChild, addChild, canBePersisted, dispose, execprvfunc, generateQuickState, getChildren, getContributions, getCreationTimestamp, getDescription, getExtraInputs, getFormatter, getFormatType, getIconData, getInterpreters, getLock, getName, getNotes, getNotificationManager, getParent, getParentArtifact, getParentProject, getPropertyDefinitionManager, getPropertyManager, getRealName, getStatus, getUid, getUnitProcessor, initializePropertyObjects, isDisposed, isProcessed, isStale, isTransientChild, notifyGenericChange, postDeserialization, removeChild, setName, setNotes, setParent, setRealName, setUnitProcessorMethods inherited from interface com.pnfsoftware.jeb.core.IUserDataSupport
clearAllData, getAllData, getData, setData
-
Constructor Details
-
UnknownBinaryUnit
public UnknownBinaryUnit(String name, IInput input, IUnitProcessor unitProcessor, IUnitCreator parent, IPropertyDefinitionManager pdm) Create an unknown binary unit.- Parameters:
name- unit nameinput- binary inputunitProcessor- unit processorparent- parent unit or artifactpdm- property definition manager
-
-
Method Details
-
process
public boolean process()Description copied from class:AbstractUnitThe default implementation callsAbstractUnit.processInternal(), and makes sure that a status string is set on error, or nullified on success. processInternal() is never called isAbstractUnit.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:
processin interfaceIUnit- Overrides:
processin classAbstractUnit- 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.UnitProcessedevent. If processing succeeded, subsequent calls toIUnit.isProcessed()should return true.
-
setHintWantedType
Set the wanted type hint used when retrying processing.- Parameters:
hintWantedType- wanted unit type
-
getKnownUnit
Retrieve the known replacement unit, if this unknown unit was replaced during processing.- Returns:
- the known unit, or null if none
-