FileDocCategorySizeDatePackage
SerializerFactoryImpl.javaAPI DocJava SE 6 API3439Tue Jun 10 00:23:06 BST 2008com.sun.org.apache.xml.internal.serialize

SerializerFactoryImpl

public final class SerializerFactoryImpl extends SerializerFactory
Default serializer factory can construct serializers for the three markup serializers (XML, HTML, XHTML ).
version
$Revision: 1.2.6.1 $ $Date: 2005/09/09 07:26:17 $
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 com.sun.org.apache.xml.internal.serialize.SerializergetSerializer(com.sun.org.apache.xml.internal.serialize.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 com.sun.org.apache.xml.internal.serialize.SerializermakeSerializer(com.sun.org.apache.xml.internal.serialize.OutputFormat format)

        Serializer serializer;
        
        serializer = getSerializer( format );
        serializer.setOutputFormat( format );
        return serializer;
    
public com.sun.org.apache.xml.internal.serialize.SerializermakeSerializer(java.io.Writer writer, com.sun.org.apache.xml.internal.serialize.OutputFormat format)

        Serializer serializer;
        
        serializer = getSerializer( format );
        serializer.setOutputCharStream( writer );
        return serializer;
    
public com.sun.org.apache.xml.internal.serialize.SerializermakeSerializer(java.io.OutputStream output, com.sun.org.apache.xml.internal.serialize.OutputFormat format)

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