Class WholeXmiStaxSplitter

    • Constructor Detail

      • WholeXmiStaxSplitter

        public WholeXmiStaxSplitter​(String tableName,
                                    int attribute_size)
        Creates an StaxXmiSplitter that returns the whole xmi data. It will also return the highest xmi id assigned so far. This is optimal if the xmi data contains only the base document which has to be stored for the first time.
        Parameters:
        tableName - The table to store the xmi data.
        attribute_size - The maximum attribute size accepted by the employed StAX parser.
      • WholeXmiStaxSplitter

        public WholeXmiStaxSplitter​(String tableName)
        Creates an StaxXmiSplitter that returns the whole xmi data. It will also return the highest xmi id assigned so far. This is optimal if the xmi data contains only the base document which has to be stored for the first time.
        Parameters:
        tableName - The table to store the xmi data.
    • Method Detail

      • process

        public XmiSplitterResult process​(byte[] ba,
                                         org.apache.uima.cas.TypeSystem ts,
                                         int nextPossibleId,
                                         Map<String,​Integer> existingSofaIdMap)
                                  throws XMISplitterException
        Processes the xmi data according to the parameters set for the StaxXmiSplitter.
        Specified by:
        process in interface XmiSplitter
        Parameters:
        ba - The current xmi data.
        ts - The type system of the serialized 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.
        Returns:
        A list containing the xmi data (only unless the complete XMI document should be stored), i.e. separate annotations and optionally the base document, as output streams mapped to the table names - a HashMap<String, 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).
        Throws:
        IOException
        XMISplitterException
      • determineMaxXmiId

        public int determineMaxXmiId​(byte[] ba)
        Determines the maximum XMI ID assigned in the XMI data given by bais plus one.
        Parameters:
        ba - The current xmi data as input stream.
      • setAllJavaNames

        public 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.
        Parameters:
        bais - The current xmi data as input stream.
      • getAnnotationsToStore

        public List<String> getAnnotationsToStore()
        Returns the specified annotations to select.
        Returns:
      • getFirstAnnotationtype

        public String getFirstAnnotationtype()
        Return the first annotation type that is not an element of the base document.
        Returns: