Class XmiBuilder


  • public class XmiBuilder
    extends Object
    • Field Detail

      • noViewMembers

        public static final List<String> noViewMembers
        Start tags of elements whose xmi ids should not appear in the cas:View-element.
    • Constructor Detail

      • XmiBuilder

        public XmiBuilder​(Map<String,​String> nsAndXmiVersionMap,
                          String[] annotationsToRetrieve,
                          long attribute_size)
      • XmiBuilder

        public XmiBuilder​(Map<String,​String> nsAndXmiVersionMap,
                          String[] annotationsToRetrieve)
    • 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 the XmiSplitter.DOCUMENT_MODULE_LABEL key. 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)