Groovy Documentation

org.codehaus.groovy.grails.web.plugins.support
[Groovy] Class WebMetaUtils

java.lang.Object
  org.codehaus.groovy.grails.web.plugins.support.WebMetaUtils

class WebMetaUtils
extends java.lang.Object

Provides utility methods used to support meta-programming. In particular commons methods to register tag library method invokations as new methods an a given MetaClass.

Authors:
Graeme Rocher
Since:
1.0


Method Summary
static groovy.lang.Closure createAndPrepareCommandObjectAction(groovy.lang.GroovyObject controller, groovy.lang.Closure originalAction, java.lang.String actionName, org.springframework.context.ApplicationContext ctx)

static groovy.lang.Closure createCommandObjectBindingAction(org.springframework.context.ApplicationContext ctx)

Creates a command object binding action that can be used to replace an existing action

static void enhanceCommandObject(org.springframework.context.ApplicationContext ctx, java.lang.Class commandObjectClass)

Enhances a command object with new capabilities such as validation and constraints handling

static void enhanceTagLibMetaClass(GrailsTagLibClass taglib, TagLibraryLookup gspTagLibraryLookup)

static java.util.Map getCommandObjectBindingParams(java.lang.Class commandObjectClass, java.util.Map params)

static boolean isCommandObjectAction(groovy.lang.Closure callable)

Checks whether the given action is a command object action

static groovy.lang.Closure prepareCommandObjectBindingAction(groovy.lang.Closure action, groovy.lang.Closure originalAction, java.lang.String actionName, java.lang.Object controller, org.springframework.context.ApplicationContext ctx)

Prepares a command object binding action for usage

static void prepareCommandObjectBindingAction(java.lang.reflect.Method action, java.lang.Class[] commandObjectClasses, org.springframework.context.ApplicationContext ctx)

Prepares a command object binding action for usage

static java.lang.Object registerCommonWebProperties(groovy.lang.MetaClass mc, GrailsApplication application)

This creates the difference dynamic methods and properties on the controllers.

static java.lang.Object registerMethodMissingForTags(groovy.lang.MetaClass mc, TagLibraryLookup gspTagLibraryLookup, java.lang.String namespace, java.lang.String name)

static java.lang.Object registerMethodMissingForTags(groovy.lang.MetaClass mc, org.springframework.context.ApplicationContext ctx, GrailsTagLibClass tagLibraryClass, java.lang.String name)

static void registerPropertyMissingForTag(groovy.lang.MetaClass mc, java.lang.String name, java.lang.Object result)

static java.lang.Object registerStreamCharBufferMetaClass()

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Method Detail

createAndPrepareCommandObjectAction

static groovy.lang.Closure createAndPrepareCommandObjectAction(groovy.lang.GroovyObject controller, groovy.lang.Closure originalAction, java.lang.String actionName, org.springframework.context.ApplicationContext ctx)


createCommandObjectBindingAction

static groovy.lang.Closure createCommandObjectBindingAction(org.springframework.context.ApplicationContext ctx)
Creates a command object binding action that can be used to replace an existing action
Parameters:
ctx - The ApplicationContext
Returns:
The command object binding action


enhanceCommandObject

static void enhanceCommandObject(org.springframework.context.ApplicationContext ctx, java.lang.Class commandObjectClass)
Enhances a command object with new capabilities such as validation and constraints handling
Parameters:
commandObjectClass - The command object class


enhanceTagLibMetaClass

static void enhanceTagLibMetaClass(GrailsTagLibClass taglib, TagLibraryLookup gspTagLibraryLookup)


getCommandObjectBindingParams

static java.util.Map getCommandObjectBindingParams(java.lang.Class commandObjectClass, java.util.Map params)


isCommandObjectAction

static boolean isCommandObjectAction(groovy.lang.Closure callable)
Checks whether the given action is a command object action
Parameters:
callable - The action to check
Returns:
true if it is a command object action


prepareCommandObjectBindingAction

static groovy.lang.Closure prepareCommandObjectBindingAction(groovy.lang.Closure action, groovy.lang.Closure originalAction, java.lang.String actionName, java.lang.Object controller, org.springframework.context.ApplicationContext ctx)
Prepares a command object binding action for usage
Parameters:
action - The binding action
originalAction - The original action to be replacec
actionName - The action name
controller - The controller
Returns:
The new binding action


prepareCommandObjectBindingAction

@SuppressWarnings("rawtypes")
static void prepareCommandObjectBindingAction(java.lang.reflect.Method action, java.lang.Class[] commandObjectClasses, org.springframework.context.ApplicationContext ctx)
Prepares a command object binding action for usage
Parameters:
action - The binding action


registerCommonWebProperties

static java.lang.Object registerCommonWebProperties(groovy.lang.MetaClass mc, GrailsApplication application)
This creates the difference dynamic methods and properties on the controllers. Most methods are implemented by looking up the current request from the RequestContextHolder (RCH)


registerMethodMissingForTags

static java.lang.Object registerMethodMissingForTags(groovy.lang.MetaClass mc, TagLibraryLookup gspTagLibraryLookup, java.lang.String namespace, java.lang.String name)


registerMethodMissingForTags

static java.lang.Object registerMethodMissingForTags(groovy.lang.MetaClass mc, org.springframework.context.ApplicationContext ctx, GrailsTagLibClass tagLibraryClass, java.lang.String name)


registerPropertyMissingForTag

static void registerPropertyMissingForTag(groovy.lang.MetaClass mc, java.lang.String name, java.lang.Object result)


registerStreamCharBufferMetaClass

static java.lang.Object registerStreamCharBufferMetaClass()


 

Groovy Documentation