|
Cantaloop CGimlet - API Documentation, Version: 0.2.0, Date: 2002-05-13 21:30 CEST | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.cantaloop.cgimlet.ProjectGenerator
A ProjectGenerator
is attached to every
projectfile. It configures the handlers and calls them to
generate their code.
Field Summary | |
static int |
LOG_DEFAULT
Constant used with setLogLevel(int) . |
static int |
LOG_QUIET
Constant used with setLogLevel(int) . |
static int |
LOG_VERBOSE
Constant used with setLogLevel(int) . |
Fields inherited from interface org.cantaloop.cgimlet.Constants |
LOGGER_TOPIC_PREFIX, PROJECT_NS, PROJECT_NS_URI, PROPERTY |
Constructor Summary | |
protected |
ProjectGenerator(java.io.File prjFile)
|
Method Summary | |
java.io.File |
getBaseDir()
Get the base directory of the project. |
CodeWriter |
getCodeWriter(java.lang.String dirname,
LanguageFactory lang)
Returns a codewriter for the programming language lang that is configured with
dirname as basedir. |
ComponentHandler |
getHandler(java.lang.String key)
Get the handler with key key . |
java.lang.String |
getHandlerKey(java.lang.Class handlerType)
Get the key that was used to register a handler of type handlerType . |
org.cantaloop.tools.logging.Logger |
getLogger(java.lang.Object obj)
Get a logger for the given object that is preconfigured with the topic of the ProjectGenerator . |
java.lang.String |
getLoggerTopic()
Return the topic the ProjectGenerator
is logging on. |
protected org.dom4j.Document |
getProjectDocument()
Get the document for the project file. |
java.util.Properties |
getProperties()
Get the properties of this project |
java.util.Map |
getResultMap()
Returns the results the handlers. |
protected void |
initHandlers(org.dom4j.Element root)
|
void |
registerHandler(java.lang.String key,
ComponentHandler handler)
Register a handler. |
java.io.File |
resolveFilename(java.lang.String name)
Resolves the abstract pathname name against the
base directory of the project. |
void |
run()
Run the codegeneration. |
void |
setDebug(boolean b)
|
void |
setLogLevel(int level)
Set the log level of the ProjectGenerator. |
void |
setPrettyPrinting(boolean b)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int LOG_VERBOSE
setLogLevel(int)
.public static final int LOG_DEFAULT
setLogLevel(int)
.public static final int LOG_QUIET
setLogLevel(int)
.Constructor Detail |
protected ProjectGenerator(java.io.File prjFile)
Method Detail |
public java.io.File getBaseDir()
File
valuepublic java.io.File resolveFilename(java.lang.String name)
name
against the
base directory of the project. name
must use
`/' as the directory separator symbol.name
- a String
valueFile
valuepublic CodeWriter getCodeWriter(java.lang.String dirname, LanguageFactory lang)
lang
that is configured with
dirname
as basedir. dirname
is resolved against the base directory of the project.dirname
- the name of the base directorylang
- the language of the CodeWriterCodewriter
valuepublic java.util.Properties getProperties()
Properties
valuepublic void run()
public java.util.Map getResultMap()
generate
method of
every ComponentHandler
are stored
in a map, using the key that was given when registering
the handler (if you don't know this key, you can ask the
getHandlerKey(Class)
method).
For every handler you will find a List
value. This
list contains the values returned by the calls of generate
.Map
valuepublic void registerHandler(java.lang.String key, ComponentHandler handler)
key
- a String
valuehandler
- a ComponentHandler
valuepublic ComponentHandler getHandler(java.lang.String key)
key
.key
- a String
valueComponentHandler
valuepublic java.lang.String getHandlerKey(java.lang.Class handlerType)
handlerType
.handlerType
- a Class
valueString
valuepublic org.cantaloop.tools.logging.Logger getLogger(java.lang.Object obj)
ProjectGenerator
.obj
- an Object
valueLogger
valuepublic java.lang.String getLoggerTopic()
ProjectGenerator
is logging on.String
valuepublic void setLogLevel(int level)
level
should be LOG_VERBOSE
or LOG_DEFAULT
or LOG_QUIET
.level
- an int
valuepublic void setPrettyPrinting(boolean b)
public void setDebug(boolean b)
protected org.dom4j.Document getProjectDocument()
protected void initHandlers(org.dom4j.Element root)
|
Copyright 2001, 2002 Stefan Heimann, David Leuschner. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |