Package: org.codehaus.groovy.grails.web.plugins.support

## [Groovy] Class WebMetaUtils

- org.codehaus.groovy.grails.web.plugins.support.WebMetaUtils

- 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

- - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `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 DataBindingSource` | `getCommandObjectBindingSource(java.lang.Class commandObjectClass, DataBindingSource params)` Use getCommandObjectBindingSourceForPrefix instead.
    `static DataBindingSource` | `getCommandObjectBindingSourceForPrefix(java.lang.String prefix, DataBindingSource params)` Return a DataBindingSource for a command object which has a parameter name matching the specified prefix.
    `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 void` | `registerCommonWebProperties(groovy.lang.MetaClass mc, GrailsApplication application)` This creates the difference dynamic methods and properties on the controllers.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `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

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

    - #### @java.lang.Deprecated static DataBindingSource getCommandObjectBindingSource(java.lang.Class commandObjectClass, DataBindingSource params)

      Use getCommandObjectBindingSourceForPrefix instead.

      deprecated:
      See Also:
        getCommandObjectBindingSourceForPrefix(String, DataBindingSource)

    - #### static DataBindingSource getCommandObjectBindingSourceForPrefix(java.lang.String prefix, DataBindingSource params)

      Return a DataBindingSource for a command object which has a parameter name matching the specified prefix. If params include something like widget.name=Thing and prefix is widget then the returned binding source will include name=thing, not widget.name=Thing.

      Parameters:
        `prefix` - The parameter name for the command object
        `params` - The original binding source associated with the request
      Returns:
        The binding source suitable for binding to a command object with a parameter name matching the specified prefix.

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

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

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

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