org.codehaus.gram
Class GramSupport

java.lang.Object
  extended by groovy.lang.GroovyObjectSupport
      extended by groovy.lang.Script
          extended by org.codehaus.gram.GramSupport
All Implemented Interfaces:
groovy.lang.GroovyObject
Direct Known Subclasses:
HibernateSupport

public abstract class GramSupport
extends groovy.lang.Script

A useful base class for Gram scripts

Version:
$Revision: 2152 $

Constructor Summary
GramSupport()
           
GramSupport(groovy.lang.Binding binding)
           
 
Method Summary
 String annotationValue(org.codehaus.jam.JAnnotatedElement element, String annotationName, String valueName)
          Returns the string value of the named annotation
 String annotationValue(org.codehaus.jam.JAnnotatedElement element, String annotationName, String valueName, String defaultValue)
          Returns the string value of the named annotation or the default value is returned if the element, annotation or value is null
 boolean booleanValue(org.codehaus.jam.JAnnotation annotation, String name)
          Returns the boolean value of the annotation or false if the annotation is null or there is no value for the given name
 String capitalize(String text)
          Captalizes the first character of the given string; particularly useful for turning JAM field names into property names etc.
 String decapitalize(String text)
          Decaptalizes the first character of the given string; particularly useful for turning JAM property names into field names etc.
 int intValue(org.codehaus.jam.JAnnotation annotation, String name)
          Returns the integer value of the annotation or 0 if the annotation is null or there is no value for the given name
 String stringValue(org.codehaus.jam.JAnnotation annotation, String name)
          Returns the string value of the annotation or "" if the annotation is null or there is no value for the given name
 String stringValue(org.codehaus.jam.JAnnotation annotation, String name, String defaultValue)
          Returns the string value of the annotation or the defaultValue if the annotation is null or there is no value for the given name
 
Methods inherited from class groovy.lang.Script
evaluate, evaluate, getBinding, getProperty, invokeMethod, print, println, println, run, run, setBinding, setProperty
 
Methods inherited from class groovy.lang.GroovyObjectSupport
getMetaClass, setMetaClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GramSupport

public GramSupport()

GramSupport

public GramSupport(groovy.lang.Binding binding)
Method Detail

stringValue

public String stringValue(org.codehaus.jam.JAnnotation annotation,
                          String name)
Returns the string value of the annotation or "" if the annotation is null or there is no value for the given name


stringValue

public String stringValue(org.codehaus.jam.JAnnotation annotation,
                          String name,
                          String defaultValue)
Returns the string value of the annotation or the defaultValue if the annotation is null or there is no value for the given name


intValue

public int intValue(org.codehaus.jam.JAnnotation annotation,
                    String name)
Returns the integer value of the annotation or 0 if the annotation is null or there is no value for the given name


booleanValue

public boolean booleanValue(org.codehaus.jam.JAnnotation annotation,
                            String name)
Returns the boolean value of the annotation or false if the annotation is null or there is no value for the given name


decapitalize

public String decapitalize(String text)
Decaptalizes the first character of the given string; particularly useful for turning JAM property names into field names etc.


capitalize

public String capitalize(String text)
Captalizes the first character of the given string; particularly useful for turning JAM field names into property names etc.


annotationValue

public String annotationValue(org.codehaus.jam.JAnnotatedElement element,
                              String annotationName,
                              String valueName)
Returns the string value of the named annotation


annotationValue

public String annotationValue(org.codehaus.jam.JAnnotatedElement element,
                              String annotationName,
                              String valueName,
                              String defaultValue)
Returns the string value of the named annotation or the default value is returned if the element, annotation or value is null



Copyright © 2004-2008 The Codehaus. All Rights Reserved.