1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.kernel.xml;
16  
17  import java.io.IOException;
18  import java.io.Writer;
19  
20  import java.util.List;
21  
22  /**
23   * <a href="Node.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   */
27  public interface Node {
28  
29      public String asXML();
30  
31      public Node asXPathResult(Element parent);
32  
33      public Node detach();
34  
35      public Document getDocument();
36  
37      public String getName();
38  
39      public Element getParent();
40  
41      public String getPath();
42  
43      public String getPath(Element context);
44  
45      public String getStringValue();
46  
47      public String getText();
48  
49      public String getUniquePath();
50  
51      public String getUniquePath(Element context);
52  
53      public boolean hasContent();
54  
55      public boolean isReadOnly();
56  
57      public boolean matches(String xpathExpression);
58  
59      public Number numberValueOf(String xpathExpression);
60  
61      public List<Node> selectNodes(String xpathExpression);
62  
63      public List<Node> selectNodes(
64          String xpathExpression, String comparisonXPathExpression);
65  
66      public List<Node> selectNodes(
67          String xpathExpression, String comparisonXPathExpression,
68          boolean removeDuplicates);
69  
70      public Object selectObject(String xpathExpression);
71  
72      public Node selectSingleNode(String xpathExpression);
73  
74      public void setName(String name);
75  
76      public void setText(String text);
77  
78      public boolean supportsParent();
79  
80      public String valueOf(String xpathExpression);
81  
82      public void write(Writer writer) throws IOException;
83  
84  }