Am 08.05.2013 um 13:57 schrieb harshal patni <[email protected]>:

> HI Richard,
>                Eclipse seems to crib about StringReader.PARAM_TEXT and
> wants me to change the name?
> 
> Harshal

This is what I used:

 public class StringReader extends 
org.apache.uima.fit.component.CasCollectionReader_ImplBase {
    private boolean hasBeenRead = false;

    public static final String PARAM_TEXT = "text";

    @ConfigurationParameter(name = PARAM_TEXT)
    private String text;

    public void getNext(CAS aCAS) throws IOException, CollectionException {
      aCAS.setDocumentText(text);
      hasBeenRead = true;
    }

    public boolean hasNext() throws IOException, CollectionException {
      return !hasBeenRead;
    }

    public Progress[] getProgress() {
      return null;
    }
  }

Reply via email to