org.codehaus.mojo.freeform.writer
Class ProjectWriter

java.lang.Object
  extended by org.codehaus.mojo.freeform.writer.ProjectWriter

public class ProjectWriter
extends java.lang.Object

This class represents the Writer for a Netbeans Freeform Project descriptor.

Author:
Rapha??l Pi??roni

Field Summary
static java.lang.String ACTION_TAG
           
static java.lang.String ARITY_TAG
           
static java.lang.String CONTEXT_TAG
           
static java.lang.String FOLDER_TAG
           
static java.lang.String FORMAT_TAG
           
static java.lang.String NAME_ATTR
           
static java.lang.String ONE_FILE_ONLY_TAG
           
static java.lang.String PATTERN_TAG
           
static java.lang.String PROPERTY_TAG
           
static java.lang.String SCRIPT_TAG
           
static java.lang.String SEPARATED_FILES_TAG
           
static java.lang.String TARGET_TAG
           
 
Constructor Summary
ProjectWriter(FreeformProject freeformProject, java.io.File projectFile, org.apache.maven.project.MavenProject mavenProject, org.apache.maven.plugin.logging.Log log)
          Creates a new instance of ProjectWriter.
 
Method Summary
 void write()
          This is the main method called on the Class for writing the project descriptor file.
protected  void writeCompilationUnit(CompilationUnit compilationUnit, org.codehaus.plexus.util.xml.XMLWriter writer)
          This method write an CompilationUnit to the given XMLWriter.
protected  void writeCompilationUnits(java.util.List compilationUnits, org.codehaus.plexus.util.xml.XMLWriter writer)
          This method write a List of CompilationUnits to the given XMLWriter.
protected  void writeContextMenuItem(ContextMenuItem contextMenuItem, org.codehaus.plexus.util.xml.XMLWriter writer)
          This method write a ContextMenuItem to the given XMLWriter.
protected  void writeContextMenuItem(CustomisedContextMenuItem contextMenuItem, org.codehaus.plexus.util.xml.XMLWriter writer)
          This method write a CustomisedContextMenuItem to the given XMLWriter.
protected  void writeContextMenuItem(IdeContextMenuItem contextMenuItem, org.codehaus.plexus.util.xml.XMLWriter writer)
          This method write an IdeContextMenuItem to the given XMLWriter.
protected  void writeContextMenuItems(java.util.List contextMenuItems, org.codehaus.plexus.util.xml.XMLWriter writer)
          This method write a List of ContextMenuItems to the given XMLWriter.
protected  void writeIdeAction(NamedNetbeansAction netbeansAction, org.codehaus.plexus.util.xml.XMLWriter writer)
          This method write a NamedNetbeansAction to the given XMLWriter.
protected  void writeIdeAction(NetbeansAction netbeansAction, org.codehaus.plexus.util.xml.XMLWriter writer)
          This method write a NetbeansAction to the given XMLWriter.
protected  void writeIdeActions(java.util.List netbeansActions, org.codehaus.plexus.util.xml.XMLWriter writer)
          This method write a List of NamedNetbeansActions to the given XMLWriter.
protected  void writeName(java.lang.String name, org.codehaus.plexus.util.xml.XMLWriter writer)
          This method write the name of the project to the given XMLWriter.
protected  void writeProjectXml(org.codehaus.plexus.util.xml.XMLWriter writer)
          This method write the FreeformProject in the XMLWriter.
protected  void writeProperties(java.util.List properties, org.codehaus.plexus.util.xml.XMLWriter writer)
          This method write a List of property to the given XMLWriter.
protected  void writeProperty(FileProperty property, org.codehaus.plexus.util.xml.XMLWriter writer)
          This method write a FileProperty to the given XMLWriter.
protected  void writeProperty(NamedProperty property, org.codehaus.plexus.util.xml.XMLWriter writer)
          This method write a NamedProperty to the given XMLWriter.
protected  void writeProperty(Property property, org.codehaus.plexus.util.xml.XMLWriter writer)
          This method write a Property to the given XMLWriter.
protected  void writeSourceFolder(SourceFolder sourceFolder, org.codehaus.plexus.util.xml.XMLWriter writer)
          This method write a SourceFolder to the given XMLWriter.
protected  void writeSourceFolders(java.util.List sourceFolders, org.codehaus.plexus.util.xml.XMLWriter writer)
          This method write a List of SourceFolders to the given XMLWriter.
protected  void writeSubprojects(java.util.List subprojects, org.codehaus.plexus.util.xml.XMLWriter writer)
          This method write a List of Subproject to the given XMLWriter.
protected  void writeViewItem(FileViewItem viewItem, org.codehaus.plexus.util.xml.XMLWriter writer)
          This method write a FileViewItem to the given XMLWriter.
protected  void writeViewItem(FolderViewItem viewItem, org.codehaus.plexus.util.xml.XMLWriter writer)
          This method write a FolderViewItem to the given XMLWriter.
protected  void writeViewItem(ViewItem viewItem, org.codehaus.plexus.util.xml.XMLWriter writer)
          This method write a ViewItem to the given XMLWriter.
protected  void writeViewItems(java.util.List viewItems, org.codehaus.plexus.util.xml.XMLWriter writer)
          This method write a List of ViewItems to the given XMLWriter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_TAG

public static final java.lang.String ACTION_TAG
See Also:
Constant Field Values

SCRIPT_TAG

public static final java.lang.String SCRIPT_TAG
See Also:
Constant Field Values

TARGET_TAG

public static final java.lang.String TARGET_TAG
See Also:
Constant Field Values

CONTEXT_TAG

public static final java.lang.String CONTEXT_TAG
See Also:
Constant Field Values

PROPERTY_TAG

public static final java.lang.String PROPERTY_TAG
See Also:
Constant Field Values

FOLDER_TAG

public static final java.lang.String FOLDER_TAG
See Also:
Constant Field Values

PATTERN_TAG

public static final java.lang.String PATTERN_TAG
See Also:
Constant Field Values

FORMAT_TAG

public static final java.lang.String FORMAT_TAG
See Also:
Constant Field Values

ARITY_TAG

public static final java.lang.String ARITY_TAG
See Also:
Constant Field Values

SEPARATED_FILES_TAG

public static final java.lang.String SEPARATED_FILES_TAG
See Also:
Constant Field Values

ONE_FILE_ONLY_TAG

public static final java.lang.String ONE_FILE_ONLY_TAG
See Also:
Constant Field Values

NAME_ATTR

public static final java.lang.String NAME_ATTR
See Also:
Constant Field Values
Constructor Detail

ProjectWriter

public ProjectWriter(FreeformProject freeformProject,
                     java.io.File projectFile,
                     org.apache.maven.project.MavenProject mavenProject,
                     org.apache.maven.plugin.logging.Log log)
Creates a new instance of ProjectWriter.

Parameters:
freeformProject - the FreeformProject to write in the file.
projectFile - the project descriptor file to write the FreeformProject in.
mavenProject - The MavenProject
log - The maven plugin logger.
Method Detail

write

public void write()
           throws FreeformPluginException
This is the main method called on the Class for writing the project descriptor file. It creates the XMLWriter for the file.

Throws:
FreeformPluginException - if something goes wrong.

writeCompilationUnit

protected void writeCompilationUnit(CompilationUnit compilationUnit,
                                    org.codehaus.plexus.util.xml.XMLWriter writer)
                             throws FreeformPluginException
This method write an CompilationUnit to the given XMLWriter.

Parameters:
compilationUnit - The CompilationUnit to write.
writer - The XMLWriter to write the CompilationUnit in.
Throws:
FreeformPluginException - if something goes wrong.

writeCompilationUnits

protected void writeCompilationUnits(java.util.List compilationUnits,
                                     org.codehaus.plexus.util.xml.XMLWriter writer)
                              throws FreeformPluginException
This method write a List of CompilationUnits to the given XMLWriter.

Parameters:
compilationUnits - The List of CompilationUnits to write.
writer - The XMLWriter to write the List in.
Throws:
FreeformPluginException - if something goes wrong.

writeContextMenuItem

protected void writeContextMenuItem(ContextMenuItem contextMenuItem,
                                    org.codehaus.plexus.util.xml.XMLWriter writer)
                             throws FreeformPluginException
This method write a ContextMenuItem to the given XMLWriter.

Parameters:
contextMenuItem - The ContextMenuItem to write.
writer - The XMLWriter to write the ContextMenuItem in.
Throws:
FreeformPluginException - if something goes wrong.

writeContextMenuItem

protected void writeContextMenuItem(IdeContextMenuItem contextMenuItem,
                                    org.codehaus.plexus.util.xml.XMLWriter writer)
                             throws FreeformPluginException
This method write an IdeContextMenuItem to the given XMLWriter.

Parameters:
contextMenuItem - The IdeContextMenuItem to write.
writer - The XMLWriter to write the IdeContextMenuItem in.
Throws:
FreeformPluginException - if something goes wrong.

writeContextMenuItem

protected void writeContextMenuItem(CustomisedContextMenuItem contextMenuItem,
                                    org.codehaus.plexus.util.xml.XMLWriter writer)
                             throws FreeformPluginException
This method write a CustomisedContextMenuItem to the given XMLWriter.

Parameters:
contextMenuItem - The CustomisedContextMenuItem to write.
writer - The XMLWriter to write the CustomisedContextMenuItem in.
Throws:
FreeformPluginException - if something goes wrong.

writeContextMenuItems

protected void writeContextMenuItems(java.util.List contextMenuItems,
                                     org.codehaus.plexus.util.xml.XMLWriter writer)
                              throws FreeformPluginException
This method write a List of ContextMenuItems to the given XMLWriter.

Parameters:
contextMenuItems - The List of ContextMenuItems to write.
writer - The XMLWriter to write the List in.
Throws:
FreeformPluginException - if something goes wrong.

writeIdeAction

protected void writeIdeAction(NetbeansAction netbeansAction,
                              org.codehaus.plexus.util.xml.XMLWriter writer)
                       throws FreeformPluginException
This method write a NetbeansAction to the given XMLWriter.

Parameters:
netbeansAction - The NetbeansAction to write.
writer - The XMLWriter to write the NetbeansAction in.
Throws:
FreeformPluginException - if something goes wrong.

writeIdeAction

protected void writeIdeAction(NamedNetbeansAction netbeansAction,
                              org.codehaus.plexus.util.xml.XMLWriter writer)
                       throws FreeformPluginException
This method write a NamedNetbeansAction to the given XMLWriter.

Parameters:
netbeansAction - The NamedNetbeansAction to write.
writer - The XMLWriter to write the NamedNetbeansAction in.
Throws:
FreeformPluginException - if something goes wrong.

writeIdeActions

protected void writeIdeActions(java.util.List netbeansActions,
                               org.codehaus.plexus.util.xml.XMLWriter writer)
                        throws FreeformPluginException
This method write a List of NamedNetbeansActions to the given XMLWriter.

Parameters:
netbeansActions - The List of NamedNetbeansActions to write.
writer - The XMLWriter to write the List of NamedNetbeansActions in.
Throws:
FreeformPluginException - if something goes wrong.

writeName

protected void writeName(java.lang.String name,
                         org.codehaus.plexus.util.xml.XMLWriter writer)
                  throws FreeformPluginException
This method write the name of the project to the given XMLWriter.

Parameters:
name - The name of the project to write.
writer - The XMLWriter to write the name of the project in.
Throws:
FreeformPluginException - if something goes wrong.

writeProjectXml

protected void writeProjectXml(org.codehaus.plexus.util.xml.XMLWriter writer)
                        throws FreeformPluginException
This method write the FreeformProject in the XMLWriter.

Parameters:
writer - The XMLWriter to write the FreeformProject in.
Throws:
FreeformPluginException - if something goes wrong.

writeProperties

protected void writeProperties(java.util.List properties,
                               org.codehaus.plexus.util.xml.XMLWriter writer)
                        throws FreeformPluginException
This method write a List of property to the given XMLWriter.

Parameters:
properties - The List of property to write.
writer - The XMLWriter to write the List of property in.
Throws:
FreeformPluginException - if something goes wrong.

writeProperty

protected void writeProperty(Property property,
                             org.codehaus.plexus.util.xml.XMLWriter writer)
                      throws FreeformPluginException
This method write a Property to the given XMLWriter.

Parameters:
property - The Property to write.
writer - The XMLWriter to write the Property in.
Throws:
FreeformPluginException - if something goes wrong.

writeProperty

protected void writeProperty(NamedProperty property,
                             org.codehaus.plexus.util.xml.XMLWriter writer)
                      throws FreeformPluginException
This method write a NamedProperty to the given XMLWriter.

Parameters:
property - The NamedProperty to write.
writer - The XMLWriter to write the NamedProperty in.
Throws:
FreeformPluginException - if something goes wrong.

writeProperty

protected void writeProperty(FileProperty property,
                             org.codehaus.plexus.util.xml.XMLWriter writer)
                      throws FreeformPluginException
This method write a FileProperty to the given XMLWriter.

Parameters:
property - The FileProperty to write.
writer - The XMLWriter to write the FileProperty in.
Throws:
FreeformPluginException - if something goes wrong.

writeSourceFolder

protected void writeSourceFolder(SourceFolder sourceFolder,
                                 org.codehaus.plexus.util.xml.XMLWriter writer)
                          throws FreeformPluginException
This method write a SourceFolder to the given XMLWriter.

Parameters:
sourceFolder - The SourceFolder to write.
writer - The XMLWriter to write the SourceFolder in.
Throws:
FreeformPluginException - if something goes wrong.

writeSourceFolders

protected void writeSourceFolders(java.util.List sourceFolders,
                                  org.codehaus.plexus.util.xml.XMLWriter writer)
                           throws FreeformPluginException
This method write a List of SourceFolders to the given XMLWriter.

Parameters:
sourceFolders - The List of SourceFolders to write.
writer - The XMLWriter to write the List of SourceFolders in.
Throws:
FreeformPluginException - if something goes wrong.

writeSubprojects

protected void writeSubprojects(java.util.List subprojects,
                                org.codehaus.plexus.util.xml.XMLWriter writer)
                         throws FreeformPluginException
This method write a List of Subproject to the given XMLWriter.

Parameters:
subprojects - The List of Subproject to write.
writer - The XMLWriter to write the List of SourceFolders in.
Throws:
FreeformPluginException - if something goes wrong.

writeViewItem

protected void writeViewItem(ViewItem viewItem,
                             org.codehaus.plexus.util.xml.XMLWriter writer)
                      throws FreeformPluginException
This method write a ViewItem to the given XMLWriter.

Parameters:
viewItem - The ViewItem to write.
writer - The XMLWriter to write the ViewItem in.
Throws:
FreeformPluginException - if something goes wrong.

writeViewItem

protected void writeViewItem(FileViewItem viewItem,
                             org.codehaus.plexus.util.xml.XMLWriter writer)
                      throws FreeformPluginException
This method write a FileViewItem to the given XMLWriter.

Parameters:
viewItem - The FileViewItem to write.
writer - The XMLWriter to write the FileViewItem in.
Throws:
FreeformPluginException - if something goes wrong.

writeViewItem

protected void writeViewItem(FolderViewItem viewItem,
                             org.codehaus.plexus.util.xml.XMLWriter writer)
                      throws FreeformPluginException
This method write a FolderViewItem to the given XMLWriter.

Parameters:
viewItem - The FolderViewItem to write.
writer - The XMLWriter to write the FolderViewItem in.
Throws:
FreeformPluginException - if something goes wrong.

writeViewItems

protected void writeViewItems(java.util.List viewItems,
                              org.codehaus.plexus.util.xml.XMLWriter writer)
                       throws FreeformPluginException
This method write a List of ViewItems to the given XMLWriter.

Parameters:
viewItems - The List of ViewItems to write.
writer - The XMLWriter to write the List of ViewItems in.
Throws:
FreeformPluginException - if something goes wrong.


Copyright © 2005-2009. All Rights Reserved.