Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| HTML Parser Home Page
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES

## Package org.htmlparser.nodeDecorators

The nodeDecorators package contains classes that use the Decorator pattern.

See:
Description

Class Summary
AbstractNodeDecorator |
DecodingNode |
EscapeCharacterRemovingNode |
NonBreakingSpaceConvertingNode |

## Package org.htmlparser.nodeDecorators Description

The nodeDecorators package contains classes that use the Decorator pattern. The nodeDecorators package contains example decorators that alter node behaviour. For example, the DecodingNode class overrides the toPlainTextString() method of all nodes it wraps and applies the Translate class decode() method to the original node output:

    StringBuffer content = new StringBuffer (1024);
    StringNodeFactory factory = new StringNodeFactory ();
    factory.setDecode (true);
    createParser ("http://whatever");
    parser.setNodeFactory (factory);
    NodeIterator iterator = parser.elements ();
    while (iterator.hasMoreNodes ())
        content.append (iterator.nextNode ().toPlainTextString ());
    System.out.println (content.toString ());

Decorators are a powerful way of performing the same operation on every node.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| © 2004 Somik Raha Mar 14, 2004
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES

HTML Parser is an open source library released under LGPL.