01: /*
02: * Copyright (C) 2004 TiongHiang Lee
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2.1 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: *
18: * Email: thlee@onemindsoft.org
19: */
20:
21: package org.onemind.jxp;
22:
23: import java.io.IOException;
24: import org.onemind.jxp.parser.AstJxpDocument;
25:
26: /**
27: * Represent the source of JxpPages. It contains multiple JxpPages identified by the ids
28: * @author TiongHiang Lee (thlee@onemindsoft.org)
29: *
30: */
31: public abstract class JxpPageSource {
32:
33: /**
34: * Return whether the jxp page identified by the id exists
35: * @param id the id
36: * @return true if exists
37: */
38: public abstract boolean hasJxpPage(String id);
39:
40: /**
41: * Return a jxp page identified by the id
42: * @param id the id
43: * @return the jxp page
44: * @throws JxpPageNotFoundException if the page cannot be found
45: */
46: public abstract JxpPage getJxpPage(String id)
47: throws JxpPageNotFoundException;
48:
49: /**
50: * Print the error source of this page on given line and column
51: * @param page the page
52: * @param line the line
53: * @param col the column
54: * @return the StringBuffer
55: * @throws IOException if there's IO problem
56: */
57: public abstract StringBuffer getErrorSource(JxpPage page, int line,
58: int col) throws IOException;
59:
60: /**
61: * Get the jxp document for the JxpPage
62: * @param page the JxpPage
63: * @return the AstJxpDocument
64: * @throws JxpPageSourceException if there's source exception
65: */
66: public abstract AstJxpDocument getJxpDocument(JxpPage page)
67: throws JxpPageSourceException;
68:
69: }
|