org.apache.jetspeed.rewriter.xml
Class SaxParserAdaptor

java.lang.Object
  extended by org.apache.jetspeed.rewriter.xml.SaxParserAdaptor
All Implemented Interfaces:
ParserAdaptor

public class SaxParserAdaptor
extends Object
implements ParserAdaptor

SaxParserAdaptor

Version:
$Id: SaxParserAdaptor.java 516448 2007-03-09 16:25:47Z ate $
Author:
David Sean Taylor

Nested Class Summary
 class SaxParserAdaptor.SaxFormatHandler
          Inner class to handle SAX parsing of XML files
 
Field Summary
private static Map dtds
           
private  String lineSeparator
           
protected static org.apache.commons.logging.Log log
           
private  Rewriter rewriter
           
 
Constructor Summary
SaxParserAdaptor()
           
 
Method Summary
static void clearDtdCache()
           
static Map getDtds()
           
protected  SAXParser getParser()
          Get a Parser from the SAX Parser factory
 void parse(Rewriter rewriter, Reader reader)
          Parses a document from the reader, without actually rewriting URLs.
 void rewrite(Rewriter rewriter, Reader reader, Writer writer)
          Parses and rewrites a document from the reader, rewriting URLs via the rewriter's events to the writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.commons.logging.Log log

lineSeparator

private String lineSeparator

rewriter

private Rewriter rewriter

dtds

private static Map dtds
Constructor Detail

SaxParserAdaptor

public SaxParserAdaptor()
Method Detail

parse

public void parse(Rewriter rewriter,
                  Reader reader)
           throws RewriterException
Description copied from interface: ParserAdaptor
Parses a document from the reader, without actually rewriting URLs. During parsing the events are called back on the given rewriter to handle the normalized events.

Specified by:
parse in interface ParserAdaptor
reader - the input stream over the content to be parsed.
Throws:
RewriterException

rewrite

public void rewrite(Rewriter rewriter,
                    Reader reader,
                    Writer writer)
             throws RewriterException
Description copied from interface: ParserAdaptor
Parses and rewrites a document from the reader, rewriting URLs via the rewriter's events to the writer. During parsing the rewriter events are called on the given rewriter to handle the rewriting.

Specified by:
rewrite in interface ParserAdaptor
reader - the input stream over the content to be parsed.
writer - the output stream where content is rewritten to.
Throws:
RewriterException

getParser

protected SAXParser getParser()
                       throws ParserConfigurationException,
                              SAXException
Get a Parser from the SAX Parser factory

Returns:
A SAXParser
Throws:
ParserConfigurationException
SAXException

getDtds

public static Map getDtds()

clearDtdCache

public static void clearDtdCache()


Copyright © 1999-2007 Apache Software Foundation. All Rights Reserved.