Package org.codehaus.staxmate.out

Examples of org.codehaus.staxmate.out.SMOutputElement


    SMOutputElement collectionElement = serializeTo.addElement( serializeTo.getNamespace(), collectionElementName );
    serializeCollection( objects, type, elementName, collectionElement, formatVersion );
  }

  protected <T> void serializeCollectionToElement( @NotNull Iterable<? extends T> objects, @NotNull Class<T> type, @NotNull @NonNls String collectionElementName, @NotNull SMOutputElement serializeTo, Version formatVersion ) throws XMLStreamException, IOException {
    SMOutputElement collectionElement = serializeTo.addElement( serializeTo.getNamespace(), collectionElementName );
    serializeCollection( objects, type, collectionElement, formatVersion );
  }
View Full Code Here


    serializeTo.addAttribute( ATTRIBUTE_DEPENDENT, String.valueOf( object.isDependentType() ) );
    serializeTo.addElement( serializeTo.getNamespace(), ELEMENT_ID ).addCharacters( object.getId() );
    serializeTo.addElement( serializeTo.getNamespace(), ELEMENT_CONTENT_TYPE ).addCharacters( object.getContentType() );

    for ( Extension extension : object.getExtensions() ) {
      SMOutputElement extensionElement = serializeTo.addElement( serializeTo.getNamespace(), ELEMENT_EXTENSION );

      if ( object.isDefaultExtension( extension ) ) {
        extensionElement.addAttribute( ATTRIBUTE_DEFAULT, String.valueOf( true ) );
      }

      serialize( extension, Extension.class, extensionElement, formatVersion );
    }
  }
View Full Code Here

  @Override
  public void serialize( @NotNull SMOutputElement serializeTo, @NotNull Application object, @NotNull Version formatVersion ) throws IOException, XMLStreamException {
    assert isVersionWritable( formatVersion );
    serializeTo.addElement( serializeTo.getNamespace(), ELEMENT_NAME ).addCharacters( object.getName() );

    SMOutputElement versionElement = serializeTo.addElement( serializeTo.getNamespace(), ELEMENT_VERSION );
    serialize( object.getVersion(), Version.class, versionElement, formatVersion );
  }
View Full Code Here

      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

   * @throws IOException
   */
  protected <T> void serializeCollection( @NotNull Iterable<? extends T> objects, @NotNull Class<T> type, @NotNull @NonNls String elementName, @NotNull SMOutputElement serializeTo ) throws XMLStreamException, IOException {
    AbstractXmlSerializer<? super T, SMOutputElement, XMLStreamReader, XMLStreamException> serializer = getSerializer( type );
    for ( T object : objects ) {
      SMOutputElement doorElement = serializeTo.addElement( serializeTo.getNamespace(), elementName );
      serializer.serialize( doorElement, object );
    }
  }
View Full Code Here

  }

  protected <T> void serializeCollection( @NotNull Iterable<? extends T> objects, @NotNull Class<T> type, @NotNull SMOutputElement serializeTo ) throws XMLStreamException, IOException {
    AbstractXmlSerializer<? super T, SMOutputElement, XMLStreamReader, XMLStreamException> serializer = getSerializer( type );
    for ( T object : objects ) {
      SMOutputElement doorElement = serializeTo.addElement( serializeTo.getNamespace(), serializer.getDefaultElementName() );
      serializer.serialize( doorElement, object );
    }
  }
View Full Code Here

   * @param serializeTo           the object the elements are serialized to
   * @throws XMLStreamException
   * @throws IOException
   */
  protected <T> void serializeCollectionToElement( @NotNull Iterable<? extends T> objects, @NotNull Class<T> type, @NotNull @NonNls String collectionElementName, @NotNull @NonNls String elementName, @NotNull SMOutputElement serializeTo ) throws XMLStreamException, IOException {
    SMOutputElement collectionElement = serializeTo.addElement( serializeTo.getNamespace(), collectionElementName );
    serializeCollection( objects, type, elementName, collectionElement );
  }
View Full Code Here

    SMOutputElement collectionElement = serializeTo.addElement( serializeTo.getNamespace(), collectionElementName );
    serializeCollection( objects, type, elementName, collectionElement );
  }

  protected <T> void serializeCollectionToElement( @NotNull Iterable<? extends T> objects, @NotNull Class<T> type, @NotNull @NonNls String collectionElementName, @NotNull SMOutputElement serializeTo ) throws XMLStreamException, IOException {
    SMOutputElement collectionElement = serializeTo.addElement( serializeTo.getNamespace(), collectionElementName );
    serializeCollection( objects, type, collectionElement );
  }
View Full Code Here

    serializeTo.addAttribute( ATTRIBUTE_DEPENDENT, String.valueOf( object.isDependentType() ) );
    serializeTo.addElement( serializeTo.getNamespace(), ELEMENT_ID ).addCharacters( object.getId() );
    serializeTo.addElement( serializeTo.getNamespace(), ELEMENT_CONTENT_TYPE ).addCharacters( object.getContentType() );

    for ( Extension extension : object.getExtensions() ) {
      SMOutputElement extensionElement = serializeTo.addElement( serializeTo.getNamespace(), ELEMENT_EXTENSION );

      if ( object.isDefaultExtension( extension ) ) {
        extensionElement.addAttribute( ATTRIBUTE_DEFAULT, String.valueOf( true ) );
      }

      serialize( extension, Extension.class, extensionElement, formatVersion );
    }
  }
View Full Code Here

  @Override
  public void serialize( @Nonnull SMOutputElement serializeTo, @Nonnull Application object, @Nonnull Version formatVersion ) throws IOException, XMLStreamException {
    assert isVersionWritable( formatVersion );
    serializeTo.addElement( serializeTo.getNamespace(), ELEMENT_NAME ).addCharacters( object.getName() );

    SMOutputElement versionElement = serializeTo.addElement( serializeTo.getNamespace(), ELEMENT_VERSION );
    serialize( object.getVersion(), Version.class, versionElement, formatVersion );
  }
View Full Code Here

TOP

Related Classes of org.codehaus.staxmate.out.SMOutputElement

Copyright © 2018 www.massapicom. 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.