public class StaxXmiSplitter extends Object implements XmiSplitter
| Constructor and Description |
|---|
StaxXmiSplitter(List<String> annotationModulesToExtract,
boolean recursively,
boolean storeBaseDocument,
String docTableName,
Set<String> baseDocumentAnnotations)
Creates an StaxXmiSplitter that selects specified annotations and returns
them separately.
|
StaxXmiSplitter(List<String> annotationModulesToExtract,
boolean recursively,
boolean storeBaseDocument,
String docTableName,
Set<String> baseDocumentAnnotations,
int attribute_size)
TODO
|
StaxXmiSplitter(String tableName)
Creates an StaxXmiSplitter that returns the whole xmi data.
|
StaxXmiSplitter(String tableName,
int attribute_size)
TODO
|
| Modifier and Type | Method and Description |
|---|---|
int |
determineMaxXmiId(byte[] ba)
Determines the maximum XMI ID assigned in the XMI data given by
bais plus one.
|
List<String> |
getAnnotationsToStore()
Returns the specified annotations to select.
|
String |
getFirstAnnotationtype()
Return the first annotation type that is not an element of the base
document.
|
XmiSplitterResult |
process(byte[] ba,
org.apache.uima.jcas.JCas aCas,
int nextPossibleId,
Map<String,Integer> existingSofaIdMap)
Processes the xmi data according to the parameters set for the
StaxXmiSplitter.
|
void |
setAllJavaNames(ByteArrayInputStream bais)
Retrieves the types namespace uri from the xmi element in order to create
the fully qualified java name for all annotations that have not been
given in this form.
|
public StaxXmiSplitter(List<String> annotationModulesToExtract, boolean recursively, boolean storeBaseDocument, String docTableName, Set<String> baseDocumentAnnotations, int attribute_size)
public StaxXmiSplitter(List<String> annotationModulesToExtract, boolean recursively, boolean storeBaseDocument, String docTableName, Set<String> baseDocumentAnnotations)
annotationModulesToExtract - A list of annotations to select and to return separately.
These should be given as the fully qualified java names of the
annotation types. If not, the fully qualified java name will
be retrieved from the types namespace and used as table name.recursively - If set to true, annotations that are features of the selected
annotations will also be returned.storeBaseDocument - If set to true, the base document will be returned as well. In
this case the name of the document table as well as as the
first annotation type has to be given.docTableName - The table to store the base document. Can be null if
storeBaseDocument is set to false.baseDocumentAnnotations - The names of those annotation types that should be stored together with the document.public StaxXmiSplitter(String tableName, int attribute_size)
public StaxXmiSplitter(String tableName)
tableName - The table to store the xmi data.public XmiSplitterResult process(byte[] ba, org.apache.uima.jcas.JCas aCas, int nextPossibleId, Map<String,Integer> existingSofaIdMap) throws XMISplitterException
process in interface XmiSplitterba - The current xmi data.aCas - The current cas.nextPossibleId - The next xmi id that can be assigned to the new annotations.
If the base document has not yet been stored this should be 0.HashMapString, ByteArrayOutputStream
- the next possible xmi id - an Integer - to store
in the database and a namespace map derived from XMI opening
element where each namespace prefix is mapped to the namespace
URI (only unless the complete XMI document should be stored).IOExceptionXMISplitterExceptionpublic int determineMaxXmiId(byte[] ba)
ba - The current xmi data as input stream.public void setAllJavaNames(ByteArrayInputStream bais)
bais - The current xmi data as input stream.public List<String> getAnnotationsToStore()
public String getFirstAnnotationtype()
Copyright © 2018 JULIE Lab Jena, Germany. All rights reserved.