FileDocCategorySizeDatePackage
SerializerFactoryImpl.javaAPI DocApache Xerces 3.0.13988Fri Sep 14 20:33:56 BST 2007org.apache.xml.serialize

SerializerFactoryImpl

public final class SerializerFactoryImpl extends SerializerFactory
Default serializer factory can construct serializers for the three markup serializers (XML, HTML, XHTML ).
deprecated
This class was deprecated in Xerces 2.9.0. It is recommended that new applications use the DOM Level 3 LSSerializer or JAXP's Transformation API for XML (TrAX) for serializing XML and HTML. See the Xerces documentation for more information.
version
$Revision: 476047 $ $Date: 2006-11-16 23:27:45 -0500 (Thu, 16 Nov 2006) $
author
Scott Boag
author
Assaf Arkin

Fields Summary
private String
_method
Constructors Summary
SerializerFactoryImpl(String method)

        _method = method;
        if ( ! _method.equals( Method.XML ) &&
             ! _method.equals( Method.HTML ) &&
             ! _method.equals( Method.XHTML ) &&
             ! _method.equals( Method.TEXT ) ) {
            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.SERIALIZER_DOMAIN, "MethodNotSupported", new Object[]{method});
            throw new IllegalArgumentException(msg);
        }
    
Methods Summary
private SerializergetSerializer(OutputFormat format)

        if ( _method.equals( Method.XML ) ) {
            return new XMLSerializer( format );
        } else if ( _method.equals( Method.HTML ) ) {
            return new HTMLSerializer( format );
        }  else if ( _method.equals( Method.XHTML ) ) {
            return new XHTMLSerializer( format );
        }  else if ( _method.equals( Method.TEXT ) ) {
            return new TextSerializer();
        } else {
            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.SERIALIZER_DOMAIN, "MethodNotSupported", new Object[]{_method});
            throw new IllegalStateException(msg);
        }
    
protected java.lang.StringgetSupportedMethod()

        return _method;
    
public SerializermakeSerializer(OutputFormat format)

        Serializer serializer;
        
        serializer = getSerializer( format );
        serializer.setOutputFormat( format );
        return serializer;
    
public SerializermakeSerializer(java.io.Writer writer, OutputFormat format)

        Serializer serializer;
        
        serializer = getSerializer( format );
        serializer.setOutputCharStream( writer );
        return serializer;
    
public SerializermakeSerializer(java.io.OutputStream output, OutputFormat format)

        Serializer serializer;
        
        serializer = getSerializer( format );
        serializer.setOutputByteStream( output );
        return serializer;