public class SourceFileProcessor.SourceFileEditor extends SectionEditor
SectionEditor
adding support for editing source code files.edit(org.jomc.model.Specification, org.jomc.tools.model.SourceFileType, java.io.File)
,
edit(org.jomc.model.Implementation, org.jomc.tools.model.SourceFileType, java.io.File)
Constructor and Description |
---|
SourceFileProcessor.SourceFileEditor()
Creates a new
SourceFileEditor instance. |
SourceFileProcessor.SourceFileEditor(Implementation implementation)
Deprecated.
As of JOMC 1.2, please use method
edit(org.jomc.model.Implementation, org.jomc.tools.model.SourceFileType, java.io.File) .
This constructor will be removed in version 2.0. |
SourceFileProcessor.SourceFileEditor(Implementation implementation,
LineEditor lineEditor)
Deprecated.
As of JOMC 1.2, please use method
edit(org.jomc.model.Implementation, org.jomc.tools.model.SourceFileType, java.io.File) .
This constructor will be removed in version 2.0. |
SourceFileProcessor.SourceFileEditor(Implementation implementation,
LineEditor lineEditor,
String lineSeparator)
Deprecated.
As of JOMC 1.2, please use method
edit(org.jomc.model.Implementation, org.jomc.tools.model.SourceFileType, java.io.File) .
This constructor will be removed in version 2.0. |
SourceFileProcessor.SourceFileEditor(Implementation implementation,
String lineSeparator)
Deprecated.
As of JOMC 1.2, please use method
edit(org.jomc.model.Implementation, org.jomc.tools.model.SourceFileType, java.io.File) .
This constructor will be removed in version 2.0. |
SourceFileProcessor.SourceFileEditor(LineEditor editor)
Creates a new
SourceFileEditor instance taking an editor to chain. |
SourceFileProcessor.SourceFileEditor(LineEditor editor,
String lineSeparator)
Creates a new
SourceFileEditor instance taking an editor to chain and a string to use for separating
lines. |
SourceFileProcessor.SourceFileEditor(Specification specification)
Deprecated.
As of JOMC 1.2, please use method
edit(org.jomc.model.Specification, org.jomc.tools.model.SourceFileType, java.io.File) .
This constructor will be removed in version 2.0. |
SourceFileProcessor.SourceFileEditor(Specification specification,
LineEditor lineEditor)
Deprecated.
As of JOMC 1.2, please use method
edit(org.jomc.model.Specification, org.jomc.tools.model.SourceFileType, java.io.File) .
This constructor will be removed in version 2.0. |
SourceFileProcessor.SourceFileEditor(Specification specification,
LineEditor lineEditor,
String lineSeparator)
Deprecated.
As of JOMC 1.2, please use method
edit(org.jomc.model.Specification, org.jomc.tools.model.SourceFileType, java.io.File) .
This constructor will be removed in version 2.0. |
SourceFileProcessor.SourceFileEditor(Specification specification,
String lineSeparator)
Deprecated.
As of JOMC 1.2, please use method
edit(org.jomc.model.Specification, org.jomc.tools.model.SourceFileType, java.io.File) .
This constructor will be removed in version 2.0. |
SourceFileProcessor.SourceFileEditor(String lineSeparator)
Creates a new
SourceFileEditor instance taking a string to use for separating lines. |
Modifier and Type | Method and Description |
---|---|
void |
edit(Implementation implementation,
SourceFileType sourceFileType,
File sourcesDirectory)
Edits a source file of a given implementation.
|
void |
edit(Specification specification,
SourceFileType sourceFileType,
File sourcesDirectory)
Edits a source file of a given specification.
|
protected void |
editSection(Section s)
This method searches the model of the source file 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<Section> |
getAddedSections()
Deprecated.
As of JOMC 1.2, deprecated without replacement. This method will be removed in version 2.0.
|
protected String |
getOutput(Section section)
This method creates any sections declared in the model of the source file as returned by method
getSourceFileType prior to rendering the output of the editor. |
protected SourceFileType |
getSourceFileType()
Deprecated.
As of JOMC 1.2, deprecated without replacement. This method will be removed in version 2.0.
|
List<Section> |
getUnknownSections()
Deprecated.
As of JOMC 1.2, deprecated without replacement. This method will be removed in version 2.0.
|
protected VelocityContext |
getVelocityContext()
Deprecated.
As of JOMC 1.2, deprecated without replacement. This method will be removed in version 2.0.
|
editLine, getSection, isSectionFinished, isSectionPresent
edit, getLineNumber, getLineSeparator
public SourceFileProcessor.SourceFileEditor()
SourceFileEditor
instance.public SourceFileProcessor.SourceFileEditor(String lineSeparator)
SourceFileEditor
instance taking a string to use for separating lines.lineSeparator
- String to use for separating lines.public SourceFileProcessor.SourceFileEditor(LineEditor editor)
SourceFileEditor
instance taking an editor to chain.editor
- The editor to chain.public SourceFileProcessor.SourceFileEditor(LineEditor editor, String lineSeparator)
SourceFileEditor
instance taking an editor to chain and a string to use for separating
lines.editor
- The editor to chain.lineSeparator
- String to use for separating lines.@Deprecated public SourceFileProcessor.SourceFileEditor(Specification specification)
edit(org.jomc.model.Specification, org.jomc.tools.model.SourceFileType, java.io.File)
.
This constructor will be removed in version 2.0.SourceFileEditor
taking a Specification
to edit source code of.specification
- The specification to edit source code of.@Deprecated public SourceFileProcessor.SourceFileEditor(Specification specification, String lineSeparator)
edit(org.jomc.model.Specification, org.jomc.tools.model.SourceFileType, java.io.File)
.
This constructor will be removed in version 2.0.SourceFileEditor
taking a Specification
to edit source code of and a line
separator.specification
- The specification to edit source code of.lineSeparator
- The line separator of the editor.@Deprecated public SourceFileProcessor.SourceFileEditor(Specification specification, LineEditor lineEditor)
edit(org.jomc.model.Specification, org.jomc.tools.model.SourceFileType, java.io.File)
.
This constructor will be removed in version 2.0.SourceFileEditor
taking a Specification
to edit source code of and an editor to
chain.specification
- The specification backing the editor.lineEditor
- The editor to chain.@Deprecated public SourceFileProcessor.SourceFileEditor(Specification specification, LineEditor lineEditor, String lineSeparator)
edit(org.jomc.model.Specification, org.jomc.tools.model.SourceFileType, java.io.File)
.
This constructor will be removed in version 2.0.SourceFileEditor
taking a Specification
to edit source code of, an editor to
chain and a line separator.specification
- The specification backing the editor.lineEditor
- The editor to chain.lineSeparator
- The line separator of the editor.@Deprecated public SourceFileProcessor.SourceFileEditor(Implementation implementation)
edit(org.jomc.model.Implementation, org.jomc.tools.model.SourceFileType, java.io.File)
.
This constructor will be removed in version 2.0.SourceFileEditor
taking an Implementation
to edit source code of.implementation
- The implementation to edit source code of.@Deprecated public SourceFileProcessor.SourceFileEditor(Implementation implementation, String lineSeparator)
edit(org.jomc.model.Implementation, org.jomc.tools.model.SourceFileType, java.io.File)
.
This constructor will be removed in version 2.0.SourceFileEditor
taking an Implementation
to edit source code of and a line
separator.implementation
- The implementation to edit source code of.lineSeparator
- The line separator of the editor.@Deprecated public SourceFileProcessor.SourceFileEditor(Implementation implementation, LineEditor lineEditor)
edit(org.jomc.model.Implementation, org.jomc.tools.model.SourceFileType, java.io.File)
.
This constructor will be removed in version 2.0.SourceFileEditor
taking an Implementation
to edit source code of and an editor
to chain.implementation
- The implementation to edit source code of.lineEditor
- The editor to chain.@Deprecated public SourceFileProcessor.SourceFileEditor(Implementation implementation, LineEditor lineEditor, String lineSeparator)
edit(org.jomc.model.Implementation, org.jomc.tools.model.SourceFileType, java.io.File)
.
This constructor will be removed in version 2.0.SourceFileEditor
taking an Implementation
to edit source code of, an editor
to chain and a line separator.implementation
- The implementation to edit source code of.lineEditor
- The editor to chain.lineSeparator
- The line separator of the editor.public final void edit(Specification specification, SourceFileType sourceFileType, File sourcesDirectory) throws IOException
specification
- The specification to edit a source file of.sourceFileType
- The model of the source file to edit.sourcesDirectory
- The directory holding the source file to edit.NullPointerException
- if specification
, sourceFileType
or sourcesDirectory
is
null
.IOException
- if editing fails.public final void edit(Implementation implementation, SourceFileType sourceFileType, File sourcesDirectory) throws IOException
implementation
- The implementation to edit a source file of.sourceFileType
- The model of the source file to edit.sourcesDirectory
- The directory holding the source file to edit.NullPointerException
- if implementation
, sourceFileType
or sourcesDirectory
is
null
.IOException
- if editing fails.@Deprecated public List<Section> getAddedSections()
This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you
make to the returned list will be present inside the object. This is why there is no set
method
for the added sections property.
@Deprecated public List<Section> getUnknownSections()
This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you
make to the returned list will be present inside the object. This is why there is no set
method
for the unknown sections property.
@Deprecated protected SourceFileType getSourceFileType()
@Deprecated protected VelocityContext getVelocityContext() throws IOException
IOException
- if creating a new context instance fails.protected String getOutput(Section section) throws IOException
This method creates any sections declared in the model of the source file as returned by method
getSourceFileType
prior to rendering the output of the editor.
getOutput
in class SectionEditor
section
- The section to start rendering the editor's output with.IOException
createSection(java.lang.String, java.lang.String, org.jomc.tools.model.SourceSectionType)
protected void editSection(Section s) throws IOException
This method searches the model of the source file 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
.
editSection
in class SectionEditor
s
- The section to edit.IOException
Copyright © 2005–2015 The JOMC Project. All rights reserved.