DefinitionsUtil (Apache Struts API Documentation)
Keywords: org.apache.struts.tiles.DefinitionsUtil,DefinitionsUtil class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.struts.tiles
Class DefinitionsUtil

    java.lang.Object
      |
      +--org.apache.struts.tiles.TilesUtil
            |
            +--org.apache.struts.tiles.DefinitionsUtil

All Implemented Interfaces:
  ComponentConstants

Deprecated. Use `TilesUtil.createDefinitionsFactory(ServletContext, DefinitionsFactoryConfig)`

public class DefinitionsUtil
extends TilesUtil
implements ComponentConstants

Utilities class for definitions factory. Also define userDebugLevel property (to be moved from this class ?). (to do).

Nested Class Summary
`(package private) static class` | `DefinitionsUtil.ServletPropertiesMap` Deprecated. Inner class.

Field Summary
`static java.lang.String` | `ACTION_DEFINITION` Deprecated. Constant name used to store definition in jsp context.
`static java.lang.String` | `DEFINITIONS_CONFIG_USER_DEBUG_LEVEL` Deprecated. Name of init property carrying debug level
`static java.lang.String` | `DEFINITIONS_FACTORY` Deprecated. Constant name used to store factory in context
`static java.lang.String` | `DEFINITIONS_FACTORY_CLASSNAME` Deprecated. Name of init property carrying factory class name
`static java.lang.String` | `INSTANCES_CONFIG_USER_DEBUG_LEVEL` Deprecated. use DEFINITIONS_CONFIG_USER_DEBUG_LEVEL instead.
`protected static org.apache.commons.logging.Log` | `log` Deprecated. Commons Logging instance.
`static int` | `NO_DEBUG` Deprecated. User Debug level
`static int` | `userDebugLevel` Deprecated. Global user defined debug level

Fields inherited from class org.apache.struts.tiles.TilesUtil
`tilesUtilImpl`

Fields inherited from interface org.apache.struts.taglib.tiles.ComponentConstants
`COMPONENT_CONTEXT, COMPONENT_SCOPE, EXCEPTION_KEY, LOCALE_KEY`

Constructor Summary
`DefinitionsUtil()` Deprecated.

Method Summary
`static DefinitionsFactory` | `createDefinitionFactoryInstance(java.lang.String classname)` Deprecated. No direct replacement. Use createDefinitionFactory `TilesUtil.createDefinitionsFactory(ServletContext, DefinitionsFactoryConfig)`.
`static DefinitionsFactory` | `createDefinitionsFactory(javax.servlet.ServletContext servletContext, java.util.Map properties)` Deprecated. Create default Definition factory.
`static DefinitionsFactory` | `createDefinitionsFactory(javax.servlet.ServletContext servletContext, java.util.Map properties, java.lang.String classname)` Deprecated. Use createDefinitionsFactory(ServletContext servletContext, ServletConfig servletConfig)
`static DefinitionsFactory` | `createDefinitionsFactory(javax.servlet.ServletContext servletContext, javax.servlet.ServletConfig servletConfig)` Deprecated. Create Definition factory.
`static DefinitionsFactory` | `createDefinitionsFactory(javax.servlet.ServletContext servletContext, javax.servlet.ServletConfig servletConfig, boolean checkIfExist)` Deprecated. Create Definition factory.
`static ComponentDefinition` | `getActionDefinition(javax.servlet.ServletRequest request)` Deprecated. Get Definition stored in jsp context by an action.
`static ComponentDefinition` | `getDefinition(java.lang.String definitionName, javax.servlet.jsp.PageContext pageContext)` Deprecated. Use `TilesUtil.getDefinition(String, ServletRequest, ServletContext)`
`static DefinitionsFactory` | `getDefinitionsFactory(javax.servlet.ServletContext servletContext)` Deprecated. Use `TilesUtil.getDefinitionsFactory(ServletRequest, ServletContext)`
`static void` | `initUserDebugLevel(javax.servlet.ServletConfig servletConfig)` Deprecated. Use commons-logging package instead.
`static void` | `makeDefinitionsFactoryAccessible(DefinitionsFactory factory, javax.servlet.ServletContext servletContext)` Deprecated. Use `TilesUtil.createDefinitionsFactory(ServletContext, DefinitionsFactoryConfig)`
`static void` | `populateDefinitionsFactoryConfig(DefinitionsFactoryConfig factoryConfig, javax.servlet.ServletConfig servletConfig)` Deprecated. Populate Definition Factory Config from web.xml properties.
`protected static DefinitionsFactoryConfig` | `readFactoryConfig(javax.servlet.ServletConfig servletConfig)` Deprecated. Create FactoryConfig and initialize it from web.xml.
`static void` | `removeActionDefinition(javax.servlet.ServletRequest request, ComponentDefinition definition)` Deprecated. Remove Definition stored in jsp context.
`static void` | `setActionDefinition(javax.servlet.ServletRequest request, ComponentDefinition definition)` Deprecated. Store definition in jsp context.
`protected static void` | `setDefinitionsFactory(ComponentDefinitionsFactory factory, javax.servlet.ServletContext servletContext)` Deprecated. since 20020708. Replaced by makeFactoryAccessible()
`static void` | `setUserDebugLevel(int level)` Deprecated. Use commons-logging package instead.

Methods inherited from class org.apache.struts.tiles.TilesUtil
`applicationClass, createDefinitionsFactory, doForward, doInclude, doInclude, getDefinition, getDefinitionsFactory, getTilesUtil, isTilesUtilImplSet, setTilesUtil, testReset`

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

Field Detail

### log

    protected static org.apache.commons.logging.Log log

  Deprecated.
  Commons Logging instance.

### userDebugLevel

    public static int userDebugLevel

  Deprecated.
  Global user defined debug level

### NO_DEBUG

    public static final int NO_DEBUG

  Deprecated.
  User Debug level

  See Also:
    Constant Field Values

### INSTANCES_CONFIG_USER_DEBUG_LEVEL

    public static final java.lang.String INSTANCES_CONFIG_USER_DEBUG_LEVEL

  Deprecated. use DEFINITIONS_CONFIG_USER_DEBUG_LEVEL instead.

  Name of init property carrying debug level

  See Also:
    Constant Field Values

### DEFINITIONS_CONFIG_USER_DEBUG_LEVEL

    public static final java.lang.String DEFINITIONS_CONFIG_USER_DEBUG_LEVEL

  Deprecated.
  Name of init property carrying debug level

  See Also:
    Constant Field Values

### DEFINITIONS_FACTORY_CLASSNAME

    public static final java.lang.String DEFINITIONS_FACTORY_CLASSNAME

  Deprecated.
  Name of init property carrying factory class name

  See Also:
    Constant Field Values

### DEFINITIONS_FACTORY

    public static final java.lang.String DEFINITIONS_FACTORY

  Deprecated.
  Constant name used to store factory in context

  See Also:
    Constant Field Values

### ACTION_DEFINITION

    public static final java.lang.String ACTION_DEFINITION

  Deprecated.
  Constant name used to store definition in jsp context. Used to pass definition from a Struts action to servlet forward

  See Also:
    Constant Field Values

Constructor Detail

### DefinitionsUtil

    public DefinitionsUtil()

  Deprecated.

Method Detail

### setUserDebugLevel

    public static void setUserDebugLevel(int level)

  Deprecated. Use commons-logging package instead.

  Set user debug level. This property control level of errors output.

  Parameters:
    `level` -

### initUserDebugLevel

    public static void initUserDebugLevel(javax.servlet.ServletConfig servletConfig)

  Deprecated. Use commons-logging package instead.

  Init user debug level.

  Parameters:
    `servletConfig` -

### createDefinitionsFactory

    public static DefinitionsFactory createDefinitionsFactory(javax.servlet.ServletContext servletContext,
                                                              java.util.Map properties,
                                                              java.lang.String classname)
                                                       throws DefinitionsFactoryException

  Deprecated. Use createDefinitionsFactory(ServletContext servletContext, ServletConfig servletConfig)

  Create Definition factory. If a factory class name is provided, a factory of this class is created. Otherwise, default factory is created.

  Parameters:
    `classname` - Class name of the factory to create.
    `servletContext` - Servlet Context passed to newly created factory.
    `properties` - Map of name/property used to initialize factory configuration object.
  Returns:
    newly created factory.
  Throws:
    `DefinitionsFactoryException` - If an error occur while initializing factory

### createDefinitionsFactory

    public static DefinitionsFactory createDefinitionsFactory(javax.servlet.ServletContext servletContext,
                                                              java.util.Map properties)
                                                       throws DefinitionsFactoryException

  Deprecated.
  Create default Definition factory.

  Parameters:
    `servletContext` - Servlet Context passed to newly created factory.
    `properties` - Map of name/property used to initialize factory configuration object.
  Returns:
    newly created factory of type ConfigurableDefinitionsFactory.
  Throws:
    `DefinitionsFactoryException` - If an error occur while initializing factory

### createDefinitionsFactory

    public static DefinitionsFactory createDefinitionsFactory(javax.servlet.ServletContext servletContext,
                                                              javax.servlet.ServletConfig servletConfig)
                                                       throws DefinitionsFactoryException

  Deprecated.
  Create Definition factory. Create configuration object from servlet web.xml file, then create ConfigurableDefinitionsFactory and initialized it with object.

  Convenience method. Calls createDefinitionsFactory(ServletContext servletContext, DefinitionsFactoryConfig factoryConfig)

  Parameters:
    `servletContext` - Servlet Context passed to newly created factory.
    `servletConfig` - Servlet config containing parameters to be passed to factory configuration object.
  Returns:
    newly created factory of type ConfigurableDefinitionsFactory.
  Throws:
    `DefinitionsFactoryException` - If an error occur while initializing factory

### createDefinitionsFactory

    public static DefinitionsFactory createDefinitionsFactory(javax.servlet.ServletContext servletContext,
                                                              javax.servlet.ServletConfig servletConfig,
                                                              boolean checkIfExist)
                                                       throws DefinitionsFactoryException

  Deprecated.
  Create Definition factory. Create configuration object from servlet web.xml file, then create ConfigurableDefinitionsFactory and initialized it with object.

  If checkIfExist is true, start by checking if factory already exist. If yes, return it. If no, create a new one.

  If checkIfExist is false, factory is always created.

  Convenience method. Calls createDefinitionsFactory(ServletContext servletContext, DefinitionsFactoryConfig factoryConfig)

  Parameters:
    `servletContext` - Servlet Context passed to newly created factory.
    `servletConfig` - Servlet config containing parameters to be passed to factory configuration object.
    `checkIfExist` - Check if factory already exist. If true and factory exist, return it. If true and factory doesn't exist, create it. If false, create it in all cases.
  Returns:
    newly created factory of type ConfigurableDefinitionsFactory.
  Throws:
    `DefinitionsFactoryException` - If an error occur while initializing factory

### createDefinitionFactoryInstance

    public static DefinitionsFactory createDefinitionFactoryInstance(java.lang.String classname)
                                                              throws DefinitionsFactoryException

  Deprecated. No direct replacement. Use createDefinitionFactory `TilesUtil.createDefinitionsFactory(ServletContext, DefinitionsFactoryConfig)`.

  Create Definition factory from provided classname. Factory class must extends TilesDefinitionsFactory.

  Parameters:
    `classname` - Class name of the factory to create.
  Returns:
    newly created factory.
  Throws:
    `DefinitionsFactoryException` - If an error occur while initializing factory

### setDefinitionsFactory

    protected static void setDefinitionsFactory(ComponentDefinitionsFactory factory,
                                                javax.servlet.ServletContext servletContext)

  Deprecated. since 20020708. Replaced by makeFactoryAccessible()

  Set definition factory in appropriate servlet context.

  Parameters:
    `factory` - Factory to store.
    `servletContext` - Servlet context that will hold factory.

### getDefinition

    public static ComponentDefinition getDefinition(java.lang.String definitionName,
                                                    javax.servlet.jsp.PageContext pageContext)
                                             throws FactoryNotFoundException,
                                                    DefinitionsFactoryException

  Deprecated. Use `TilesUtil.getDefinition(String, ServletRequest, ServletContext)`

  Get a component / template definition by its name. First, retrieve instance factory, and then get requested instance. Throw appropriate exception if definition is not found.

  Parameters:
    `definitionName` - Name of requested definition.
    `pageContext` - Current pageContext
  Throws:
    `FactoryNotFoundException` - Can't find definition factory.
    `DefinitionsFactoryException` - General error in factory while getting definition.
    `NoSuchDefinitionException` - No definition found for specified name

### getDefinitionsFactory

    public static DefinitionsFactory getDefinitionsFactory(javax.servlet.ServletContext servletContext)

  Deprecated. Use `TilesUtil.getDefinitionsFactory(ServletRequest, ServletContext)`

  Get definition factory from appropriate servlet context.

  Returns:
    Definitions factory or null if not found.
  Since:
    20020708

### makeDefinitionsFactoryAccessible

    public static void makeDefinitionsFactoryAccessible(DefinitionsFactory factory,
                                                        javax.servlet.ServletContext servletContext)

  Deprecated. Use `TilesUtil.createDefinitionsFactory(ServletContext, DefinitionsFactoryConfig)`

  Make definition factory accessible to Tags. Factory is stored in servlet context.

  Parameters:
    `factory` - Factory to make accessible
    `servletContext` - Current servlet context
  Since:
    20020708

### getActionDefinition

    public static ComponentDefinition getActionDefinition(javax.servlet.ServletRequest request)

  Deprecated.
  Get Definition stored in jsp context by an action.

  Returns:
    ComponentDefinition or null if not found.

### setActionDefinition

    public static void setActionDefinition(javax.servlet.ServletRequest request,
                                           ComponentDefinition definition)

  Deprecated.
  Store definition in jsp context. Mainly used by Struts to pass a definition defined in an Action to the forward.

### removeActionDefinition

    public static void removeActionDefinition(javax.servlet.ServletRequest request,
                                              ComponentDefinition definition)

  Deprecated.
  Remove Definition stored in jsp context. Mainly used by Struts to pass a definition defined in an Action to the forward.

### populateDefinitionsFactoryConfig

    public static void populateDefinitionsFactoryConfig(DefinitionsFactoryConfig factoryConfig,
                                                        javax.servlet.ServletConfig servletConfig)
                                                 throws java.lang.IllegalAccessException,
                                                        java.lang.reflect.InvocationTargetException

  Deprecated.
  Populate Definition Factory Config from web.xml properties.

  Parameters:
    `factoryConfig` - Definition Factory Config to populate.
    `servletConfig` - Current servlet config containing web.xml properties.
  Throws:
    `java.lang.IllegalAccessException` - if the caller does not have access to the property accessor method
    `java.lang.reflect.InvocationTargetException` - if the property accessor method throws an exception
  Since:
    tiles 20020708
  See Also:
    `BeanUtils`

### readFactoryConfig

    protected static DefinitionsFactoryConfig readFactoryConfig(javax.servlet.ServletConfig servletConfig)
                                                         throws DefinitionsFactoryException

  Deprecated.
  Create FactoryConfig and initialize it from web.xml.

  Parameters:
    `servletConfig` - ServletConfig for the module with which this plug in is associated
  Throws:
    `DefinitionsFactoryException` - if this `PlugIn` cannot be successfully initialized

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2003 - Apache Software Foundation