public class XmlDocumentHandler extends XmlPositionCorrectionHandler
| Modifier and Type | Field and Description |
|---|---|
protected int |
customObjectsId
This is used to generate unique Ids for the CustomObjects read
|
protected List<StatusListener> |
myStatusListeners
Listeners for status report
|
m_realOffset| Constructor and Description |
|---|
XmlDocumentHandler(Document aDocument,
Map<String,String> aMarkupElementsMap,
Map<String,String> anElement2StringMap)
Constructs a XmlDocumentHandler object.
|
XmlDocumentHandler(Document aDocument,
Map<String,String> aMarkupElementsMap,
Map<String,String> anElement2StringMap,
AnnotationSet anAnnotationSet)
Constructs a XmlDocumentHandler object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addStatusListener(StatusListener listener)
This methos is called when a listener is registered with this class
|
void |
characters(char[] text,
int start,
int length)
This method is called when the SAX parser encounts text in the XML doc.
|
void |
charactersAction(char[] text,
int start,
int length)
This method is called when all characters between specific tags have been read completely
|
void |
comment(String text)
This method is called when the SAX parser encounts a comment
It works only if the XmlDocumentHandler implements a
com.sun.parser.LexicalEventListener
|
void |
endCDATA()
This method is called when the SAX parser encounts the end of a CDATA
section.
|
void |
endDocument()
This method is called when the SAX parser encounts the end of the
XML document.
|
void |
endElement(String uri,
String localName,
String qName) |
void |
endParsedEntity(String name,
boolean included)
This method is called when the SAX parser encounts a parsed entity and
informs the application if that entity was parsed or not
It's working only if the CustomDocumentHandler implements a
com.sun.parser.LexicalEventListener
|
void |
error(SAXParseException ex)
Error method.We deal with this exception inside SimpleErrorHandler class
|
void |
fatalError(SAXParseException ex)
FatalError method.
|
protected void |
fireStatusChangedEvent(String text)
This methos is called whenever we need to inform the listener about an
event.
|
RepositioningInfo |
getAmpCodingInfo()
Return current RepositioningInfo object for ampersand coding.
|
int |
getCustomObjectsId()
Accesor method for the customObjectsId field
|
RepositioningInfo |
getRepositioningInfo()
Return current RepositioningInfo object
|
void |
ignorableWhitespace(char[] ch,
int start,
int length)
This method is called when the SAX parser encounts white spaces
|
void |
removeStatusListener(StatusListener listener)
This methos is called when a listener is removed
|
void |
setAmpCodingInfo(RepositioningInfo info)
Set repositioning information structure refference for ampersand coding.
|
void |
setRepositioningInfo(RepositioningInfo info)
Set repositioning information structure refference.
|
void |
startCDATA()
This method is called when the SAX parser encounts a start of a CDATA
section
It works only if the XmlDocumentHandler implements a
com.sun.parser.LexicalEventListener
|
void |
startDocument()
This method is called when the SAX parser encounts the beginning of the
XML document.
|
void |
startElement(String uri,
String localName,
String qName,
Attributes atts) |
void |
startParsedEntity(String name)
This method is called when the SAX parser encounts a parsed Entity
It works only if the XmlDocumentHandler implements a
com.sun.parser.LexicalEventListener
|
void |
warning(SAXParseException ex)
Warning method comment.
|
getRealOffsetendPrefixMapping, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDeclprotected List<StatusListener> myStatusListeners
protected int customObjectsId
public XmlDocumentHandler(Document aDocument, Map<String,String> aMarkupElementsMap, Map<String,String> anElement2StringMap)
aDocument - the Gate document that will be processed.aMarkupElementsMap - this map contains the elements name that we
want to create.anElement2StringMap - this map contains the strings that will be
added to the text contained by the key element.public XmlDocumentHandler(Document aDocument, Map<String,String> aMarkupElementsMap, Map<String,String> anElement2StringMap, AnnotationSet anAnnotationSet)
aDocument - the Gate document that will be processed.aMarkupElementsMap - this map contains the elements name that we
want to create.anElement2StringMap - this map contains the strings that will be
added to the text contained by the key element.anAnnotationSet - is the annotation set that will be filled when the
document was processedpublic void setRepositioningInfo(RepositioningInfo info)
public RepositioningInfo getRepositioningInfo()
public void setAmpCodingInfo(RepositioningInfo info)
public RepositioningInfo getAmpCodingInfo()
public void startDocument()
throws SAXException
startDocument in interface ContentHandlerstartDocument in class XmlPositionCorrectionHandlerSAXExceptionpublic void endDocument()
throws SAXException
endDocument in interface ContentHandlerendDocument in class DefaultHandlerSAXExceptionpublic void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException
startElement in interface ContentHandlerstartElement in class DefaultHandleruri - - namespace urilocalName - - local, unprefixed element nameqName - - fully qualified, prefixed element nameatts - SAXExceptionpublic void endElement(String uri, String localName, String qName) throws SAXException
endElement in interface ContentHandlerendElement in class DefaultHandleruri - - namespace urilocalName - - local, unprefixed element nameqName - - fully qualified, prefixed element nameSAXExceptionpublic void characters(char[] text,
int start,
int length)
throws SAXException
characters in interface ContentHandlercharacters in class XmlPositionCorrectionHandlerSAXExceptionpublic void charactersAction(char[] text,
int start,
int length)
throws SAXException
SAXExceptionpublic void ignorableWhitespace(char[] ch,
int start,
int length)
throws SAXException
ignorableWhitespace in interface ContentHandlerignorableWhitespace in class DefaultHandlerSAXExceptionpublic void error(SAXParseException ex) throws SAXException
error in interface ErrorHandlererror in class DefaultHandlerSAXExceptionpublic void fatalError(SAXParseException ex) throws SAXException
fatalError in interface ErrorHandlerfatalError in class DefaultHandlerSAXExceptionpublic void warning(SAXParseException ex) throws SAXException
warning in interface ErrorHandlerwarning in class DefaultHandlerSAXExceptionpublic void comment(String text) throws SAXException
SAXExceptionpublic void startCDATA()
throws SAXException
SAXExceptionpublic void endCDATA()
throws SAXException
SAXExceptionpublic void startParsedEntity(String name) throws SAXException
SAXExceptionpublic void endParsedEntity(String name, boolean included) throws SAXException
SAXExceptionpublic void addStatusListener(StatusListener listener)
public void removeStatusListener(StatusListener listener)
protected void fireStatusChangedEvent(String text)
public int getCustomObjectsId()
Copyright © 2024 GATE. All rights reserved.