001: /* IXMLParser.java NanoXML/Java
002: *
003: * $Revision: 1.3 $
004: * $Date: 2002/01/04 21:03:28 $
005: * $Name: RELEASE_2_2_1 $
006: *
007: * This file is part of NanoXML 2 for Java.
008: * Copyright (C) 2000-2002 Marc De Scheemaecker, All Rights Reserved.
009: *
010: * This software is provided 'as-is', without any express or implied warranty.
011: * In no event will the authors be held liable for any damages arising from the
012: * use of this software.
013: *
014: * Permission is granted to anyone to use this software for any purpose,
015: * including commercial applications, and to alter it and redistribute it
016: * freely, subject to the following restrictions:
017: *
018: * 1. The origin of this software must not be misrepresented; you must not
019: * claim that you wrote the original software. If you use this software in
020: * a product, an acknowledgment in the product documentation would be
021: * appreciated but is not required.
022: *
023: * 2. Altered source versions must be plainly marked as such, and must not be
024: * misrepresented as being the original software.
025: *
026: * 3. This notice may not be removed or altered from any source distribution.
027: */
028:
029: package net.n3.nanoxml;
030:
031: import java.io.IOException;
032:
033: /**
034: * IXMLParser is the core parser of NanoXML.
035: *
036: * @author Marc De Scheemaecker
037: * @version $Name: RELEASE_2_2_1 $, $Revision: 1.3 $
038: */
039: public interface IXMLParser {
040:
041: /**
042: * Sets the reader from which the parser retrieves its data.
043: *
044: * @param reader the reader.
045: */
046: public void setReader(IXMLReader reader);
047:
048: /**
049: * Returns the reader from which the parser retrieves its data.
050: *
051: * @return the reader.
052: */
053: public IXMLReader getReader();
054:
055: /**
056: * Sets the builder which creates the logical structure of the XML data.
057: *
058: * @param builder the builder.
059: */
060: public void setBuilder(IXMLBuilder builder);
061:
062: /**
063: * Returns the builder which creates the logical structure of the XML data.
064: *
065: * @return the builder.
066: */
067: public IXMLBuilder getBuilder();
068:
069: /**
070: * Sets the validator that validates the XML data.
071: *
072: * @param validator the validator.
073: */
074: public void setValidator(IXMLValidator validator);
075:
076: /**
077: * Returns the validator that validates the XML data.
078: *
079: * @return the validator.
080: */
081: public IXMLValidator getValidator();
082:
083: /**
084: * Sets the entity resolver.
085: *
086: * @param resolver the non-null resolver.
087: */
088: public void setResolver(IXMLEntityResolver resolver);
089:
090: /**
091: * Returns the entity resolver.
092: *
093: * @return the non-null resolver.
094: */
095: public IXMLEntityResolver getResolver();
096:
097: /**
098: * Parses the data and lets the builder create the logical data structure.
099: * The method returns the result of <I>getResult</I> of the builder. if an
100: * error occurred while reading or parsing the data, the method may throw
101: * an XMLException.
102: *
103: * @see net.n3.nanoxml.IXMLBuilder#getResult
104: *
105: * @return the logical structure built by the builder.
106: *
107: * @throws net.n3.nanoxml.XMLException
108: * if an error occurred reading or parsing the data
109: */
110: public Object parse() throws XMLException;
111:
112: }
|