//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v1.0.6-b27-fcs
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2012.06.11 at 10:33:54 AM PDT
//
package com.sun.identity.federation.jaxb.entityconfig.impl.runtime;
import java.util.ArrayList;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
/**
* Receives SAX2 events and send the equivalent events to
* {@link com.sun.xml.bind.serializer.XMLSerializer}
*
* @author
* Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
*/
public class ContentHandlerAdaptor implements ContentHandler {
/** Stores newly declared prefix-URI mapping. */
private final ArrayList prefixMap = new ArrayList();
/** Events will be sent to this object. */
private final XMLSerializer serializer;
private final StringBuffer text = new StringBuffer();
public ContentHandlerAdaptor( XMLSerializer _serializer ) {
this.serializer = _serializer;
}
public void startDocument() throws SAXException {
prefixMap.clear();
}
public void endDocument() throws SAXException {
}
public void startPrefixMapping(String prefix, String uri) throws SAXException {
prefixMap.add(prefix);
prefixMap.add(uri);
}
public void endPrefixMapping(String prefix) throws SAXException {
}
public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
throws SAXException {
flushText();
int len = atts.getLength();
serializer.startElement(namespaceURI,localName);
// declare namespace events
for( int i=0; i