Class 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
    • Constructor Detail

      • ServiceGenerator

        public ServiceGenerator()
    • Method Detail

      • 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 - a MetaModule object.
        Returns:
        name of exception
      • getItemNotFoundExceptionName

        public static java.lang.String getItemNotFoundExceptionName​(MetaDocument doc,
                                                                    MetaModule m)

        getItemNotFoundExceptionName.

        Parameters:
        doc - a MetaDocument object.
        m - a MetaModule object.
        Returns:
        a String object.
      • getInterfaceName

        public static java.lang.String getInterfaceName​(MetaModule module)
        Returns the interface name for the service for the module.
        Parameters:
        module - a MetaModule object.
        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 - a MetaModule object.
        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 - a MetaDocument object.
        m - a MetaModule object.
        Returns:
        a String object.
      • getServiceName

        public static java.lang.String getServiceName​(MetaModule m)
        Returns the service name for this module.
        Parameters:
        m - a MetaModule object.
        Returns:
        service name
      • getFactoryName

        public static java.lang.String getFactoryName​(MetaModule m)
        Returns the factory name for the service for a metamodule.
        Parameters:
        m - a MetaModule object.
        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 - a MetaModule object.
        Returns:
        inport for factory
      • getImplementationName

        public static java.lang.String getImplementationName​(MetaModule m)

        getImplementationName.

        Parameters:
        m - a MetaModule object.
        Returns:
        a String object.
      • getPackageName

        public static java.lang.String getPackageName​(Context context,
                                                      MetaModule module)

        getPackageName.

        Parameters:
        context - a Context object.
        module - a MetaModule object.
        Returns:
        a String object.