WebMetaUtils (Grails 2.3.8)
Date: 2014-04-24

Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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 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 DataBindingSource` | `getCommandObjectBindingSource(java.lang.Class commandObjectClass, DataBindingSource 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 metaClass, 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(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), 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

### 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)

### getCommandObjectBindingSource

    static DataBindingSource getCommandObjectBindingSource(java.lang.Class commandObjectClass, DataBindingSource 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

    @java.lang.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

    @groovy.transform.CompileStatic
    static java.lang.Object registerMethodMissingForTags(groovy.lang.MetaClass metaClass, 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