Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  // =================== DO NOT EDIT THIS FILE ====================
  // Generated by Modello 1.7,
  // any modifications will be overwritten.
  // ==============================================================
  
  package org.sonatype.nexus.plugins.capabilities.internal.config.persistence.io.xpp3;
  
    //---------------------------------/
   //- Imported classes and packages -/
 //---------------------------------/
 
 import java.io.Writer;
 import  org.codehaus.plexus.util.xml.pull.MXSerializer;
 import  org.codehaus.plexus.util.xml.pull.XmlSerializer;
Class NexusCapabilitiesConfigurationXpp3Writer.

Version:
$Revision$ $Date$
 
 @SuppressWarnings"all" )
 {
 
       //--------------------------/
      //- Class/Member Variables -/
     //--------------------------/
 
    
Field NAMESPACE.
 
     private static final String NAMESPACE = null;
 
 
       //-----------/
      //- Methods -/
     //-----------/
 
    
Method write.

Parameters:
writer
configuration
Throws:
java.io.IOException
 
     public void writeWriter writerConfiguration configuration )
         throws java.io.IOException
     {
         XmlSerializer serializer = new MXSerializer();
         serializer.setProperty( "http://xmlpull.org/v1/doc/properties.html#serializer-indentation""  " );
         serializer.setProperty( "http://xmlpull.org/v1/doc/properties.html#serializer-line-separator""\n" );
         serializer.setOutput( writer );
         serializer.startDocument( configuration.getModelEncoding(), null );
         writeConfigurationconfiguration"capabilitiesConfiguration"serializer );
         serializer.endDocument();
     } //-- void write( Writer, Configuration )
 
    
Method write.

Parameters:
stream
configuration
Throws:
java.io.IOException
 
     public void writeOutputStream streamConfiguration configuration )
         throws java.io.IOException
     {
         XmlSerializer serializer = new MXSerializer();
         serializer.setProperty( "http://xmlpull.org/v1/doc/properties.html#serializer-indentation""  " );
         serializer.setProperty( "http://xmlpull.org/v1/doc/properties.html#serializer-line-separator""\n" );
         serializer.setOutput( streamconfiguration.getModelEncoding() );
         serializer.startDocument( configuration.getModelEncoding(), null );
         writeConfigurationconfiguration"capabilitiesConfiguration"serializer );
         serializer.endDocument();
     } //-- void write( OutputStream, Configuration )
 
    
Method writeCCapability.

Parameters:
cCapability
serializer
tagName
Throws:
java.io.IOException
 
     private void writeCCapabilityCCapability cCapabilityString tagName, XmlSerializer serializer )
         throws java.io.IOException
     {
         serializer.startTag( tagName );
         if ( cCapability.getVersion() != 0 )
         {
             serializer.startTag( "version" ).text( String.valueOfcCapability.getVersion() ) ).endTag( "version" );
         }
         if ( cCapability.getId() != null )
         {
            serializer.startTag( "id" ).text( cCapability.getId() ).endTag( "id" );
        }
        if ( cCapability.getNotes() != null )
        {
            serializer.startTag( "notes" ).text( cCapability.getNotes() ).endTag( "notes" );
        }
        if ( cCapability.isEnabled() != true )
        {
            serializer.startTag( "enabled" ).text( String.valueOfcCapability.isEnabled() ) ).endTag( "enabled" );
        }
        if ( cCapability.getTypeId() != null )
        {
            serializer.startTag( "typeId" ).text( cCapability.getTypeId() ).endTag( "typeId" );
        }
        if ( ( cCapability.getProperties() != null ) && ( cCapability.getProperties().size() > 0 ) )
        {
            serializer.startTag( "properties" );
            for ( Iterator iter = cCapability.getProperties().iterator(); iter.hasNext(); )
            {
                CCapabilityProperty o = (CCapabilityPropertyiter.next();
                writeCCapabilityPropertyo"property"serializer );
            }
            serializer.endTag( "properties" );
        }
        serializer.endTag( tagName );
    } //-- void writeCCapability( CCapability, String, XmlSerializer )

    
Method writeCCapabilityProperty.

Parameters:
cCapabilityProperty
serializer
tagName
Throws:
java.io.IOException
    private void writeCCapabilityPropertyCCapabilityProperty cCapabilityPropertyString tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( tagName );
        if ( cCapabilityProperty.getKey() != null )
        {
            serializer.startTag( "key" ).text( cCapabilityProperty.getKey() ).endTag( "key" );
        }
        if ( cCapabilityProperty.getValue() != null )
        {
            serializer.startTag( "value" ).text( cCapabilityProperty.getValue() ).endTag( "value" );
        }
        serializer.endTag( tagName );
    } //-- void writeCCapabilityProperty( CCapabilityProperty, String, XmlSerializer )

    
Method writeConfiguration.

Parameters:
configuration
serializer
tagName
Throws:
java.io.IOException
    private void writeConfigurationConfiguration configurationString tagName, XmlSerializer serializer )
        throws java.io.IOException
    {
        serializer.startTag( tagName );
        if ( configuration.getVersion() != null )
        {
            serializer.startTag( "version" ).text( configuration.getVersion() ).endTag( "version" );
        }
        if ( ( configuration.getCapabilities() != null ) && ( configuration.getCapabilities().size() > 0 ) )
        {
            serializer.startTag( "capabilities" );
            for ( Iterator iter = configuration.getCapabilities().iterator(); iter.hasNext(); )
            {
                CCapability o = (CCapabilityiter.next();
                writeCCapabilityo"capability"serializer );
            }
            serializer.endTag( "capabilities" );
        }
        serializer.endTag( tagName );
    } //-- void writeConfiguration( Configuration, String, XmlSerializer )
New to GrepCode? Check out our FAQ X