Class ServiceGenerator
- java.lang.Object
-
- net.anotheria.asg.generator.AbstractGenerator
-
- net.anotheria.asg.generator.model.ServiceGenerator
-
- All Implemented Interfaces:
IGenerator
public class ServiceGenerator extends AbstractGenerator implements IGenerator
Controls different sub generators for generation of the service layer. Generates factories and interfaces.- Version:
- $Id: $Id
- Author:
- lrosenberg
-
-
Field Summary
-
Fields inherited from class net.anotheria.asg.generator.AbstractGenerator
CRLF, ident
-
-
Constructor Summary
Constructors Constructor Description ServiceGenerator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<FileEntry>generate(IGenerateable gmodule)generate.static java.lang.StringgetExceptionImport(MetaModule m)Returns the base exception name for the service for this module.static java.lang.StringgetExceptionName(MetaModule m)Returns the name of the base exception class for the service for the given module.static java.lang.StringgetFactoryImport(MetaModule m)Returns the import for the factory for the service for a meta-module.static java.lang.StringgetFactoryName(MetaModule m)Returns the factory name for the service for a metamodule.static java.lang.StringgetImplementationName(MetaModule m)getImplementationName.static java.lang.StringgetInterfaceImport(MetaModule m)Returns the import (package and class name) for the service interface for the given module.static java.lang.StringgetInterfaceName(MetaModule module)Returns the interface name for the service for the module.static java.lang.StringgetItemNotFoundExceptionImport(MetaDocument doc, MetaModule m)getItemNotFoundExceptionImport.static java.lang.StringgetItemNotFoundExceptionName(MetaDocument doc, MetaModule m)getItemNotFoundExceptionName.static java.lang.StringgetPackageName(Context context, MetaModule module)getPackageName.static java.lang.StringgetServiceName(MetaModule m)Returns the service name for this module.-
Methods inherited from class net.anotheria.asg.generator.AbstractGenerator
append, appendCatch, appendCatch, appendComment, appendComment, appendCommentLine, appendCommentLine, appendEmptyline, appendGenerationPoint, appendImport, appendImport, appendIncreasedStatement, appendIncreasedStatement, appendIncreasedString, appendIncreasedString, appendMark, appendNullCheck, appendStatement, appendStatement, appendString, appendString, closeBlock, closeBlock, closeBlock, closeBlockNEW, createMultilingualList, decreaseIdent, emptyline, emptyline, getCurrentJob, getCurrentJobContent, getElementLanguage, increaseIdent, openFun, openTry, quote, quote, quote, resetIdent, startClassBody, startNewJob, writeComment, writeCommentLine, writeEmptyline, writeImport, writeImport, writeIncreasedStatement, writeIncreasedString, writeStatement, writeString
-
-
-
-
Method Detail
-
generate
public java.util.List<FileEntry> generate(IGenerateable gmodule)
generate.
Generates the service layer for a MetaModule.- Specified by:
generatein interfaceIGenerator- Parameters:
gmodule- aIGenerateableobject.- Returns:
- a
Listobject.
-
getExceptionName
public static java.lang.String getExceptionName(MetaModule m)
Returns the name of the base exception class for the service for the given module.- Parameters:
m- aMetaModuleobject.- Returns:
- name of exception
-
getItemNotFoundExceptionName
public static java.lang.String getItemNotFoundExceptionName(MetaDocument doc, MetaModule m)
getItemNotFoundExceptionName.
- Parameters:
doc- aMetaDocumentobject.m- aMetaModuleobject.- Returns:
- a
Stringobject.
-
getInterfaceName
public static java.lang.String getInterfaceName(MetaModule module)
Returns the interface name for the service for the module.- Parameters:
module- aMetaModuleobject.- Returns:
- name of interface
-
getInterfaceImport
public static java.lang.String getInterfaceImport(MetaModule m)
Returns the import (package and class name) for the service interface for the given module.- Parameters:
m- aMetaModuleobject.- Returns:
- import for service
-
getExceptionImport
public static java.lang.String getExceptionImport(MetaModule m)
Returns the base exception name for the service for this module.- Parameters:
m- the module.- Returns:
- exception name
-
getItemNotFoundExceptionImport
public static java.lang.String getItemNotFoundExceptionImport(MetaDocument doc, MetaModule m)
getItemNotFoundExceptionImport.
- Parameters:
doc- aMetaDocumentobject.m- aMetaModuleobject.- Returns:
- a
Stringobject.
-
getServiceName
public static java.lang.String getServiceName(MetaModule m)
Returns the service name for this module.- Parameters:
m- aMetaModuleobject.- Returns:
- service name
-
getFactoryName
public static java.lang.String getFactoryName(MetaModule m)
Returns the factory name for the service for a metamodule.- Parameters:
m- aMetaModuleobject.- Returns:
- factory name
-
getFactoryImport
public static java.lang.String getFactoryImport(MetaModule m)
Returns the import for the factory for the service for a meta-module.- Parameters:
m- aMetaModuleobject.- Returns:
- inport for factory
-
getImplementationName
public static java.lang.String getImplementationName(MetaModule m)
getImplementationName.
- Parameters:
m- aMetaModuleobject.- Returns:
- a
Stringobject.
-
getPackageName
public static java.lang.String getPackageName(Context context, MetaModule module)
getPackageName.
- Parameters:
context- aContextobject.module- aMetaModuleobject.- Returns:
- a
Stringobject.
-
-