Package org.scijava.script.process
Class DirectiveScriptProcessor
- java.lang.Object
-
- org.scijava.script.process.DirectiveScriptProcessor
-
- All Implemented Interfaces:
SciJavaPlugin,ScriptProcessor
- Direct Known Subclasses:
ScriptDirectiveScriptProcessor
public abstract class DirectiveScriptProcessor extends Object implements ScriptProcessor
Abstract base class forScriptProcessorplugins that parse lines of the form#@directive(...) ....- Author:
- Curtis Rueden
-
-
Constructor Summary
Constructors Constructor Description DirectiveScriptProcessor(Predicate<String> directivesToMatch)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected <T> Tas(Object v, Class<T> type)Coerces some object into another object of the given type.protected <T> List<T>asList(Object v, Class<T> type)Coerces some object into a list of objects of the given type.voidbegin(ScriptInfo scriptInfo)protected ScriptInfoinfo()Gets the activeScriptInfoinstance.protected booleanis(String key, String desired)Checks whether some key matches the desired value, ignoring case.Stringprocess(String line)protected abstract Stringprocess(String directive, Map<String,Object> attrs, String theRest)Processes the given directive.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.scijava.script.process.ScriptProcessor
end
-
-
-
-
Method Detail
-
begin
public void begin(ScriptInfo scriptInfo)
- Specified by:
beginin interfaceScriptProcessor
-
process
public String process(String line)
- Specified by:
processin interfaceScriptProcessor
-
process
protected abstract String process(String directive, Map<String,Object> attrs, String theRest)
Processes the given directive.
-
info
protected ScriptInfo info()
Gets the activeScriptInfoinstance.
-
is
protected boolean is(String key, String desired)
Checks whether some key matches the desired value, ignoring case.
-
as
protected <T> T as(Object v, Class<T> type)
Coerces some object into another object of the given type.
-
-