|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gate.util.AbstractFeatureBearer | +--gate.creole.AbstractResource | +--gate.creole.AbstractLanguageResource | +--gate.DocumentFormat
The format of Documents. Subclasses of DocumentFormat know about particular MIME types and how to unpack the information in any markup or formatting they contain into GATE annotations. Each MIME type has its own subclass of DocumentFormat, e.g. XmlDocumentFormat, RtfDocumentFormat, MpegDocumentFormat. These classes register themselves with a static index residing here when they are constructed. Static getDocumentFormat methods can then be used to get the appropriate format class for a particular document.
Constructor Summary | |
DocumentFormat()
Default construction |
Method Summary | |
void |
addStatusListener(StatusListener l)
|
static DocumentFormat |
getDocumentFormat(Document aGateDocument,
org.w3c.www.mime.MimeType mimeType)
Find a DocumentFormat implementation that deals with a particular MIME type, given that type. |
static DocumentFormat |
getDocumentFormat(Document aGateDocument,
String fileSuffix)
Find a DocumentFormat implementation that deals with a particular MIME type, given the file suffix (e.g. |
static DocumentFormat |
getDocumentFormat(Document aGateDocument,
URL url)
Find a DocumentFormat implementation that deals with a particular MIME type, given the URL of the Document. |
Map |
getElement2StringMap()
Get the element 2 string map |
FeatureMap |
getFeatures()
Get the feature set |
Map |
getMarkupElementsMap()
Get the markup elements map |
org.w3c.www.mime.MimeType |
getMimeType()
Gets the mime Type |
Boolean |
getShouldCollectRepositioning()
|
void |
removeStatusListener(StatusListener l)
|
void |
setElement2StringMap(Map anElement2StringMap)
Set the element 2 string map |
void |
setFeatures(FeatureMap features)
Set the features map |
void |
setMarkupElementsMap(Map markupElementsMap)
Set the markup elements map |
void |
setMimeType(org.w3c.www.mime.MimeType aMimeType)
Set the mime type |
void |
setShouldCollectRepositioning(Boolean b)
|
Boolean |
supportsRepositioning()
If the document format could collect repositioning information during the unpack phase this method will return true. |
abstract void |
unpackMarkup(Document doc)
Unpack the markup in the document. |
abstract void |
unpackMarkup(Document doc,
RepositioningInfo repInfo,
RepositioningInfo ampCodingInfo)
|
void |
unpackMarkup(Document doc,
String originalContentFeatureType)
Unpack the markup in the document. |
Methods inherited from class gate.creole.AbstractLanguageResource |
cleanup, getDataStore, getLRPersistenceId, getParent, isModified, setDataStore, setLRPersistenceId, setParent, sync |
Methods inherited from class gate.creole.AbstractResource |
checkParameterValues, getName, getParameterValue, getParameterValue, init, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface gate.LanguageResource |
getDataStore, getLRPersistenceId, getParent, isModified, setDataStore, setLRPersistenceId, setParent, sync |
Methods inherited from interface gate.Resource |
cleanup, getParameterValue, init, setParameterValue, setParameterValues |
Methods inherited from interface gate.util.NameBearer |
getName, setName |
Constructor Detail |
public DocumentFormat()
Method Detail |
public Boolean supportsRepositioning()
public void setShouldCollectRepositioning(Boolean b)
public Boolean getShouldCollectRepositioning()
public abstract void unpackMarkup(Document doc) throws DocumentFormatException
DocumentFormatException
public abstract void unpackMarkup(Document doc, RepositioningInfo repInfo, RepositioningInfo ampCodingInfo) throws DocumentFormatException
DocumentFormatException
public void unpackMarkup(Document doc, String originalContentFeatureType) throws DocumentFormatException
doc
- the document that will be upackedoriginalContentFeatureType
- the name of the feature that will hold
the document's content.
DocumentFormatException
public static DocumentFormat getDocumentFormat(Document aGateDocument, org.w3c.www.mime.MimeType mimeType)
aGateDocument
- this document will receive as a feature
the associated Mime Type. The name of the feature is
MimeType and its value is in the format type/subtypemimeType
- the mime type that is given as inputpublic static DocumentFormat getDocumentFormat(Document aGateDocument, String fileSuffix)
aGateDocument
- this document will receive as a feature
the associated Mime Type. The name of the feature is
MimeType and its value is in the format type/subtypefileSuffix
- the file suffix that is given as inputpublic static DocumentFormat getDocumentFormat(Document aGateDocument, URL url)
aGateDocument
- this document will receive as a feature
the associated Mime Type. The name of the feature is
MimeType and its value is in the format type/subtypeurl
- the URL that is given as inputpublic FeatureMap getFeatures()
getFeatures
in interface FeatureBearer
getFeatures
in class AbstractFeatureBearer
public Map getMarkupElementsMap()
public Map getElement2StringMap()
public void setMarkupElementsMap(Map markupElementsMap)
public void setElement2StringMap(Map anElement2StringMap)
public void setFeatures(FeatureMap features)
setFeatures
in interface FeatureBearer
setFeatures
in class AbstractFeatureBearer
public void setMimeType(org.w3c.www.mime.MimeType aMimeType)
public org.w3c.www.mime.MimeType getMimeType()
public void removeStatusListener(StatusListener l)
public void addStatusListener(StatusListener l)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |