001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.kernel.xml;
016    
017    import java.io.IOException;
018    import java.io.Serializable;
019    import java.io.Writer;
020    
021    import java.util.List;
022    
023    /**
024     * @author Brian Wing Shun Chan
025     */
026    public interface Node extends Serializable {
027    
028            public String asXML();
029    
030            public Node asXPathResult(Element parent);
031    
032            public Node detach();
033    
034            public Document getDocument();
035    
036            public String getName();
037    
038            public Element getParent();
039    
040            public String getPath();
041    
042            public String getPath(Element context);
043    
044            public String getStringValue();
045    
046            public String getText();
047    
048            public String getUniquePath();
049    
050            public String getUniquePath(Element context);
051    
052            public boolean hasContent();
053    
054            public boolean isReadOnly();
055    
056            public boolean matches(String xpathExpression);
057    
058            public Number numberValueOf(String xpathExpression);
059    
060            public List<Node> selectNodes(String xpathExpression);
061    
062            public List<Node> selectNodes(
063                    String xpathExpression, String comparisonXPathExpression);
064    
065            public List<Node> selectNodes(
066                    String xpathExpression, String comparisonXPathExpression,
067                    boolean removeDuplicates);
068    
069            public Object selectObject(String xpathExpression);
070    
071            public Node selectSingleNode(String xpathExpression);
072    
073            public void setName(String name);
074    
075            public void setText(String text);
076    
077            public boolean supportsParent();
078    
079            public String valueOf(String xpathExpression);
080    
081            public void write(Writer writer) throws IOException;
082    
083    }