public class JCasBuilder extends Object
Constructor and Description |
---|
JCasBuilder(JCas aJCas)
Create a new JCas builder working on the specified JCas.
|
Modifier and Type | Method and Description |
---|---|
<T> T |
add(int aBegin,
Class<T> aClass)
Add an annotation starting at the specified position and ending at the current end of the text.
|
void |
add(String aText)
Append a text.
|
<T> T |
add(String aText,
Class<T> aClass)
Append a text annotated with the specified annotation.
|
void |
close()
Complete the building process by writing the text into the CAS.
|
JCas |
getJCas()
Get the JCas.
|
int |
getPosition()
Get the current "cursor" position (current text length).
|
public JCasBuilder(JCas aJCas)
aJCas
- the working JCas.public void add(String aText)
aText
- the text to append.public <T> T add(String aText, Class<T> aClass)
T
- annotation typeaText
- covered textaClass
- annotation typepublic <T> T add(int aBegin, Class<T> aClass)
T
- annotation typeaBegin
- begin offset.aClass
- annotation typepublic int getPosition()
public JCas getJCas()
public void close()
Copyright © 2012–2022 The Apache Software Foundation. All rights reserved.