gate.util.spring
Class AddPRResourceCustomiser
java.lang.Object
gate.util.spring.AddPRResourceCustomiser
- All Implemented Interfaces:
- ResourceCustomiser
public class AddPRResourceCustomiser
- extends Object
- implements ResourceCustomiser
Resource customiser that customises a SerialController by
adding an extra PR. By default the PR is added to the end of the
controller's PR list, but can optionally be added at a specific
index, or before or after another named PR.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
index
private int index
addBefore
private String addBefore
addAfter
private String addAfter
pr
private ProcessingResource pr
AddPRResourceCustomiser
public AddPRResourceCustomiser()
customiseResource
public void customiseResource(Resource res)
throws Exception
- Specified by:
customiseResource in interface ResourceCustomiser
- Throws:
Exception
findPR
private int findPR(String name,
Controller c)
- Find the index of the first PR with the given name in the
controller.
- Parameters:
name - the PR name to search forc - the controller
- Returns:
- the index of the first PR with this name in the controller,
or -1 if no such PR exists.
setIndex
public void setIndex(int index)
setAddBefore
public void setAddBefore(String addBefore)
setAddAfter
public void setAddAfter(String addAfter)
setPr
public void setPr(ProcessingResource pr)