|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectorg.jomc.tools.JomcTool
org.jomc.tools.JavaSources
public class JavaSources
Manages Java source code.
Use cases
manageSources(java.io.File)manageSources(org.jomc.model.Module, java.io.File)manageSources(org.jomc.model.Specification, java.io.File)manageSources(org.jomc.model.Implementation, java.io.File)
JomcTool.getModules()| Nested Class Summary | |
|---|---|
class |
JavaSources.JavaEditor
Extension to SectionEditor for editing Java source code. |
class |
JavaSources.JavaImplementationEditor
Extension to JavaEditor for editing implementation source code. |
class |
JavaSources.JavaSpecificationEditor
Extension to JavaEditor for editing specification source code. |
| Nested classes/interfaces inherited from class org.jomc.tools.JomcTool |
|---|
JomcTool.Listener |
| Field Summary | |
|---|---|
private static String |
ANNOTATIONS_SECTION_NAME
Constant for the name of the implementation annotations source code section. |
private static String |
CONSTRUCTORS_HEAD_TEMPLATE
Name of the implementation-constructors-head.vm template. |
private static String |
CONSTRUCTORS_SECTION_NAME
Constant for the name of the constructors source code section. |
private static String |
CONSTRUCTORS_TAIL_TEMPLATE
Name of the implementation-constructors-tail.vm template. |
private static String |
DEFAULT_CONSTRUCTOR_SECTION_NAME
Constant for the name of the default constructor source code section. |
private static String |
DEPENDENCIES_SECTION_NAME
Constant for the name of the dependencies source code section. |
private static String |
DEPENDENCIES_TEMPLATE
Name of the implementation-dependencies.vm template. |
private static String |
DOCUMENTATION_SECTION_NAME
Constant for the name of the documentation source code section. |
private static String |
GENERATOR_NAME
Name of the generator. |
private static String |
GENERATOR_VERSION
Constant for the version of the generator. |
private static String |
IMPLEMENTATION_ANNOTATIONS_TEMPLATE
Name of the implementation-annotations.vm template. |
private static String |
IMPLEMENTATION_DOCUMENTATION_TEMPLATE
Name of the implementation-documentation.vm template. |
private static String |
IMPLEMENTATION_LICENSE_TEMPLATE
Name of the implementation-license.vm template. |
private static String |
IMPLEMENTATION_TEMPLATE
Name of the Implementation.java.vm template. |
private static String |
LICENSE_SECTION_NAME
Constant for the name of the license source code section. |
private static String |
MESSAGES_SECTION_NAME
Constant for the name of the messages source code section. |
private static String |
MESSAGES_TEMPLATE
Name of the implementation-messages.vm template. |
private static String |
PROPERTIES_SECTION_NAME
Constant for the name of the properties source code section. |
private static String |
PROPERTIES_TEMPLATE
Name of the implementation-properties.vm template. |
private static String |
SPECIFICATION_ANNOTATIONS_TEMPLATE
Name of the specification-annotations.vm template. |
private static String |
SPECIFICATION_DOCUMENTATION_TEMPLATE
Name of the specification-documentation.vm template. |
private static String |
SPECIFICATION_LICENSE_TEMPLATE
Name of the specification-license.vm template. |
private static String |
SPECIFICATION_TEMPLATE
Name of the Specification.java.vm template. |
| Constructor Summary | |
|---|---|
JavaSources()
Creates a new JavaSources instance. |
|
JavaSources(JavaSources tool)
Creates a new JavaSources instance taking a JavaSources instance to initialize the instance with. |
|
| Method Summary | |
|---|---|
private String |
getAnnotationsSection(Implementation implementation)
Gets the Java source code of the implementation annotations section. |
private String |
getAnnotationsSection(Specification specification)
Gets the Java source code of the specification annotations section. |
private String |
getConstructorsSectionHeadContent(Implementation implementation)
Gets the Java source code of the constructors section head content of an implementation. |
private String |
getConstructorsSectionTailContent(Implementation implementation)
Gets the Java source code of the constructors section tail content of an implementation. |
private String |
getDependenciesSection(Implementation implementation)
Gets the Java source code of the dependencies section of an implementation. |
private String |
getDocumentationSection(Implementation implementation)
Gets the Java source code of the documentation section of an implementation. |
private String |
getDocumentationSection(Specification specification)
Gets the Java source code of the documentation section of a specification. |
JavaSources.JavaImplementationEditor |
getImplementationEditor(Implementation implementation)
Gets a new editor for editing Java implementation source code. |
private String |
getImplementationTemplate(Implementation implementation)
Gets the Java source code template of an implementation. |
private String |
getLicenseSection(Implementation implementation)
Gets the Java source code of the license section of an implementation.. |
private String |
getLicenseSection(Specification specification)
Gets the Java source code of the license section of a specification. |
private String |
getMessage(String key,
Object args)
|
private String |
getMessagesSection(Implementation implementation)
Gets the Java source code of the messages section of an implementation. |
private String |
getPropertiesSection(Implementation implementation)
Gets the Java source code of the properties section of an implementation. |
JavaSources.JavaSpecificationEditor |
getSpecificationEditor(Specification specification)
Gets a new editor for editing Java specification source code. |
private String |
getSpecificationTemplate(Specification specification)
Gets the Java source code template of specification. |
VelocityContext |
getVelocityContext()
Gets the velocity context used for merging templates. |
void |
manageSources(File sourcesDirectory)
Manages the source code of the modules of the instance. |
void |
manageSources(Implementation implementation,
File sourcesDirectory)
Manages the source code of a given implementation of the modules of the instance. |
void |
manageSources(Module module,
File sourcesDirectory)
Manages the source code of a given module of the modules of the instance. |
void |
manageSources(Specification specification,
File sourcesDirectory)
Manages the source code of a given specification of the modules of the instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final String CONSTRUCTORS_SECTION_NAME
private static final String DEFAULT_CONSTRUCTOR_SECTION_NAME
private static final String DEPENDENCIES_SECTION_NAME
private static final String PROPERTIES_SECTION_NAME
private static final String MESSAGES_SECTION_NAME
private static final String LICENSE_SECTION_NAME
private static final String DOCUMENTATION_SECTION_NAME
private static final String ANNOTATIONS_SECTION_NAME
private static final String GENERATOR_NAME
private static final String GENERATOR_VERSION
private static final String CONSTRUCTORS_HEAD_TEMPLATE
implementation-constructors-head.vm template.
private static final String CONSTRUCTORS_TAIL_TEMPLATE
implementation-constructors-tail.vm template.
private static final String DEPENDENCIES_TEMPLATE
implementation-dependencies.vm template.
private static final String PROPERTIES_TEMPLATE
implementation-properties.vm template.
private static final String MESSAGES_TEMPLATE
implementation-messages.vm template.
private static final String SPECIFICATION_LICENSE_TEMPLATE
specification-license.vm template.
private static final String IMPLEMENTATION_LICENSE_TEMPLATE
implementation-license.vm template.
private static final String SPECIFICATION_DOCUMENTATION_TEMPLATE
specification-documentation.vm template.
private static final String IMPLEMENTATION_DOCUMENTATION_TEMPLATE
implementation-documentation.vm template.
private static final String IMPLEMENTATION_TEMPLATE
Implementation.java.vm template.
private static final String SPECIFICATION_TEMPLATE
Specification.java.vm template.
private static final String SPECIFICATION_ANNOTATIONS_TEMPLATE
specification-annotations.vm template.
private static final String IMPLEMENTATION_ANNOTATIONS_TEMPLATE
implementation-annotations.vm template.
| Constructor Detail |
|---|
public JavaSources()
JavaSources instance.
public JavaSources(JavaSources tool)
JavaSources instance taking a JavaSources instance to initialize the instance with.
tool - The instance to initialize the new instance with,| Method Detail |
|---|
public void manageSources(File sourcesDirectory)
throws IOException
sourcesDirectory - The directory holding the sources to manage.
NullPointerException - if sourcesDirectory is null.
IOException - if managing sources fails.manageSources(org.jomc.model.Module, java.io.File)
public void manageSources(Module module,
File sourcesDirectory)
throws IOException
module - The module to process.sourcesDirectory - The directory holding the sources to manage.
NullPointerException - if module or sourcesDirectory is null.
IOException - if managing sources fails.manageSources(org.jomc.model.Specification, java.io.File),
manageSources(org.jomc.model.Implementation, java.io.File)
public void manageSources(Specification specification,
File sourcesDirectory)
throws IOException
specification - The specification to process.sourcesDirectory - The directory holding the sources to manage.
NullPointerException - if specification or sourcesDirectory is null.
IOException - if managing sources fails.getSpecificationEditor(org.jomc.model.Specification)
public void manageSources(Implementation implementation,
File sourcesDirectory)
throws IOException
implementation - The implementation to process.sourcesDirectory - The directory holding the sources to manage.
NullPointerException - if implementation or sourcesDirectory is null.
IOException - if managing sources fails.getImplementationEditor(org.jomc.model.Implementation)public JavaSources.JavaSpecificationEditor getSpecificationEditor(Specification specification)
specification - The specification to create a new editor for.
specification.
NullPointerException - if specification is null.public JavaSources.JavaImplementationEditor getImplementationEditor(Implementation implementation)
implementation - The implementation to create a new editor for.
implementation.
NullPointerException - if implementation is null.public VelocityContext getVelocityContext()
getVelocityContext in class JomcTool
private String getSpecificationTemplate(Specification specification)
throws IOException
specification - The specification to get the source code template of.
IOException - if getting the source code section fails.
private String getImplementationTemplate(Implementation implementation)
throws IOException
implementation - The implementation to get the source code template of.
IOException - if getting the source code section fails.
private String getLicenseSection(Specification specification)
throws IOException
specification - The specification to get the source code of the license section of.
IOException - if getting the source code section fails.
private String getLicenseSection(Implementation implementation)
throws IOException
implementation - The implementation to get the source code of the license section of.
IOException - if getting the source code section fails.
private String getAnnotationsSection(Specification specification)
throws IOException
specification - The specification to get the source code of the annotations section of.
IOException - if getting the source code section fails.
private String getAnnotationsSection(Implementation implementation)
throws IOException
implementation - The implementation to get the source code of the annotations section of.
IOException - if getting the source code section fails.
private String getDocumentationSection(Specification specification)
throws IOException
specification - The specification to get the source code section of.
IOException - if getting the source code section fails.
private String getDocumentationSection(Implementation implementation)
throws IOException
implementation - The implementation to get the source code section of.
IOException - if getting the source code section fails.
private String getConstructorsSectionHeadContent(Implementation implementation)
throws IOException
implementation - The implementation to get the constructors section head content of.
IOException - if getting the source code section fails.
private String getConstructorsSectionTailContent(Implementation implementation)
throws IOException
implementation - The implementation to get the constructors section tail content of.
IOException - if getting the source code section fails.
private String getDependenciesSection(Implementation implementation)
throws IOException
implementation - The implementation to get the source code of the dependencies section of.
IOException - if getting the source code section fails.
private String getPropertiesSection(Implementation implementation)
throws IOException
implementation - The implementation to get the source code of the properties section of.
IOException - if getting the source code section fails.
private String getMessagesSection(Implementation implementation)
throws IOException
implementation - The implementation to get the source code of the messages section of.
IOException - if getting the source code section fails.
private String getMessage(String key,
Object args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||