FileDocCategorySizeDatePackage
SerializerFactoryImpl.javaAPI DocJava SE 5 API5507Fri Aug 26 14:56:02 BST 2005com.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.7 $ $Date: 2002/07/22 18:08:02 $
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;