Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.cantaloop.cgimlet.lang.java
Class JUtils  view JUtils download JUtils.java

java.lang.Object
  extended byorg.cantaloop.cgimlet.lang.AbstractUtils
      extended byorg.cantaloop.cgimlet.lang.java.JUtils
All Implemented Interfaces:
org.cantaloop.cgimlet.lang.CGUtils

public class JUtils
extends org.cantaloop.cgimlet.lang.AbstractUtils

Version:
@version@ ($Revision: 1.3 $)

Field Summary
private static org.cantaloop.cgimlet.lang.CGUtils s_instance
           
 
Constructor Summary
private 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 org.cantaloop.cgimlet.lang.CGUtils getInstance()
           
 org.cantaloop.cgimlet.lang.MethodTemplate getter(java.lang.String externalName, org.cantaloop.cgimlet.lang.FieldTemplate field)
          Factory method that returns a template for a get-method.
private  void invalidCharacter(java.lang.String s, char c)
           
 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(org.cantaloop.cgimlet.lang.Type interfaceType, java.lang.String name, org.cantaloop.cgimlet.lang.Type implementationType)
          Creates a statement that icreates a instance of implType and stores that instance in the variable name.
 org.cantaloop.cgimlet.lang.MethodTemplate setter(java.lang.String externalName, org.cantaloop.cgimlet.lang.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
 

Field Detail

s_instance

private static final org.cantaloop.cgimlet.lang.CGUtils s_instance
Constructor Detail

JUtils

private JUtils()
Method Detail

getInstance

public static final org.cantaloop.cgimlet.lang.CGUtils getInstance()

newInstance

public java.lang.String newInstance(org.cantaloop.cgimlet.lang.Type interfaceType,
                                    java.lang.String name,
                                    org.cantaloop.cgimlet.lang.Type implementationType)
Description copied from interface: org.cantaloop.cgimlet.lang.CGUtils
Creates a statement that icreates a instance of implType and stores that instance in the variable name. The type of this variable is determined by the interfaceType parameter.


callSet

public java.lang.String callSet(java.lang.String var,
                                java.lang.String property,
                                java.lang.String value)
Description copied from interface: org.cantaloop.cgimlet.lang.CGUtils
Generate a statement for calling a set method.


toIdentifier

public java.lang.String toIdentifier(java.lang.String s,
                                     boolean capitalize)
Description copied from interface: org.cantaloop.cgimlet.lang.CGUtils
Convert s into an indentifier. Whitespace characters and '-' are treated as word bounderies and converted accordingly to the coding conventions of the programming language.


invalidCharacter

private void invalidCharacter(java.lang.String s,
                              char c)
                       throws org.cantaloop.cgimlet.CodeGenerationException

mapPut

public java.lang.String mapPut(java.lang.String mapName,
                               java.lang.String key,
                               java.lang.String value)
Description copied from interface: org.cantaloop.cgimlet.lang.CGUtils
Returns a statement that invokes the put method on the map named mapName with the given key and value.


invokeExpr

public java.lang.String invokeExpr(java.lang.String methodName,
                                   java.lang.String[] params)
Description copied from interface: org.cantaloop.cgimlet.lang.CGUtils
Returns a expression that invokes the method named methodName with the given parameters.


invoke

public java.lang.String invoke(java.lang.String methodName,
                               java.lang.String[] params)
Description copied from interface: org.cantaloop.cgimlet.lang.CGUtils
Returns a statement that invokes the method named methodName with the given parameters.


invokeOnExpr

public java.lang.String invokeOnExpr(java.lang.String varName,
                                     java.lang.String methodName,
                                     java.lang.String[] params)
Description copied from interface: org.cantaloop.cgimlet.lang.CGUtils
Returns a expression that invokes the method named methodName with the given parameters.


invokeOn

public java.lang.String invokeOn(java.lang.String varName,
                                 java.lang.String methodName,
                                 java.lang.String[] params)
Description copied from interface: org.cantaloop.cgimlet.lang.CGUtils
Returns a statement that invokes the method named methodName with the given parameters.


callReturn

public java.lang.String callReturn(java.lang.String expr)
Description copied from interface: org.cantaloop.cgimlet.lang.CGUtils
Generates a return statement that returns expr.


setter

public org.cantaloop.cgimlet.lang.MethodTemplate setter(java.lang.String externalName,
                                                        org.cantaloop.cgimlet.lang.FieldTemplate field)
Description copied from interface: org.cantaloop.cgimlet.lang.CGUtils
Factory method that returns a template for a set-method.


getter

public org.cantaloop.cgimlet.lang.MethodTemplate getter(java.lang.String externalName,
                                                        org.cantaloop.cgimlet.lang.FieldTemplate field)
Description copied from interface: org.cantaloop.cgimlet.lang.CGUtils
Factory method that returns a template for a get-method.