01: /* IXMLEntityResolver.java NanoXML/Java
02: *
03: * $Revision: 1421 $
04: * $Date: 2006-03-12 09:32:32 -0700 (Sun, 12 Mar 2006) $
05: * $Name$
06: *
07: * This file is part of NanoXML 2 for Java.
08: * Copyright (C) 2001 Marc De Scheemaecker, All Rights Reserved.
09: *
10: * This software is provided 'as-is', without any express or implied warranty.
11: * In no event will the authors be held liable for any damages arising from the
12: * use of this software.
13: *
14: * Permission is granted to anyone to use this software for any purpose,
15: * including commercial applications, and to alter it and redistribute it
16: * freely, subject to the following restrictions:
17: *
18: * 1. The origin of this software must not be misrepresented; you must not
19: * claim that you wrote the original software. If you use this software in
20: * a product, an acknowledgment in the product documentation would be
21: * appreciated but is not required.
22: *
23: * 2. Altered source versions must be plainly marked as such, and must not be
24: * misrepresented as being the original software.
25: *
26: * 3. This notice may not be removed or altered from any source distribution.
27: */
28:
29: package net.n3.nanoxml;
30:
31: import java.io.Reader;
32:
33: /**
34: * An IXMLEntityResolver resolves entities.
35: *
36: * @author Marc De Scheemaecker
37: * @version $Name$, $Revision: 1421 $
38: */
39: public interface IXMLEntityResolver {
40:
41: /**
42: * Adds an internal entity.
43: *
44: * @param name the name of the entity.
45: * @param value the value of the entity.
46: */
47: public void addInternalEntity(String name, String value);
48:
49: /**
50: * Adds an external entity.
51: *
52: * @param name the name of the entity.
53: * @param publicID the public ID of the entity, which may be null.
54: * @param systemID the system ID of the entity.
55: */
56: public void addExternalEntity(String name, String publicID,
57: String systemID);
58:
59: /**
60: * Returns a Java reader containing the value of an entity.
61: *
62: * @param xmlReader the current XML reader
63: * @param name the name of the entity.
64: *
65: * @return the reader, or null if the entity could not be resolved.
66: *
67: * @throws net.n3.nanoxml.XMLParseException If an exception occurred while resolving the entity.
68: */
69: public Reader getEntity(IXMLReader xmlReader, String name)
70: throws XMLParseException;
71:
72: }
|