Examples of SMOutputDocument


Examples of org.codehaus.staxmate.out.SMOutputDocument

  }

  @Override
  public void serialize( @NotNull T object, @NotNull OutputStream out ) throws IOException {
    try {
      SMOutputDocument doc = StaxMateSupport.getSmOutputFactory().createOutputDocument( out );

      String nameSpaceUri = getNameSpaceUri();
      SMNamespace nameSpace = doc.getNamespace( nameSpaceUri );

      SMOutputElement root = doc.addElement( nameSpace, getDefaultElementName() );
      serialize( root, object );
      doc.closeRoot();
    } catch ( XMLStreamException e ) {
      throw new IOException( e );
    }
  }
View Full Code Here

Examples of org.codehaus.staxmate.out.SMOutputDocument

  }

  @Override
  public void serialize( @NotNull T object, @NotNull OutputStream out ) throws IOException {
    try {
      SMOutputDocument doc = StaxMateSupport.getSmOutputFactory().createOutputDocument( out );
      serializeFormatVersion( doc, getFormatVersion() );

      SMOutputElement root = doc.addElement( getDefaultElementName() );
      serialize( root, object );
      doc.closeRoot();
    } catch ( XMLStreamException e ) {
      throw new IOException( e );
    }
  }
View Full Code Here

Examples of org.codehaus.staxmate.out.SMOutputDocument

  @Override
  public void serialize( @Nonnull T object, @Nonnull OutputStream out ) throws IOException {
    try {
      SMOutputFactory factory = StaxMateSupport.getSmOutputFactory();
      SMOutputDocument doc = factory.createOutputDocument( out );
      if (! StaxMateSupport.isJsonEnabled() ) {
        doc.setIndentation( INDENT_STR, 1, 2 );
      }

      String nameSpaceUri = getNameSpace();
      SMNamespace nameSpace = doc.getNamespace( nameSpaceUri );

      SMOutputElement root = doc.addElement( nameSpace, getDefaultElementName() );
      serialize( root, object, getFormatVersion() );
      doc.closeRoot();
    } catch ( XMLStreamException e ) {
      throw new IOException( e );
    }
  }
View Full Code Here

Examples of org.codehaus.staxmate.out.SMOutputDocument

  }

  @Override
  public void serialize( @NotNull T object, @NotNull OutputStream out, @Nullable C context ) throws IOException {
    try {
      SMOutputDocument doc = StaxMateSupport.getSmOutputFactory().createOutputDocument( out );
      serializeFormatVersion( doc, getFormatVersion() );

      SMOutputElement root = doc.addElement( getDefaultElementName() );
      serialize( root, object, context );
      doc.closeRoot();
    } catch ( XMLStreamException e ) {
      throw new IOException( e );
    }
  }
View Full Code Here

Examples of org.codehaus.staxmate.out.SMOutputDocument

  }

  @Override
  public void serialize( @NotNull T object, @NotNull OutputStream out, @Nullable Lookup context ) throws IOException {
    try {
      SMOutputDocument doc = StaxSupport.getSmOutputFactory().createOutputDocument( out );
      //    doc.setIndentation( "\n  ", 1, 2 );
      SMOutputElement root = doc.addElement( getDefaultElementName() );
      serialize( root, object, context != null ? context : Lookups.emtyLookup() );
      doc.closeRoot();
    } catch ( XMLStreamException e ) {
      throw new IOException( e );
    }
  }
View Full Code Here

Examples of org.codehaus.staxmate.out.SMOutputDocument

  }

  @Override
  public void serialize( @Nonnull T object, @Nonnull OutputStream out ) throws IOException {
    try {
      SMOutputDocument doc = StaxMateSupport.getSmOutputFactory().createOutputDocument( out );

      String nameSpaceUri = getNameSpace();
      SMNamespace nameSpace = doc.getNamespace( nameSpaceUri );

      SMOutputElement root = doc.addElement( nameSpace, getDefaultElementName() );
      serialize( root, object, getFormatVersion() );
      doc.closeRoot();
    } catch ( XMLStreamException e ) {
      throw new IOException( e );
    }
  }
View Full Code Here

Examples of org.codehaus.staxmate.out.SMOutputDocument

  }
 
  @Override
  public void serialize( @NotNull T object, @NotNull OutputStream out ) throws IOException {
    try {
      SMOutputDocument doc = StaxMateSupport.getSmOutputFactory().createOutputDocument( out );

      String nameSpaceUri = createNameSpaceUri( getFormatVersion() );
      SMNamespace nameSpace = doc.getNamespace( nameSpaceUri );

      SMOutputElement root = doc.addElement( nameSpace, getDefaultElementName() );
      serialize( root, object );
      doc.closeRoot();
    } catch ( XMLStreamException e ) {
      throw new IOException( e );
    }
  }
View Full Code Here

Examples of org.codehaus.staxmate.out.SMOutputDocument

  }

  @Override
  public void serialize( @NotNull T object, @NotNull OutputStream out, @Nullable Lookup context ) throws IOException {
    try {
      SMOutputDocument doc = StaxSupport.getSmOutputFactory().createOutputDocument( out );
      serializeFormatVersion( doc, getFormatVersion() );

      SMOutputElement root = doc.addElement( getDefaultElementName() );
      serialize( root, object, context != null ? context : Lookups.emtyLookup() );
      doc.closeRoot();
    } catch ( XMLStreamException e ) {
      throw new IOException( e );
    }
  }
View Full Code Here

Examples of org.codehaus.staxmate.out.SMOutputDocument

  @Override
  public void serialize( @Nonnull T object, @Nonnull OutputStream out ) throws IOException {
    try {
      SMOutputFactory factory = StaxMateSupport.getSmOutputFactory();
      SMOutputDocument doc = factory.createOutputDocument( out );
      if (! StaxMateSupport.isJsonEnabled() ) {
        doc.setIndentation( INDENT_STR, 1, 2 );
      }

      String nameSpaceUri = getNameSpace();
      SMNamespace nameSpace = doc.getNamespace( nameSpaceUri );

      SMOutputElement root = doc.addElement( nameSpace, getDefaultElementName() );
      serialize( root, object, getFormatVersion() );
      doc.closeRoot();
    } catch ( XMLStreamException e ) {
      throw new IOException( e );
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.