## org.codehaus.groovy.grails.plugins
Class DefaultPluginMetaManager

    java.lang.Object
      org.codehaus.groovy.grails.plugins.DefaultPluginMetaManager

All Implemented Interfaces:
  PluginManagerAware, PluginMetaManager, GrailsApplicationAware, InitializingBean, ResourceLoaderAware

    public class DefaultPluginMetaManager

extends Object
implements PluginMetaManager, GrailsApplicationAware, InitializingBean, ResourceLoaderAware

Implements the PluginMetaManager interface by parsing a set of plugin.xml files from the given set of resources

Since:
  0.6

  Created: Aug 21, 2007 Time: 8:00:36 AM
Author:
  Graeme Rocher

Field Summary

Fields inherited from interface org.codehaus.groovy.grails.plugins.PluginMetaManager
`BEAN_ID`

Constructor Summary
`DefaultPluginMetaManager()`
`DefaultPluginMetaManager(Resource[] pluginDescriptors)`

Method Summary
`void` `afterPropertiesSet()`
`GrailsPlugin` `getPluginForResource(String name)` Obtains a plug-in instance from the pluginManager for the given resource name
`String` `getPluginPathForResource(String resourceName)` Obtains the path to the plug-in for the given resource
`String[]` `getPluginResources(String pluginName)` Retrieves all the plugin resource names for the given plugin name
`String` `getPluginViewsPathForResource(String resourceName)` Obtains the path to the plug-in views directory for the given resource name
`void` `setGrailsApplication(GrailsApplication grailsApplication)` This method is called by the `ApplicationContext` that loads the Grails application.
`void` `setPluginManager(GrailsPluginManager pluginManager)` Sets the plug-in manager on this instance
`void` `setResourceLoader(ResourceLoader resourceLoader)`
`void` `setResourcePattern(String resourcePattern)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DefaultPluginMetaManager

    public DefaultPluginMetaManager()

### DefaultPluginMetaManager

    public DefaultPluginMetaManager(Resource[] pluginDescriptors)

Method Detail

### setResourcePattern

    public void setResourcePattern(String resourcePattern)

### setGrailsApplication

    public void setGrailsApplication(GrailsApplication grailsApplication)

  Description copied from interface: `GrailsApplicationAware`

  This method is called by the `ApplicationContext` that loads the Grails application. The `GrailsApplication` instance that represents the loaded Grails application is injected.

  Specified by:
    `setGrailsApplication` in interface `GrailsApplicationAware`
  Parameters:
    `grailsApplication` - the `GrailsApplication` object that represents this Grails application

### afterPropertiesSet

    public void afterPropertiesSet()
                            throws Exception

  Specified by:
    `afterPropertiesSet` in interface `InitializingBean`
  Throws:
    `Exception`

### setResourceLoader

    public void setResourceLoader(ResourceLoader resourceLoader)

  Specified by:
    `setResourceLoader` in interface `ResourceLoaderAware`

### getPluginResources

    public String[] getPluginResources(String pluginName)

  Description copied from interface: `PluginMetaManager`
  Retrieves all the plugin resource names for the given plugin name

  Specified by:
    `getPluginResources` in interface `PluginMetaManager`
  Parameters:
    `pluginName` - The plugin name
  Returns:
    An array of plugin resource names

### getPluginForResource

    public GrailsPlugin getPluginForResource(String name)

  Description copied from interface: `PluginMetaManager`
  Obtains a plug-in instance from the pluginManager for the given resource name

  Specified by:
    `getPluginForResource` in interface `PluginMetaManager`
  Parameters:
    `name` - The name of the resource
  Returns:
    A GrailsPlugin instance or null

### getPluginPathForResource

    public String getPluginPathForResource(String resourceName)

  Description copied from interface: `PluginMetaManager`
  Obtains the path to the plug-in for the given resource

  Specified by:
    `getPluginPathForResource` in interface `PluginMetaManager`
  Parameters:
    `resourceName` - The name of the resource
  Returns:
    The path to the plug-in or null if it doesn't exist

### getPluginViewsPathForResource

    public String getPluginViewsPathForResource(String resourceName)

  Description copied from interface: `PluginMetaManager`
  Obtains the path to the plug-in views directory for the given resource name

  Specified by:
    `getPluginViewsPathForResource` in interface `PluginMetaManager`
  Parameters:
    `resourceName` - The resource name
  Returns:
    The path to the plug-in views directory or null if the plug-in doesn't exist

### setPluginManager

    public void setPluginManager(GrailsPluginManager pluginManager)

  Description copied from interface: `PluginManagerAware`
  Sets the plug-in manager on this instance

  Specified by:
    `setPluginManager` in interface `PluginManagerAware`
  Parameters:
    `pluginManager` - The PluginManager

Copyright (c) 2005-2009 The Grails project