org.jomc.tools
Class SourceFileProcessor.SourceFileEditor

Package class diagram package SourceFileProcessor.SourceFileEditor
java.lang.Object
  extended by org.jomc.util.LineEditor
      extended by org.jomc.util.SectionEditor
          extended by org.jomc.tools.SourceFileProcessor.SourceFileEditor
Enclosing class:
SourceFileProcessor

public class SourceFileProcessor.SourceFileEditor
extends org.jomc.util.SectionEditor

Extension to SectionEditor adding support for editing source code files.

Version:
$Id: SourceFileProcessor.java 2164 2010-06-28 03:25:51Z schulte2005 $
Author:
Christian Schulte

Constructor Summary
Constructor and Description
SourceFileProcessor.SourceFileEditor(org.jomc.model.Implementation implementation)
          Creates a new SourceFileEditor taking an Implementation to edit source code of.
SourceFileProcessor.SourceFileEditor(org.jomc.model.Implementation implementation, org.jomc.util.LineEditor lineEditor)
          Creates a new SourceFileEditor taking an Implementation to edit source code of and an editor to chain.
SourceFileProcessor.SourceFileEditor(org.jomc.model.Implementation implementation, org.jomc.util.LineEditor lineEditor, String lineSeparator)
          Creates a new SourceFileEditor taking an Implementation to edit source code of, an editor to chain and a line separator.
SourceFileProcessor.SourceFileEditor(org.jomc.model.Implementation implementation, String lineSeparator)
          Creates a new SourceFileEditor taking an Implementation to edit source code of and a line separator.
SourceFileProcessor.SourceFileEditor(org.jomc.model.Specification specification)
          Creates a new SourceFileEditor taking a Specification to edit source code of.
SourceFileProcessor.SourceFileEditor(org.jomc.model.Specification specification, org.jomc.util.LineEditor lineEditor)
          Creates a new SourceFileEditor taking a Specification to edit source code of and an editor to chain.
SourceFileProcessor.SourceFileEditor(org.jomc.model.Specification specification, org.jomc.util.LineEditor lineEditor, String lineSeparator)
          Creates a new SourceFileEditor taking a Specification to edit source code of, an editor to chain and a line separator.
SourceFileProcessor.SourceFileEditor(org.jomc.model.Specification specification, String lineSeparator)
          Creates a new SourceFileEditor taking a Specification to edit source code of and a line separator.
 
Method Summary
Modifier and Type Method and Description
protected  void editSection(org.jomc.util.Section s)
           This method searches the model of the editor for a section matching s and updates properties headContent and tailContent of s according to the templates declared in the model as returned by method getSourceFileType.
 List<org.jomc.util.Section> getAddedSections()
          Gets a list of sections added to the input.
protected  String getOutput(org.jomc.util.Section section)
           This method creates any sections declared in the model of the editor as returned by method getSourceFileType prior to rendering the output of the editor.
protected  SourceFileType getSourceFileType()
          Gets the model of the editor.
 List<org.jomc.util.Section> getUnknownSections()
          Gets a list of sections without corresponding model entry.
protected  org.apache.velocity.VelocityContext getVelocityContext()
          Gets the velocity context used for merging templates.
 
Methods inherited from class org.jomc.util.SectionEditor
editLine, getSection, isSectionFinished, isSectionPresent
 
Methods inherited from class org.jomc.util.LineEditor
edit, getLineSeparator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceFileProcessor.SourceFileEditor

public SourceFileProcessor.SourceFileEditor(org.jomc.model.Specification specification)
Creates a new SourceFileEditor taking a Specification to edit source code of.

Parameters:
specification - The specification to edit source code of.

SourceFileProcessor.SourceFileEditor

public SourceFileProcessor.SourceFileEditor(org.jomc.model.Specification specification,
                                            String lineSeparator)
Creates a new SourceFileEditor taking a Specification to edit source code of and a line separator.

Parameters:
specification - The specification to edit source code of.
lineSeparator - The line separator of the editor.

SourceFileProcessor.SourceFileEditor

public SourceFileProcessor.SourceFileEditor(org.jomc.model.Specification specification,
                                            org.jomc.util.LineEditor lineEditor)
Creates a new SourceFileEditor taking a Specification to edit source code of and an editor to chain.

Parameters:
specification - The specification backing the editor.
lineEditor - The editor to chain.

SourceFileProcessor.SourceFileEditor

public SourceFileProcessor.SourceFileEditor(org.jomc.model.Specification specification,
                                            org.jomc.util.LineEditor lineEditor,
                                            String lineSeparator)
Creates a new SourceFileEditor taking a Specification to edit source code of, an editor to chain and a line separator.

Parameters:
specification - The specification backing the editor.
lineEditor - The editor to chain.
lineSeparator - The line separator of the editor.

SourceFileProcessor.SourceFileEditor

public SourceFileProcessor.SourceFileEditor(org.jomc.model.Implementation implementation)
Creates a new SourceFileEditor taking an Implementation to edit source code of.

Parameters:
implementation - The implementation to edit source code of.

SourceFileProcessor.SourceFileEditor

public SourceFileProcessor.SourceFileEditor(org.jomc.model.Implementation implementation,
                                            String lineSeparator)
Creates a new SourceFileEditor taking an Implementation to edit source code of and a line separator.

Parameters:
implementation - The implementation to edit source code of.
lineSeparator - The line separator of the editor.

SourceFileProcessor.SourceFileEditor

public SourceFileProcessor.SourceFileEditor(org.jomc.model.Implementation implementation,
                                            org.jomc.util.LineEditor lineEditor)
Creates a new SourceFileEditor taking an Implementation to edit source code of and an editor to chain.

Parameters:
implementation - The implementation to edit source code of.
lineEditor - The editor to chain.

SourceFileProcessor.SourceFileEditor

public SourceFileProcessor.SourceFileEditor(org.jomc.model.Implementation implementation,
                                            org.jomc.util.LineEditor lineEditor,
                                            String lineSeparator)
Creates a new SourceFileEditor taking an Implementation to edit source code of, an editor to chain and a line separator.

Parameters:
implementation - The implementation to edit source code of.
lineEditor - The editor to chain.
lineSeparator - The line separator of the editor.
Method Detail

getAddedSections

public List<org.jomc.util.Section> getAddedSections()
Gets a list of sections added to the input.

Returns:
A list of sections added to the input.

getUnknownSections

public List<org.jomc.util.Section> getUnknownSections()
Gets a list of sections without corresponding model entry.

Returns:
A list of sections without corresponding model entry.

getSourceFileType

protected SourceFileType getSourceFileType()
Gets the model of the editor.

Returns:
The model of the editor.

getVelocityContext

protected org.apache.velocity.VelocityContext getVelocityContext()
Gets the velocity context used for merging templates.

Returns:
The velocity context used for merging templates.

getOutput

protected String getOutput(org.jomc.util.Section section)
                    throws IOException

This method creates any sections declared in the model of the editor as returned by method getSourceFileType prior to rendering the output of the editor.

Overrides:
getOutput in class org.jomc.util.SectionEditor
Parameters:
section - The section to start rendering the editor's output with.
Throws:
IOException
See Also:
getSourceFileType()

editSection

protected void editSection(org.jomc.util.Section s)
                    throws IOException

This method searches the model of the editor for a section matching s and updates properties headContent and tailContent of s according to the templates declared in the model as returned by method getSourceFileType.

Overrides:
editSection in class org.jomc.util.SectionEditor
Parameters:
s - The section to edit.
Throws:
IOException
See Also:
getSourceFileType()


Copyright © 2005-2010 The JOMC Project. All Rights Reserved.