Java Code Examples for com.sun.org.apache.xml.internal.serializer.SerializationHandler#startDocument()

The following examples show how to use com.sun.org.apache.xml.internal.serializer.SerializationHandler#startDocument() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
/************************************************************************
 * Multiple output document extension.
 * See compiler/TransletOutput for actual implementation.
 ************************************************************************/

public SerializationHandler openOutputHandler(String filename, boolean append)
    throws TransletException
{
    try {
        final TransletOutputHandlerFactory factory
            = TransletOutputHandlerFactory.newInstance();

        String dirStr = new File(filename).getParent();
        if ((null != dirStr) && (dirStr.length() > 0)) {
           File dir = new File(dirStr);
           dir.mkdirs();
        }

        factory.setEncoding(_encoding);
        factory.setOutputMethod(_method);
        factory.setOutputStream(new BufferedOutputStream(new FileOutputStream(filename, append)));
        factory.setOutputType(TransletOutputHandlerFactory.STREAM);

        final SerializationHandler handler
            = factory.getSerializationHandler();

        transferOutputSettings(handler);
        handler.startDocument();
        return handler;
    }
    catch (Exception e) {
        throw new TransletException(e);
    }
}
 
Example 2
/************************************************************************
 * Multiple output document extension.
 * See compiler/TransletOutput for actual implementation.
 ************************************************************************/

public SerializationHandler openOutputHandler(String filename, boolean append)
    throws TransletException
{
    try {
        final TransletOutputHandlerFactory factory
            = TransletOutputHandlerFactory.newInstance(_overrideDefaultParser);

        String dirStr = new File(filename).getParent();
        if ((null != dirStr) && (dirStr.length() > 0)) {
           File dir = new File(dirStr);
           dir.mkdirs();
        }

        factory.setEncoding(_encoding);
        factory.setOutputMethod(_method);
        factory.setOutputStream(new BufferedOutputStream(new FileOutputStream(filename, append)));
        factory.setOutputType(TransletOutputHandlerFactory.STREAM);

        final SerializationHandler handler
            = factory.getSerializationHandler();

        transferOutputSettings(handler);
        handler.startDocument();
        return handler;
    }
    catch (Exception e) {
        throw new TransletException(e);
    }
}
 
Example 3
/************************************************************************
 * Multiple output document extension.
 * See compiler/TransletOutput for actual implementation.
 ************************************************************************/

public SerializationHandler openOutputHandler(String filename, boolean append)
    throws TransletException
{
    try {
        final TransletOutputHandlerFactory factory
            = TransletOutputHandlerFactory.newInstance();

        String dirStr = new File(filename).getParent();
        if ((null != dirStr) && (dirStr.length() > 0)) {
           File dir = new File(dirStr);
           dir.mkdirs();
        }

        factory.setEncoding(_encoding);
        factory.setOutputMethod(_method);
        factory.setOutputStream(new BufferedOutputStream(new FileOutputStream(filename, append)));
        factory.setOutputType(TransletOutputHandlerFactory.STREAM);

        final SerializationHandler handler
            = factory.getSerializationHandler();

        transferOutputSettings(handler);
        handler.startDocument();
        return handler;
    }
    catch (Exception e) {
        throw new TransletException(e);
    }
}
 
Example 4
Source Project: JDKSourceCode1.8   File: AbstractTranslet.java    License: MIT License 5 votes vote down vote up
/************************************************************************
 * Multiple output document extension.
 * See compiler/TransletOutput for actual implementation.
 ************************************************************************/

public SerializationHandler openOutputHandler(String filename, boolean append)
    throws TransletException
{
    try {
        final TransletOutputHandlerFactory factory
            = TransletOutputHandlerFactory.newInstance(_overrideDefaultParser);

        String dirStr = new File(filename).getParent();
        if ((null != dirStr) && (dirStr.length() > 0)) {
           File dir = new File(dirStr);
           dir.mkdirs();
        }

        factory.setEncoding(_encoding);
        factory.setOutputMethod(_method);
        factory.setOutputStream(new BufferedOutputStream(new FileOutputStream(filename, append)));
        factory.setOutputType(TransletOutputHandlerFactory.STREAM);

        final SerializationHandler handler
            = factory.getSerializationHandler();

        transferOutputSettings(handler);
        handler.startDocument();
        return handler;
    }
    catch (Exception e) {
        throw new TransletException(e);
    }
}
 
Example 5
/************************************************************************
 * Multiple output document extension.
 * See compiler/TransletOutput for actual implementation.
 ************************************************************************/

public SerializationHandler openOutputHandler(String filename, boolean append)
    throws TransletException
{
    try {
        final TransletOutputHandlerFactory factory
            = TransletOutputHandlerFactory.newInstance(_overrideDefaultParser);

        String dirStr = new File(filename).getParent();
        if ((null != dirStr) && (dirStr.length() > 0)) {
           File dir = new File(dirStr);
           dir.mkdirs();
        }

        factory.setEncoding(_encoding);
        factory.setOutputMethod(_method);
        factory.setOutputStream(new BufferedOutputStream(new FileOutputStream(filename, append)));
        factory.setOutputType(TransletOutputHandlerFactory.STREAM);

        final SerializationHandler handler
            = factory.getSerializationHandler();

        transferOutputSettings(handler);
        handler.startDocument();
        return handler;
    }
    catch (Exception e) {
        throw new TransletException(e);
    }
}
 
Example 6
/************************************************************************
 * Multiple output document extension.
 * See compiler/TransletOutput for actual implementation.
 ************************************************************************/

public SerializationHandler openOutputHandler(String filename, boolean append)
    throws TransletException
{
    try {
        final TransletOutputHandlerFactory factory
            = TransletOutputHandlerFactory.newInstance(_overrideDefaultParser);

        String dirStr = new File(filename).getParent();
        if ((null != dirStr) && (dirStr.length() > 0)) {
           File dir = new File(dirStr);
           dir.mkdirs();
        }

        factory.setEncoding(_encoding);
        factory.setOutputMethod(_method);
        factory.setOutputStream(new BufferedOutputStream(new FileOutputStream(filename, append)));
        factory.setOutputType(TransletOutputHandlerFactory.STREAM);

        final SerializationHandler handler
            = factory.getSerializationHandler();

        transferOutputSettings(handler);
        handler.startDocument();
        return handler;
    }
    catch (Exception e) {
        throw new TransletException(e);
    }
}
 
Example 7
Source Project: Bytecoder   File: AbstractTranslet.java    License: Apache License 2.0 5 votes vote down vote up
/************************************************************************
 * Multiple output document extension.
 * See compiler/TransletOutput for actual implementation.
 ************************************************************************/

public SerializationHandler openOutputHandler(String filename, boolean append)
    throws TransletException
{
    try {
        final TransletOutputHandlerFactory factory = TransletOutputHandlerFactory
                .newInstance(_overrideDefaultParser, _msgHandler.getErrorListener());

        String dirStr = new File(filename).getParent();
        if ((null != dirStr) && (dirStr.length() > 0)) {
           File dir = new File(dirStr);
           dir.mkdirs();
        }

        output = new FileOutputStream(filename, append);
        factory.setEncoding(_encoding);
        factory.setOutputMethod(_method);
        factory.setOutputStream(new BufferedOutputStream(output));
        factory.setOutputType(TransletOutputHandlerFactory.STREAM);

        final SerializationHandler handler
            = factory.getSerializationHandler();

        transferOutputSettings(handler);
        handler.startDocument();
        return handler;
    }
    catch (Exception e) {
        throw new TransletException(e);
    }
}
 
Example 8
/************************************************************************
 * Multiple output document extension.
 * See compiler/TransletOutput for actual implementation.
 ************************************************************************/

public SerializationHandler openOutputHandler(String filename, boolean append)
    throws TransletException
{
    try {
        final TransletOutputHandlerFactory factory
            = TransletOutputHandlerFactory.newInstance();

        String dirStr = new File(filename).getParent();
        if ((null != dirStr) && (dirStr.length() > 0)) {
           File dir = new File(dirStr);
           dir.mkdirs();
        }

        output = new FileOutputStream(filename, append);
        factory.setEncoding(_encoding);
        factory.setOutputMethod(_method);
        factory.setOutputStream(new BufferedOutputStream(output));
        factory.setOutputType(TransletOutputHandlerFactory.STREAM);

        final SerializationHandler handler
            = factory.getSerializationHandler();

        transferOutputSettings(handler);
        handler.startDocument();
        return handler;
    }
    catch (Exception e) {
        throw new TransletException(e);
    }
}
 
Example 9
/************************************************************************
 * Multiple output document extension.
 * See compiler/TransletOutput for actual implementation.
 ************************************************************************/

public SerializationHandler openOutputHandler(String filename, boolean append)
    throws TransletException
{
    try {
        final TransletOutputHandlerFactory factory
            = TransletOutputHandlerFactory.newInstance();

        String dirStr = new File(filename).getParent();
        if ((null != dirStr) && (dirStr.length() > 0)) {
           File dir = new File(dirStr);
           dir.mkdirs();
        }

        factory.setEncoding(_encoding);
        factory.setOutputMethod(_method);
        factory.setOutputStream(new BufferedOutputStream(new FileOutputStream(filename, append)));
        factory.setOutputType(TransletOutputHandlerFactory.STREAM);

        final SerializationHandler handler
            = factory.getSerializationHandler();

        transferOutputSettings(handler);
        handler.startDocument();
        return handler;
    }
    catch (Exception e) {
        throw new TransletException(e);
    }
}
 
Example 10
/************************************************************************
 * Multiple output document extension.
 * See compiler/TransletOutput for actual implementation.
 ************************************************************************/

public SerializationHandler openOutputHandler(String filename, boolean append)
    throws TransletException
{
    try {
        final TransletOutputHandlerFactory factory
            = TransletOutputHandlerFactory.newInstance();

        String dirStr = new File(filename).getParent();
        if ((null != dirStr) && (dirStr.length() > 0)) {
           File dir = new File(dirStr);
           dir.mkdirs();
        }

        factory.setEncoding(_encoding);
        factory.setOutputMethod(_method);
        factory.setOutputStream(new BufferedOutputStream(new FileOutputStream(filename, append)));
        factory.setOutputType(TransletOutputHandlerFactory.STREAM);

        final SerializationHandler handler
            = factory.getSerializationHandler();

        transferOutputSettings(handler);
        handler.startDocument();
        return handler;
    }
    catch (Exception e) {
        throw new TransletException(e);
    }
}
 
Example 11
/************************************************************************
 * Multiple output document extension.
 * See compiler/TransletOutput for actual implementation.
 ************************************************************************/

public SerializationHandler openOutputHandler(String filename, boolean append)
    throws TransletException
{
    try {
        final TransletOutputHandlerFactory factory
            = TransletOutputHandlerFactory.newInstance();

        String dirStr = new File(filename).getParent();
        if ((null != dirStr) && (dirStr.length() > 0)) {
           File dir = new File(dirStr);
           dir.mkdirs();
        }

        factory.setEncoding(_encoding);
        factory.setOutputMethod(_method);
        factory.setOutputStream(new BufferedOutputStream(new FileOutputStream(filename, append)));
        factory.setOutputType(TransletOutputHandlerFactory.STREAM);

        final SerializationHandler handler
            = factory.getSerializationHandler();

        transferOutputSettings(handler);
        handler.startDocument();
        return handler;
    }
    catch (Exception e) {
        throw new TransletException(e);
    }
}