01: /* IXMLEntityResolver.java NanoXML/Java
02: *
03: * $Revision: 1.17 $
04: * $Date: 2005/01/05 17:20:04 $
05: * $Name: $
06: *
07: * This file is part of NanoXML 2 for Java.
08: * Copyright (C) 2000-2002 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.util.Hashtable;
32: import java.io.Reader;
33: import java.io.StringReader;
34:
35: /**
36: * An IXMLEntityResolver resolves entities.
37: *
38: * @author Marc De Scheemaecker
39: * @version $Name: $, $Revision: 1.17 $
40: */
41: public interface IXMLEntityResolver {
42:
43: /**
44: * Adds an internal entity.
45: *
46: * @param name the name of the entity.
47: * @param value the value of the entity.
48: */
49: public void addInternalEntity(String name, String value);
50:
51: /**
52: * Adds an external entity.
53: *
54: * @param name the name of the entity.
55: * @param publicID the public ID of the entity, which may be null.
56: * @param systemID the system ID of the entity.
57: */
58: public void addExternalEntity(String name, String publicID,
59: String systemID);
60:
61: /**
62: * Returns a Java reader containing the value of an entity.
63: *
64: * @param xmlReader the current NanoXML reader.
65: * @param name the name of the entity.
66: *
67: * @return the reader, or null if the entity could not be resolved.
68: *
69: * @throws net.n3.nanoxml.XMLParseException
70: * If an exception occurred while resolving the entity.
71: */
72: public Reader getEntity(IXMLReader xmlReader, String name)
73: throws XMLParseException;
74:
75: /**
76: * Returns true if an entity is external.
77: *
78: * @param name the name of the entity.
79: */
80: public boolean isExternalEntity(String name);
81:
82: }
|