Class ITSStandoffManager


  • public class ITSStandoffManager
    extends Object
    Handles resolving standoff annotation references without loading the entire XLIFF into memory.
    • Constructor Detail

      • ITSStandoffManager

        public ITSStandoffManager()
        Use default in-memory HashMap of ITS standoff annotations.
      • ITSStandoffManager

        public ITSStandoffManager​(IITSDataStore dataStore)
        Use specified storage for ITS standoff annotations.
    • Method Detail

      • parseXLIFF

        public void parseXLIFF​(XMLEventReader reader,
                               String resource,
                               String encoding)
                        throws XMLStreamException
        Saves input reader into a temporary file and returns a reference for additional parsing of the same content.
        Parameters:
        reader - the reader for the document to parse.
        resource - an IRI reference without the fragment part.
        encoding - the encoding to use for the output.
        Throws:
        XMLStreamException
      • addLQIAnnotation

        public <T extends GenericAnnotations> void addLQIAnnotation​(T anns,
                                                                    String uri)
        Resolve a LQI reference using the specified URI and add it to the specified annotations.
        Parameters:
        anns - annotations where to add.
        uri - URI of the reference.
      • addProvAnnotation

        public <T extends GenericAnnotations> void addProvAnnotation​(T anns,
                                                                     String uri)
        Resolve a provenance reference using the specified URI and add it to the specified annotations.
        Parameters:
        anns - the annotations where to add.
        uri - URI of the reference.
      • alreadyParsed

        public boolean alreadyParsed​(String resource)
        Check if the named resource has already been parsed for ITS metadata. Naming consistency is expected for the resource; ie if the resource is referred to using the entire URI, all references to the same resource must do the same.
        Parameters:
        resource - An IRI reference without the fragment part