KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > xml > CauchoNode


1 /*
2  * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  * Free SoftwareFoundation, Inc.
23  * 59 Temple Place, Suite 330
24  * Boston, MA 02111-1307 USA
25  *
26  * @author Scott Ferguson
27  */

28
29 package com.caucho.xml;
30
31 import com.caucho.vfs.WriteStream;
32
33 import org.w3c.dom.Node JavaDoc;
34
35 import java.io.IOException JavaDoc;
36
37 /**
38  * CauchoNode extends the DOM, providing namespace support and input file
39  * support.
40  *
41  * <p>Application can print the filename and line number where the
42  * error occurred.
43  */

44 public interface CauchoNode extends Node JavaDoc {
45   // DOM2 compatibility for old DOM
46
public String JavaDoc getNamespaceURI();
47   public String JavaDoc getPrefix();
48   public String JavaDoc getLocalName();
49
50   /**
51    * Returns the node's canonical name.
52    *
53    * <p>e.g. for foo:bar:baz, the prefix name might be '{/caucho/1.0}baz'
54    */

55   public String JavaDoc getCanonicalName();
56
57   /**
58    * Returns the text value of the node
59    */

60   public String JavaDoc getTextValue();
61
62   /**
63    * Returns the source filename of this node.
64    */

65   public String JavaDoc getFilename();
66
67   /**
68    * Returns the source uri of this node.
69    */

70   public String JavaDoc getBaseURI();
71
72   /**
73    * Returns the source line of this node.
74    */

75   public int getLine();
76
77   /**
78    * Returns the source column of this node.
79 p */

80   public int getColumn();
81   /**
82    * Sets the location
83    */

84   public void setLocation(String JavaDoc systemId, String JavaDoc filename,
85               int line, int column);
86
87   /**
88    * Prints the node to a stream
89    */

90   public void print(WriteStream os) throws IOException JavaDoc;
91
92   /**
93    * Pretty-prints the node to a stream
94    */

95   public void printPretty(WriteStream os) throws IOException JavaDoc;
96
97   /**
98    * Prints the node as html to a stream
99    */

100   public void printHtml(WriteStream os) throws IOException JavaDoc;
101
102   /**
103    * For testing...
104    */

105   public boolean checkValid() throws Exception JavaDoc;
106 }
107
Popular Tags