protected XMLStreamWriter filter(XMLStreamWriter writer) { if (indenting) { IndentingXMLStreamWriter indenter = new IndentingXMLStreamWriter(writer); indenter.setNewLine(newLine); indenter.setIndent(indent); writer = indenter; } return writer; }
/** * Method write * * @param writer * @param model */ public void write(Writer writer, Model model) throws java.io.IOException, XMLStreamException { XMLOutputFactory factory = XMLOutputFactory.newInstance(); boolean supportWindowsLineEndings = false; if ( factory.isPropertySupported( "com.ctc.wstx.outputEscapeCr" ) ) { factory.setProperty( "com.ctc.wstx.outputEscapeCr", Boolean.FALSE ); supportWindowsLineEndings = true; } if ( factory.isPropertySupported( "org.codehaus.stax2.automaticEmptyElements" ) ) { factory.setProperty( "org.codehaus.stax2.automaticEmptyElements", Boolean.FALSE ); } IndentingXMLStreamWriter serializer = new IndentingXMLStreamWriter( factory.createXMLStreamWriter( writer ) ); if ( supportWindowsLineEndings ) { serializer.setNewLine( serializer.getLineSeparator() ); } serializer.writeStartDocument( model.getModelEncoding(), "1.0" ); writeModel( model, "project", serializer ); serializer.writeEndDocument(); } //-- void write(Writer, Model)
/** * Method write * * @param writer * @param userDatabase */ public void write(Writer writer, UserDatabase userDatabase) throws java.io.IOException, XMLStreamException { XMLOutputFactory factory = XMLOutputFactory.newInstance(); boolean supportWindowsLineEndings = false; if ( factory.isPropertySupported( "com.ctc.wstx.outputEscapeCr" ) ) { factory.setProperty( "com.ctc.wstx.outputEscapeCr", Boolean.FALSE ); supportWindowsLineEndings = true; } if ( factory.isPropertySupported( "org.codehaus.stax2.automaticEmptyElements" ) ) { factory.setProperty( "org.codehaus.stax2.automaticEmptyElements", Boolean.FALSE ); } IndentingXMLStreamWriter serializer = new IndentingXMLStreamWriter( factory.createXMLStreamWriter( writer ) ); if ( supportWindowsLineEndings ) { serializer.setNewLine( serializer.getLineSeparator() ); } serializer.writeStartDocument( userDatabase.getModelEncoding(), "1.0" ); writeUserDatabase( userDatabase, "userDatabase", serializer ); serializer.writeEndDocument(); } //-- void write(Writer, UserDatabase)
/** * Method write * * @param writer * @param continuumDatabase */ public void write(Writer writer, ContinuumDatabase continuumDatabase) throws java.io.IOException, XMLStreamException { XMLOutputFactory factory = XMLOutputFactory.newInstance(); boolean supportWindowsLineEndings = false; if ( factory.isPropertySupported( "com.ctc.wstx.outputEscapeCr" ) ) { factory.setProperty( "com.ctc.wstx.outputEscapeCr", Boolean.FALSE ); supportWindowsLineEndings = true; } if ( factory.isPropertySupported( "org.codehaus.stax2.automaticEmptyElements" ) ) { factory.setProperty( "org.codehaus.stax2.automaticEmptyElements", Boolean.FALSE ); } IndentingXMLStreamWriter serializer = new IndentingXMLStreamWriter( factory.createXMLStreamWriter( writer ) ); if ( supportWindowsLineEndings ) { serializer.setNewLine( serializer.getLineSeparator() ); } serializer.writeStartDocument( continuumDatabase.getModelEncoding(), "1.0" ); writeContinuumDatabase( continuumDatabase, "continuumDatabase", serializer ); serializer.writeEndDocument(); } //-- void write(Writer, ContinuumDatabase)
/** * Method write * * @param writer * @param redbackRoleModel */ public void write(Writer writer, RedbackRoleModel redbackRoleModel) throws java.io.IOException, XMLStreamException { XMLOutputFactory factory = XMLOutputFactory.newInstance(); boolean supportWindowsLineEndings = false; if ( factory.isPropertySupported( "com.ctc.wstx.outputEscapeCr" ) ) { factory.setProperty( "com.ctc.wstx.outputEscapeCr", Boolean.FALSE ); supportWindowsLineEndings = true; } if ( factory.isPropertySupported( "org.codehaus.stax2.automaticEmptyElements" ) ) { factory.setProperty( "org.codehaus.stax2.automaticEmptyElements", Boolean.FALSE ); } IndentingXMLStreamWriter serializer = new IndentingXMLStreamWriter( factory.createXMLStreamWriter( writer ) ); if ( supportWindowsLineEndings ) { serializer.setNewLine( serializer.getLineSeparator() ); } serializer.writeStartDocument( redbackRoleModel.getModelEncoding(), "1.0" ); writeRedbackRoleModel( redbackRoleModel, "redback-role-model", serializer ); serializer.writeEndDocument(); } //-- void write(Writer, RedbackRoleModel)
/** * Method write * * @param writer * @param rbacDatabase */ public void write(Writer writer, RbacDatabase rbacDatabase) throws java.io.IOException, XMLStreamException { XMLOutputFactory factory = XMLOutputFactory.newInstance(); boolean supportWindowsLineEndings = false; if ( factory.isPropertySupported( "com.ctc.wstx.outputEscapeCr" ) ) { factory.setProperty( "com.ctc.wstx.outputEscapeCr", Boolean.FALSE ); supportWindowsLineEndings = true; } if ( factory.isPropertySupported( "org.codehaus.stax2.automaticEmptyElements" ) ) { factory.setProperty( "org.codehaus.stax2.automaticEmptyElements", Boolean.FALSE ); } IndentingXMLStreamWriter serializer = new IndentingXMLStreamWriter( factory.createXMLStreamWriter( writer ) ); if ( supportWindowsLineEndings ) { serializer.setNewLine( serializer.getLineSeparator() ); } serializer.writeStartDocument( rbacDatabase.getModelEncoding(), "1.0" ); writeRbacDatabase( rbacDatabase, "rbacDatabase", serializer ); serializer.writeEndDocument(); } //-- void write(Writer, RbacDatabase)
if ( supportWindowsLineEndings ) serializer.setNewLine( serializer.getLineSeparator() );
if ( supportWindowsLineEndings ) serializer.setNewLine( serializer.getLineSeparator() );
if ( supportWindowsLineEndings ) serializer.setNewLine( serializer.getLineSeparator() );
if ( supportWindowsLineEndings ) serializer.setNewLine( serializer.getLineSeparator() );
/** * Method write * * @param writer * @param model */ public void write(Writer writer, Model model) throws java.io.IOException, XMLStreamException { XMLOutputFactory factory = XMLOutputFactory.newInstance(); boolean supportWindowsLineEndings = false; if ( factory.isPropertySupported( "com.ctc.wstx.outputEscapeCr" ) ) { factory.setProperty( "com.ctc.wstx.outputEscapeCr", Boolean.FALSE ); supportWindowsLineEndings = true; } if ( factory.isPropertySupported( "org.codehaus.stax2.automaticEmptyElements" ) ) { factory.setProperty( "org.codehaus.stax2.automaticEmptyElements", Boolean.FALSE ); } IndentingXMLStreamWriter serializer = new IndentingXMLStreamWriter( factory.createXMLStreamWriter( writer ) ); if ( supportWindowsLineEndings ) { serializer.setNewLine( serializer.getLineSeparator() ); } serializer.writeStartDocument( model.getModelEncoding(), "1.0" ); writeModel( model, "project", serializer ); serializer.writeEndDocument(); } //-- void write(Writer, Model)
/** * Method write * * @param writer * @param authenticationKeyDatabase */ public void write(Writer writer, AuthenticationKeyDatabase authenticationKeyDatabase) throws java.io.IOException, XMLStreamException { XMLOutputFactory factory = XMLOutputFactory.newInstance(); boolean supportWindowsLineEndings = false; if ( factory.isPropertySupported( "com.ctc.wstx.outputEscapeCr" ) ) { factory.setProperty( "com.ctc.wstx.outputEscapeCr", Boolean.FALSE ); supportWindowsLineEndings = true; } if ( factory.isPropertySupported( "org.codehaus.stax2.automaticEmptyElements" ) ) { factory.setProperty( "org.codehaus.stax2.automaticEmptyElements", Boolean.FALSE ); } IndentingXMLStreamWriter serializer = new IndentingXMLStreamWriter( factory.createXMLStreamWriter( writer ) ); if ( supportWindowsLineEndings ) { serializer.setNewLine( serializer.getLineSeparator() ); } serializer.writeStartDocument( authenticationKeyDatabase.getModelEncoding(), "1.0" ); writeAuthenticationKeyDatabase( authenticationKeyDatabase, "authenticationKeyDatabase", serializer ); serializer.writeEndDocument(); } //-- void write(Writer, AuthenticationKeyDatabase)
/** * Method write * * @param writer * @param userDatabase */ public void write(Writer writer, UserDatabase userDatabase) throws java.io.IOException, XMLStreamException { XMLOutputFactory factory = XMLOutputFactory.newInstance(); boolean supportWindowsLineEndings = false; if ( factory.isPropertySupported( "com.ctc.wstx.outputEscapeCr" ) ) { factory.setProperty( "com.ctc.wstx.outputEscapeCr", Boolean.FALSE ); supportWindowsLineEndings = true; } if ( factory.isPropertySupported( "org.codehaus.stax2.automaticEmptyElements" ) ) { factory.setProperty( "org.codehaus.stax2.automaticEmptyElements", Boolean.FALSE ); } IndentingXMLStreamWriter serializer = new IndentingXMLStreamWriter( factory.createXMLStreamWriter( writer ) ); if ( supportWindowsLineEndings ) { serializer.setNewLine( serializer.getLineSeparator() ); } serializer.writeStartDocument( userDatabase.getModelEncoding(), "1.0" ); writeUserDatabase( userDatabase, "userDatabase", serializer ); serializer.writeEndDocument(); } //-- void write(Writer, UserDatabase)
/** * Method write * * @param writer * @param authenticationKeyDatabase */ public void write(Writer writer, AuthenticationKeyDatabase authenticationKeyDatabase) throws java.io.IOException, XMLStreamException { XMLOutputFactory factory = XMLOutputFactory.newInstance(); boolean supportWindowsLineEndings = false; if ( factory.isPropertySupported( "com.ctc.wstx.outputEscapeCr" ) ) { factory.setProperty( "com.ctc.wstx.outputEscapeCr", Boolean.FALSE ); supportWindowsLineEndings = true; } if ( factory.isPropertySupported( "org.codehaus.stax2.automaticEmptyElements" ) ) { factory.setProperty( "org.codehaus.stax2.automaticEmptyElements", Boolean.FALSE ); } IndentingXMLStreamWriter serializer = new IndentingXMLStreamWriter( factory.createXMLStreamWriter( writer ) ); if ( supportWindowsLineEndings ) { serializer.setNewLine( serializer.getLineSeparator() ); } serializer.writeStartDocument( authenticationKeyDatabase.getModelEncoding(), "1.0" ); writeAuthenticationKeyDatabase( authenticationKeyDatabase, "authenticationKeyDatabase", serializer ); serializer.writeEndDocument(); } //-- void write(Writer, AuthenticationKeyDatabase)
if ( supportWindowsLineEndings ) serializer.setNewLine( serializer.getLineSeparator() );