public interface Document extends SimpleDocument
Modifier and Type | Field and Description |
---|---|
static String |
DOCUMENT_ENCODING_PARAMETER_NAME |
static String |
DOCUMENT_END_OFFSET_PARAMETER_NAME |
static String |
DOCUMENT_MARKUP_AWARE_PARAMETER_NAME
The parameter name that determines whether or not a document is markup aware
|
static String |
DOCUMENT_MIME_TYPE_PARAMETER_NAME |
static String |
DOCUMENT_PRESERVE_CONTENT_PARAMETER_NAME |
static String |
DOCUMENT_REPOSITIONING_PARAMETER_NAME |
static String |
DOCUMENT_START_OFFSET_PARAMETER_NAME |
static String |
DOCUMENT_STRING_CONTENT_PARAMETER_NAME |
static String |
DOCUMENT_TYPE_PARAMETER_NAME |
DOCUMENT_URL_PARAMETER_NAME
Modifier and Type | Method and Description |
---|---|
void |
addDocumentListener(DocumentListener l)
Adds a
DocumentListener to this document. |
void |
edit(Long start,
Long end,
DocumentContent replacement)
Make changes to the document content and adapt affected annotations.
|
Boolean |
getCollectRepositioningInfo()
Get the collectiong and preserving of repositioning information
for the Document.
|
Boolean |
getMarkupAware()
Get the markup awareness status of the Document.
|
Map<String,AnnotationSet> |
getNamedAnnotationSets()
Returns a map with the named annotation sets
|
Boolean |
getPreserveOriginalContent()
Get the preserving of content status of the Document.
|
Long |
getSourceUrlEndOffset()
Documents may be packed within files; in this case an optional pair of
offsets refer to the location of the document.
|
Long[] |
getSourceUrlOffsets()
Documents may be packed within files; in this case an optional pair of
offsets refer to the location of the document.
|
Long |
getSourceUrlStartOffset()
Documents may be packed within files; in this case an optional pair of
offsets refer to the location of the document.
|
void |
removeDocumentListener(DocumentListener l)
Removes one of the previously registered document listeners.
|
void |
setCollectRepositioningInfo(Boolean b)
Allow/disallow collecting of repositioning information.
|
void |
setMarkupAware(Boolean b)
Make the document markup-aware.
|
void |
setPreserveOriginalContent(Boolean b)
Allow/disallow preserving of the original document content.
|
void |
setSourceUrlEndOffset(Long sourceUrlEndOffset)
Documents may be packed within files; in this case an optional pair of
offsets refer to the location of the document.
|
void |
setSourceUrlStartOffset(Long sourceUrlStartOffset)
Documents may be packed within files; in this case an optional pair of
offsets refer to the location of the document.
|
String |
toXml()
Returns a GateXml document.
|
String |
toXml(Set<Annotation> aSourceAnnotationSet)
Equivalent to toXml(aSourceAnnotationSet, true).
|
String |
toXml(Set<Annotation> aSourceAnnotationSet,
boolean includeFeatures)
Returns an XML document aming to preserve the original markups(
the original markup will be in the same place and format as it was
before processing the document) and include (if possible)
the annotations specified in the aSourceAnnotationSet.
|
getAnnotations, getAnnotations, getAnnotationSetNames, getContent, getSourceUrl, removeAnnotationSet, setContent, setSourceUrl
getDataStore, getLRPersistenceId, getParent, isModified, setDataStore, setLRPersistenceId, setParent, sync
cleanup, getParameterValue, init, setParameterValue, setParameterValues
getFeatures, setFeatures
getName, setName
compareTo
static final String DOCUMENT_MARKUP_AWARE_PARAMETER_NAME
static final String DOCUMENT_ENCODING_PARAMETER_NAME
static final String DOCUMENT_PRESERVE_CONTENT_PARAMETER_NAME
static final String DOCUMENT_STRING_CONTENT_PARAMETER_NAME
static final String DOCUMENT_MIME_TYPE_PARAMETER_NAME
static final String DOCUMENT_REPOSITIONING_PARAMETER_NAME
static final String DOCUMENT_START_OFFSET_PARAMETER_NAME
static final String DOCUMENT_END_OFFSET_PARAMETER_NAME
static final String DOCUMENT_TYPE_PARAMETER_NAME
Long[] getSourceUrlOffsets()
Long getSourceUrlStartOffset()
Long getSourceUrlEndOffset()
Map<String,AnnotationSet> getNamedAnnotationSets()
void setMarkupAware(Boolean b)
b
- markup awareness status.Boolean getMarkupAware()
void setPreserveOriginalContent(Boolean b)
Boolean getPreserveOriginalContent()
void setCollectRepositioningInfo(Boolean b)
Boolean getCollectRepositioningInfo()
String toXml()
writeDocument
methods of
DocumentStaxUtils
provide the standard implementation of this
serialization format which will work for any Document implementation.
Implementations of toXml
will typically delegate to
DocumentStaxUtils
, and in many cases it will be more
efficient for callers to use that directly rather than calling
toXml
.DocumentStaxUtils
String toXml(Set<Annotation> aSourceAnnotationSet, boolean includeFeatures)
aSourceAnnotationSet
- is an annotation set containing all the
annotations that will be combined with the original marup set.includeFeatures
- determines whether or not features and gate IDs
of the annotations should be included as attributes on the tags or not.
If false, then only the annotation types are exported as tags, with no
attributes.String toXml(Set<Annotation> aSourceAnnotationSet)
void edit(Long start, Long end, DocumentContent replacement) throws InvalidOffsetException
AnnotationSetImpl.edit(long,long,DocumentContent)
for information on how annotations get adapted.InvalidOffsetException
void addDocumentListener(DocumentListener l)
DocumentListener
to this document.
All the registered listeners will be notified of changes occured to the
document.void removeDocumentListener(DocumentListener l)
void setSourceUrlEndOffset(Long sourceUrlEndOffset)
void setSourceUrlStartOffset(Long sourceUrlStartOffset)
Copyright © 2024 GATE. All rights reserved.