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.Serializable;
19  import java.io.Writer;
20  
21  import java.util.List;
22  
23  /**
24   * <a href="Node.java.html"><b><i>View Source</i></b></a>
25   *
26   * @author Brian Wing Shun Chan
27   */
28  public interface Node extends Serializable {
29  
30      public String asXML();
31  
32      public Node asXPathResult(Element parent);
33  
34      public Node detach();
35  
36      public Document getDocument();
37  
38      public String getName();
39  
40      public Element getParent();
41  
42      public String getPath();
43  
44      public String getPath(Element context);
45  
46      public String getStringValue();
47  
48      public String getText();
49  
50      public String getUniquePath();
51  
52      public String getUniquePath(Element context);
53  
54      public boolean hasContent();
55  
56      public boolean isReadOnly();
57  
58      public boolean matches(String xpathExpression);
59  
60      public Number numberValueOf(String xpathExpression);
61  
62      public List<Node> selectNodes(String xpathExpression);
63  
64      public List<Node> selectNodes(
65          String xpathExpression, String comparisonXPathExpression);
66  
67      public List<Node> selectNodes(
68          String xpathExpression, String comparisonXPathExpression,
69          boolean removeDuplicates);
70  
71      public Object selectObject(String xpathExpression);
72  
73      public Node selectSingleNode(String xpathExpression);
74  
75      public void setName(String name);
76  
77      public void setText(String text);
78  
79      public boolean supportsParent();
80  
81      public String valueOf(String xpathExpression);
82  
83      public void write(Writer writer) throws IOException;
84  
85  }