gate.util.spring
Class AddPRResourceCustomiser

java.lang.Object
  extended by 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.


Field Summary
private  String addAfter
           
private  String addBefore
           
private  int index
           
private  ProcessingResource pr
           
 
Constructor Summary
AddPRResourceCustomiser()
           
 
Method Summary
 void customiseResource(Resource res)
           
private  int findPR(String name, Controller c)
          Find the index of the first PR with the given name in the controller.
 void setAddAfter(String addAfter)
           
 void setAddBefore(String addBefore)
           
 void setIndex(int index)
           
 void setPr(ProcessingResource pr)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

index

private int index

addBefore

private String addBefore

addAfter

private String addAfter

pr

private ProcessingResource pr
Constructor Detail

AddPRResourceCustomiser

public AddPRResourceCustomiser()
Method Detail

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 for
c - 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)