Package de.julielab.xml
Class XmiBuilder
- java.lang.Object
-
- de.julielab.xml.XmiBuilder
-
public class XmiBuilder extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static List<String>noViewMembersStart tags of elements whose xmi ids should not appear in the cas:View-element.
-
Constructor Summary
Constructors Constructor Description XmiBuilder(Map<String,String> nsAndXmiVersionMap, String[] annotationsToRetrieve)XmiBuilder(Map<String,String> nsAndXmiVersionMap, String[] annotationsToRetrieve, long attribute_size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteArrayOutputStreambuildXmi(LinkedHashMap<String,InputStream> xmiData, org.apache.uima.cas.TypeSystem ts)Builds a single xmi representation out of the base document and the selected annotations.voidsetdocTableName(String docTableName)The name of the table containing the base document.voidsetInputSize(int dataSize)voidsetXmiData(HashMap<String,InputStream> xmiData)The xmi data (document and annotations) as input streams mapped to table names.protected voidsetXMIStartElementData(Map<String,String> namespacesAndXmiVersion)
-
-
-
Method Detail
-
buildXmi
public ByteArrayOutputStream buildXmi(LinkedHashMap<String,InputStream> xmiData, org.apache.uima.cas.TypeSystem ts)
Builds a single xmi representation out of the base document and the selected annotations.- Parameters:
xmiData- The xmi data (document and annotations) as input streams mapped from storage keys. IMPORTANT: The document data must be associated with theXmiSplitter.DOCUMENT_MODULE_LABELkey. It is a LinkedHashMap because the order of the annotation data - e.g. first Sentences, then Tokens - influences the internal index order in the CAS. Thus, when serializing, the order of the LinkedHashMap will be reflected in the XMI. Since we rely on the order of appearance of annotations to determine the end of the base document, we must provide the correct order.ts-- Returns:
- The combined xmi representation as output stream.
-
setXMIStartElementData
protected void setXMIStartElementData(Map<String,String> namespacesAndXmiVersion)
-
setdocTableName
public void setdocTableName(String docTableName)
The name of the table containing the base document.- Parameters:
docTableName-
-
setXmiData
public void setXmiData(HashMap<String,InputStream> xmiData)
The xmi data (document and annotations) as input streams mapped to table names.- Parameters:
xmiData-
-
setInputSize
public void setInputSize(int dataSize)
-
-