001: package com.jclark.xml.parse.base;
002:
003: import com.jclark.xml.parse.*;
004:
005: /**
006: * This interface is used by the parser to report information to the
007: * application.
008: * In all cases the event argument is valid only until the function
009: * returns;
010: * the parser may reuse the event object to report subsequent events.
011: *
012: * @see Parser
013: * @version $Revision: 1.2 $ $Date: 1998/06/10 09:43:55 $
014: */
015: public interface Application {
016: /**
017: * Reports the start of the document.
018: * This is called once per well-formed document before any other methods.
019: */
020: void startDocument() throws Exception;
021:
022: /**
023: * Reports the end of the prolog.
024: * Called before the start of the first element.
025: */
026: void endProlog(EndPrologEvent event) throws Exception;
027:
028: /**
029: * Reports the start of an element.
030: * This includes both start-tags and empty elements.
031: */
032: void startElement(StartElementEvent event) throws Exception;
033:
034: /**
035: * Reports character data.
036: */
037: void characterData(CharacterDataEvent event) throws Exception;
038:
039: /**
040: * Reports the end of a element.
041: * This includes both end-tags and empty elements.
042: */
043: void endElement(EndElementEvent event) throws Exception;
044:
045: /**
046: * Reports a processing instruction.
047: * Note that processing instructions can occur before or after the
048: * document element.
049: */
050: void processingInstruction(ProcessingInstructionEvent event)
051: throws Exception;
052:
053: /**
054: * Reports the end of the document.
055: * Called once per well-formed document, after all other methods.
056: * Not called if the document is not well-formed.
057: */
058: void endDocument() throws Exception;
059:
060: /**
061: * Reports a comment.
062: * Note that comments can occur before or after the
063: * document element.
064: */
065: void comment(CommentEvent event) throws Exception;
066:
067: /**
068: * Reports the start of a CDATA section.
069: */
070: void startCdataSection(StartCdataSectionEvent event)
071: throws Exception;
072:
073: /**
074: * Reports the end of a CDATA section.
075: */
076: void endCdataSection(EndCdataSectionEvent event) throws Exception;
077:
078: /**
079: * Reports the start of an entity reference.
080: * This event will be followed by the result of parsing
081: * the entity's replacement text.
082: * This is not called for entity references in attribute values.
083: */
084: void startEntityReference(StartEntityReferenceEvent event)
085: throws Exception;
086:
087: /**
088: * Reports the start of an entity reference.
089: * This event follow's the result of parsing
090: * the entity's replacement text.
091: * This is not called for entity references in attribute values.
092: */
093: void endEntityReference(EndEntityReferenceEvent event)
094: throws Exception;
095:
096: /**
097: * Reports the start of the document type declaration.
098: */
099: void startDocumentTypeDeclaration(
100: StartDocumentTypeDeclarationEvent event) throws Exception;
101:
102: /**
103: * Reports the end of the document type declaration.
104: */
105: void endDocumentTypeDeclaration(
106: EndDocumentTypeDeclarationEvent event) throws Exception;
107:
108: /**
109: * Reports a markup declaration.
110: */
111: void markupDeclaration(MarkupDeclarationEvent event)
112: throws Exception;
113: }
|