org.jostraca
Class Service

java.lang.Object
  extended byorg.jostraca.Service
All Implemented Interfaces:
Constants

public class Service
extends java.lang.Object
implements Constants

The Service class provides the top level code generation functionality of Jostraca.

This class is used by other classes which provide a code generation service and therefore provides the full functionality of Jostraca in a relatively complex API.

To use Jostraca as a component, try the Generator class, which is easier to use than Service.


Field Summary
static java.lang.String CN
           
static java.lang.String DUMP_SPEC_settings
           
static java.lang.String DUMP_SPEC_template
           
static java.lang.String STANDARD_TRACKER
           
static Tracker t
           
 
Fields inherited from interface org.jostraca.Constants
ARG_ControlPrefix, BUILDNUMBER, CONF_cmdline, CONF_lang, CONF_local, CONF_override, CONF_system, CONF_template, FILE_EXT_conf, FILE_EXT_Writer, FILE_NAME_system_conf, FOLDER_conf, MAJOR_VERSION, MINOR_VERSION, RELEASE_ALTNAME, RELEASE_NAME, VERSION_NUMBER, VERSION_STATUS
 
Constructor Summary
Service()
          Create Service object to run code generation.
 
Method Summary
static void activateTracking(java.io.File pTrackFile)
          Activate tracking of internal processing to a log file.
 void addPropertySet(java.lang.String pName, PropertySet pPropertySet)
          Add a PropertySet by name.
 java.util.List build()
          Build code from prespecified list of TemplatePath objects.
 java.util.List build(java.util.List pTemplateObjects)
          Build list of Template or TemplatePath objects.
 Template build(Template pTemplate)
          Build a template.
 java.util.List build(TemplatePath pTemplatePath)
          Build template from template path.
static java.util.List buildTemplateListFromFile(java.io.File pFile)
          return a List of TemplatPath objects
 java.util.List buildTemplatePaths(java.util.List pTemplatePaths)
          Build templates from list of template paths.
 java.util.List buildTemplates(java.util.List pTemplates)
          Build a list of templates.
static void deactivateTracking()
          Deactivate tracking of internal processing.
 PropertySet getCurrentConfig()
           
 PropertySet loadBaseConfigFiles(java.io.File pSystemConfigFile)
          Load system and local configuration
 void loadConfigFromFolder(java.io.File pConfigFolder, java.util.ArrayList pAdditionalConfig)
          Loads system configuration from specified folder.
 Template makeTemplate(TemplatePath pTemplatePath)
          Create a template object from a template path
static void parseDumpSpec(java.lang.String pDumpSpec, PropertySet pCmdLineOptions)
          Set dump options from dump specification argument.
 void setConfigFolder(java.lang.String pConfigFolder)
          Set configuration files folder.
 void setContextForTemplate(java.lang.Object pContextForTemplate)
          Set context for template to use.
 void setTemplatePaths(java.util.List pTemplatePaths)
          Set template paths.
 void setUserMessageHandler(UserMessageHandler pUserMessageHandler)
          Set user message handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CN

public static final java.lang.String CN

STANDARD_TRACKER

public static final java.lang.String STANDARD_TRACKER
See Also:
Constant Field Values

t

public static final Tracker t

DUMP_SPEC_settings

public static final java.lang.String DUMP_SPEC_settings
See Also:
Constant Field Values

DUMP_SPEC_template

public static final java.lang.String DUMP_SPEC_template
See Also:
Constant Field Values
Constructor Detail

Service

public Service()
Create Service object to run code generation.

Method Detail

setUserMessageHandler

public void setUserMessageHandler(UserMessageHandler pUserMessageHandler)
Set user message handler.

Parameters:
pUserMessageHandler - UserMessageHandler instance

setTemplatePaths

public void setTemplatePaths(java.util.List pTemplatePaths)
Set template paths. TemplatePath objects encapsulate the concept of a template path, where the path can be a file path (foo/bar/a.jtm) or an abstract template library path (foo.bar.a).

Parameters:
pTemplatePaths - Paths to template files

setConfigFolder

public void setConfigFolder(java.lang.String pConfigFolder)
Set configuration files folder.

Parameters:
pConfigFolder - Path to config files

setContextForTemplate

public void setContextForTemplate(java.lang.Object pContextForTemplate)
Set context for template to use.

Parameters:
pContextForTemplate - context object

addPropertySet

public void addPropertySet(java.lang.String pName,
                           PropertySet pPropertySet)
Add a PropertySet by name. Unknown names are ignored.

Parameters:
pName - Name of PropertySet
pPropertySet - PropertySet to add

getCurrentConfig

public PropertySet getCurrentConfig()

loadConfigFromFolder

public void loadConfigFromFolder(java.io.File pConfigFolder,
                                 java.util.ArrayList pAdditionalConfig)
Loads system configuration from specified folder.


build

public java.util.List build()
Build code from prespecified list of TemplatePath objects.

Returns:
List of Template objects

build

public java.util.List build(java.util.List pTemplateObjects)
Build list of Template or TemplatePath objects.

Returns:
List of Template objects

build

public java.util.List build(TemplatePath pTemplatePath)
Build template from template path.

Returns:
List of Template objects

buildTemplatePaths

public java.util.List buildTemplatePaths(java.util.List pTemplatePaths)
Build templates from list of template paths.

Returns:
List of Template objects

build

public Template build(Template pTemplate)
Build a template.

Returns:
Template object

buildTemplates

public java.util.List buildTemplates(java.util.List pTemplates)
Build a list of templates.

Returns:
List of Template objects

makeTemplate

public Template makeTemplate(TemplatePath pTemplatePath)
Create a template object from a template path


loadBaseConfigFiles

public PropertySet loadBaseConfigFiles(java.io.File pSystemConfigFile)
Load system and local configuration


buildTemplateListFromFile

public static java.util.List buildTemplateListFromFile(java.io.File pFile)
return a List of TemplatPath objects


parseDumpSpec

public static void parseDumpSpec(java.lang.String pDumpSpec,
                                 PropertySet pCmdLineOptions)
Set dump options from dump specification argument. expected format: propertyset,template,... etc

Parameters:
pDumpSpec - dump specification String
pCmdLineOptions - dump settings placed here

activateTracking

public static void activateTracking(java.io.File pTrackFile)
Activate tracking of internal processing to a log file.


deactivateTracking

public static void deactivateTracking()
Deactivate tracking of internal processing.



Copyright © 2000-2002 Richard Rodger