|
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.lang.AbstractUtils | +--org.cantaloop.cgimlet.lang.java.JUtils
Method Summary | |
java.lang.String |
callReturn(java.lang.String expr)
Generates a return statement that returns expr . |
java.lang.String |
callSet(java.lang.String var,
java.lang.String property,
java.lang.String value)
Generate a statement for calling a set method. |
static CGUtils |
getInstance()
|
MethodTemplate |
getter(java.lang.String externalName,
FieldTemplate field)
Factory method that returns a template for a get-method. |
java.lang.String |
invoke(java.lang.String methodName,
java.lang.String[] params)
Returns a statement that invokes the method named methodName
with the given parameters. |
java.lang.String |
invokeExpr(java.lang.String methodName,
java.lang.String[] params)
Returns a expression that invokes the method named methodName
with the given parameters. |
java.lang.String |
invokeOn(java.lang.String varName,
java.lang.String methodName,
java.lang.String[] params)
Returns a statement that invokes the method named methodName
with the given parameters. |
java.lang.String |
invokeOnExpr(java.lang.String varName,
java.lang.String methodName,
java.lang.String[] params)
Returns a expression that invokes the method named methodName
with the given parameters. |
java.lang.String |
mapPut(java.lang.String mapName,
java.lang.String key,
java.lang.String value)
Returns a statement that invokes the put method on the
map named mapName with the given key and value. |
java.lang.String |
newInstance(Type interfaceType,
java.lang.String name,
Type implementationType)
Creates a statement that icreates a instance of implType
and stores that instance in the variable name . |
MethodTemplate |
setter(java.lang.String externalName,
FieldTemplate field)
Factory method that returns a template for a set-method. |
java.lang.String |
toIdentifier(java.lang.String s,
boolean capitalize)
Convert s into an indentifier.
|
Methods inherited from class org.cantaloop.cgimlet.lang.AbstractUtils |
caseConcat, caseConcat, caseConcat, getter, invoke, invoke, invoke, invokeExpr, invokeExpr, invokeExpr, invokeOn, invokeOn, invokeOn, invokeOnExpr, invokeOnExpr, invokeOnExpr, makeClassName, mapPut, mapStrPut, mapStrPut, newInstance, nonfinalToFinalIdentifier, quote, setter, sprintf, sprintf, sprintf, sprintf, stringToBoolean, toFinalIdentifier, toIdentifier |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static final CGUtils getInstance()
public java.lang.String newInstance(Type interfaceType, java.lang.String name, Type implementationType)
CGUtils
implType
and stores that instance in the variable name
. The
type of this variable is determined by the interfaceType
parameter.public java.lang.String callSet(java.lang.String var, java.lang.String property, java.lang.String value)
CGUtils
org.cantaloop.cgimlet.lang.CGUtils
var
- the name of the variable on which to invoke
the methodproperty
- the name of the property that should be set.value
- the value to which the property should be set to.String
valuepublic java.lang.String toIdentifier(java.lang.String s, boolean capitalize)
CGUtils
s
into an indentifier.
Whitespace characters and '-' are treated as word bounderies
and converted accordingly to the coding conventions of
the programming language.org.cantaloop.cgimlet.lang.CGUtils
s
- the string to convert.capitalize
- specify if the first letter should be
capitalized or not.String
valueCodeGenerationException
- if s
cannot be converted
properlypublic java.lang.String mapPut(java.lang.String mapName, java.lang.String key, java.lang.String value)
CGUtils
put
method on the
map named mapName
with the given key and value.public java.lang.String invokeExpr(java.lang.String methodName, java.lang.String[] params)
CGUtils
methodName
with the given parameters.public java.lang.String invoke(java.lang.String methodName, java.lang.String[] params)
CGUtils
methodName
with the given parameters.public java.lang.String invokeOnExpr(java.lang.String varName, java.lang.String methodName, java.lang.String[] params)
CGUtils
methodName
with the given parameters.public java.lang.String invokeOn(java.lang.String varName, java.lang.String methodName, java.lang.String[] params)
CGUtils
methodName
with the given parameters.public java.lang.String callReturn(java.lang.String expr)
CGUtils
expr
.public MethodTemplate setter(java.lang.String externalName, FieldTemplate field)
CGUtils
org.cantaloop.cgimlet.lang.CGUtils
externalName
- the name that is used outside the class
for this propertyfield
- the field that should be set.MethodTemplate
valuepublic MethodTemplate getter(java.lang.String externalName, FieldTemplate field)
CGUtils
org.cantaloop.cgimlet.lang.CGUtils
externalName
- the name that is used outside the class
for this propertyfield
- the field whose value should be retrieved.MethodTemplate
value
|
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 |