001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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    }