[Htmlparser-cvs] htmlparser/src/org/htmlparser/nodeDecorators EscapeCharacterRemovingNode.java,NONE,
Brought to you by:
derrickoswald
|
From: <jke...@us...> - 2003-06-25 03:56:23
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/nodeDecorators
In directory sc8-pr-cvs1:/tmp/cvs-serv27589/src/org/htmlparser/nodeDecorators
Added Files:
EscapeCharacterRemovingNode.java DecodingNode.java
Log Message:
moved node decorator code and tests to their own packages.
--- NEW FILE: EscapeCharacterRemovingNode.java ---
package org.htmlparser.nodeDecorators;
import org.htmlparser.Node;
import org.htmlparser.tags.CompositeTag;
import org.htmlparser.util.NodeList;
import org.htmlparser.util.ParserUtils;
import org.htmlparser.visitors.NodeVisitor;
public class EscapeCharacterRemovingNode implements Node {
private Node delegate;
public EscapeCharacterRemovingNode(Node newDelegate) {
this.delegate = newDelegate;
}
public void accept(NodeVisitor visitor) {
delegate.accept(visitor);
}
public void collectInto(NodeList collectionList, Class nodeType) {
delegate.collectInto(collectionList, nodeType);
}
public void collectInto(NodeList collectionList, String filter) {
delegate.collectInto(collectionList, filter);
}
public int elementBegin() {
return delegate.elementBegin();
}
public int elementEnd() {
return delegate.elementEnd();
}
public boolean equals(Object arg0) {
return delegate.equals(arg0);
}
public CompositeTag getParent() {
return delegate.getParent();
}
public String getText() {
return delegate.getText();
}
public void setParent(CompositeTag tag) {
delegate.setParent(tag);
}
public void setText(String text) {
delegate.setText(text);
}
public String toHtml() {
return delegate.toHtml();
}
public String toPlainTextString() {
return ParserUtils.removeEscapeCharacters(delegate.toPlainTextString());
}
public String toString() {
return delegate.toString();
}
}
--- NEW FILE: DecodingNode.java ---
// HTMLParser Library v1_4_20030622 - A java-based parser for HTML
// Copyright (C) Dec 31, 2000 Somik Raha
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// For any questions or suggestions, you can write to me at :
// Email :so...@in...
//
// Postal Address :
// Somik Raha
// Extreme Programmer & Coach
// Industrial Logic Corporation
// 2583 Cedar Street, Berkeley,
// CA 94708, USA
// Website : http://www.industriallogic.com
//
// This class was contributed by Joshua Kerievsky
package org.htmlparser.nodeDecorators;
import org.htmlparser.Node;
import org.htmlparser.tags.CompositeTag;
import org.htmlparser.util.NodeList;
import org.htmlparser.util.Translate;
import org.htmlparser.visitors.NodeVisitor;
public class DecodingNode implements Node {
private Node delegate;
public DecodingNode(Node node) {
delegate = node;
}
public String toPlainTextString() {
return Translate.decode(delegate.toPlainTextString());
}
public void accept(NodeVisitor visitor) {
delegate.accept(visitor);
}
public void collectInto(NodeList collectionList, Class nodeType) {
delegate.collectInto(collectionList, nodeType);
}
public void collectInto(NodeList collectionList, String filter) {
delegate.collectInto(collectionList, filter);
}
public int elementBegin() {
return delegate.elementBegin();
}
public int elementEnd() {
return delegate.elementEnd();
}
public CompositeTag getParent() {
return delegate.getParent();
}
public String getText() {
return delegate.getText();
}
public void setParent(CompositeTag tag) {
delegate.setParent(tag);
}
public void setText(String text) {
delegate.setText(text);
}
public String toHtml() {
return delegate.toHtml();
}
}
|