WEB4J Development Tools 4.10.0.0

hirondelle.web4jtools.util
Class Functions

Object
  extended by hirondelle.web4jtools.util.Functions

public final class Functions
extends Object

Utility functions called from JSPs, using JSTL functions.

Most of these functions are related to code generation. If the formatting provided by this class is not adequate for your needs, you will need to change its implementation.

These items are referenced in web4j.tld. Since these functions are mostly used in pages served as plain text, it is appropriate that they return String instead of SafeText.

The text passed as incoming argument to these methods should be in a 'natural text' style, as in 'Jet Engine', and not formatted in any special way (such as 'JetEngine' or 'JET_ENGINE').


Method Summary
static String asArgument(String aFieldName)
          Format as an argument to a method or a constructor: aLikeThis.
static String asConstant(String aFeatureName)
          Format as a Java constant : LIKE_THIS.
static String asControl(Field aField)
          Present a field as a complete HTML form control.
static String asDbIdentifier(String aFieldName)
          Format as a table or column name in an SQL statement: LikeThis.
static String asELIdentifier(String aFieldName)
          Format as a JSP Expression Language reference to an object or a property: likeThis.
static String asField(String aFieldName)
          Format as an object field reference: fLikeThis.
static String asLocal(String aName)
          Format as a local object in the body of a method: likeThis.
static String asType(String aText)
          Format as a Java class name identifier : LikeThis.
static String checks(Field aField)
          Generate text snippet used for performing validations with the Check class.
static String fileURL(String aFileName)
          Return a file:// URI for the given file.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

asConstant

public static String asConstant(String aFeatureName)
Format as a Java constant : LIKE_THIS.

Any spaces are replaced with an underscore, and the text is converted to upper case.


asType

public static String asType(String aText)
Format as a Java class name identifier : LikeThis.

Any spaces are removed.


asArgument

public static String asArgument(String aFieldName)
Format as an argument to a method or a constructor: aLikeThis.


asField

public static String asField(String aFieldName)
Format as an object field reference: fLikeThis.


asDbIdentifier

public static String asDbIdentifier(String aFieldName)
Format as a table or column name in an SQL statement: LikeThis.


asELIdentifier

public static String asELIdentifier(String aFieldName)
Format as a JSP Expression Language reference to an object or a property: likeThis.


asLocal

public static String asLocal(String aName)
Format as a local object in the body of a method: likeThis.


asControl

public static String asControl(Field aField)
Present a field as a complete HTML form control.


checks

public static String checks(Field aField)
Generate text snippet used for performing validations with the Check class. An example return value :
'Check.range(1, 100), Check.isRegex()'


fileURL

public static String fileURL(String aFileName)
Return a file:// URI for the given file.


WEB4J Development Tools 4.10.0.0

Copyright Hirondelle Systems - Generated 2013Oct19.12.26