Package org.openrefine.operations
Class UnknownOperation
- java.lang.Object
-
- org.openrefine.operations.UnknownOperation
-
- All Implemented Interfaces:
Operation
public class UnknownOperation extends Object implements Operation
An operation that is unknown to the current OpenRefine instance, but might be interpretable by another instance (for instance, a later version of OpenRefine, or using an extension). This class holds the JSON serialization of the operation, in the interest of being able to serialize it later, hence avoiding to discard it and lose metadata.
-
-
Constructor Summary
Constructors Constructor Description UnknownOperation(String opCode, String description)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChangeResult
apply(Grid projectState, ChangeContext context)
Derives the new grid state from the current grid state.Map<String,Object>
getAttributes()
String
getDescription()
A short human-readable description of what this operation does.String
getOperationId()
void
setAttribute(String key, Object value)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openrefine.operations.Operation
isReproducible
-
-
-
-
Method Detail
-
getOperationId
public String getOperationId()
- Specified by:
getOperationId
in interfaceOperation
-
apply
public ChangeResult apply(Grid projectState, ChangeContext context) throws OperationException
Description copied from interface:Operation
Derives the new grid state from the current grid state. Executing this method should be quick (even on large datasets) since it is expected to just derive the new grid from the existing one without actually executing any expensive computation. Long-running computations should rather go in the derivation of aChangeData
which will be fetched asynchronously.- Specified by:
apply
in interfaceOperation
- Parameters:
projectState
- the state of the grid before the change- Returns:
- an object which bundles up various pieces of information produced by the operation: primarily, the new grid after applying the operation. This object can be subclassed to expose more information, which should be serializable with Jackson so that it reaches the frontend.
- Throws:
OperationException
- when the change cannot be applied to the given grid
-
getDescription
public String getDescription()
Description copied from interface:Operation
A short human-readable description of what this operation does.- Specified by:
getDescription
in interfaceOperation
-
-