com.opensymphony.xwork2.config.entities
Class PackageConfig

java.lang.Object
  extended by com.opensymphony.xwork2.util.location.Located
      extended by com.opensymphony.xwork2.config.entities.PackageConfig
All Implemented Interfaces:
InterceptorLocator, Locatable, java.io.Serializable, java.lang.Comparable

public class PackageConfig
extends Located
implements java.lang.Comparable, java.io.Serializable, InterceptorLocator

Configuration for Package.

In the xml configuration file this is defined as the package tag.

Version:
$Revision: 1066692 $
Author:
Rainer Hermanns
See Also:
Serialized Form

Nested Class Summary
static class PackageConfig.Builder
          The builder for this object.
 
Field Summary
protected  java.util.Map<java.lang.String,ActionConfig> actionConfigs
           
protected  java.lang.String defaultActionRef
           
protected  java.lang.String defaultClassRef
           
protected  java.lang.String defaultInterceptorRef
           
protected  java.lang.String defaultResultType
           
protected  java.util.List<ExceptionMappingConfig> globalExceptionMappingConfigs
           
protected  java.util.Map<java.lang.String,ResultConfig> globalResultConfigs
           
protected  java.util.Map<java.lang.String,java.lang.Object> interceptorConfigs
           
protected  boolean isAbstract
           
protected  java.lang.String name
           
protected  java.lang.String namespace
           
protected  boolean needsRefresh
           
protected  java.util.List<PackageConfig> parents
           
protected  java.util.Map<java.lang.String,ResultTypeConfig> resultTypeConfigs
           
 
Fields inherited from class com.opensymphony.xwork2.util.location.Located
location
 
Constructor Summary
protected PackageConfig(PackageConfig orig)
           
protected PackageConfig(java.lang.String name)
           
 
Method Summary
 int compareTo(java.lang.Object o)
           
 boolean equals(java.lang.Object o)
           
 java.util.Map<java.lang.String,ActionConfig> getActionConfigs()
           
 java.util.Map<java.lang.String,ActionConfig> getAllActionConfigs()
          returns the Map of all the ActionConfigs available in the current package.
 java.util.List<ExceptionMappingConfig> getAllExceptionMappingConfigs()
          returns the List of all the ExceptionMappingConfigs available in the current package.
 java.util.Map<java.lang.String,ResultConfig> getAllGlobalResults()
          returns the Map of all the global ResultConfigs available in the current package.
 java.util.Map<java.lang.String,java.lang.Object> getAllInterceptorConfigs()
          returns the Map of all InterceptorConfigs and InterceptorStackConfigs available in the current package.
 java.util.Map<java.lang.String,ResultTypeConfig> getAllResultTypeConfigs()
          returns the Map of all the ResultTypeConfigs available in the current package.
 java.lang.String getDefaultActionRef()
           
 java.lang.String getDefaultClassRef()
           
 java.lang.String getDefaultInterceptorRef()
           
 java.lang.String getDefaultResultType()
          Returns the default result type for this package.
 java.lang.String getFullDefaultActionRef()
          gets the default action-ref name.
 java.lang.String getFullDefaultInterceptorRef()
          gets the default interceptor-ref name.
 java.lang.String getFullDefaultResultType()
          Returns the default result type for this package.
 java.util.List<ExceptionMappingConfig> getGlobalExceptionMappingConfigs()
          gets the ExceptionMappingConfigs local to this package
 java.util.Map<java.lang.String,ResultConfig> getGlobalResultConfigs()
          gets the global ResultConfigs local to this package
 java.lang.Object getInterceptorConfig(java.lang.String name)
          Gets an interceptor configuration object.
 java.util.Map<java.lang.String,java.lang.Object> getInterceptorConfigs()
          gets the InterceptorConfigs and InterceptorStackConfigs local to this package
 java.lang.String getName()
           
 java.lang.String getNamespace()
           
 java.util.List<PackageConfig> getParents()
           
 java.util.Map<java.lang.String,ResultTypeConfig> getResultTypeConfigs()
          gets the ResultTypeConfigs local to this package
 int hashCode()
           
 boolean isAbstract()
           
 boolean isNeedsRefresh()
           
 java.lang.String toString()
           
 
Methods inherited from class com.opensymphony.xwork2.util.location.Located
getLocation, setLocation
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

actionConfigs

protected java.util.Map<java.lang.String,ActionConfig> actionConfigs

globalResultConfigs

protected java.util.Map<java.lang.String,ResultConfig> globalResultConfigs

interceptorConfigs

protected java.util.Map<java.lang.String,java.lang.Object> interceptorConfigs

resultTypeConfigs

protected java.util.Map<java.lang.String,ResultTypeConfig> resultTypeConfigs

globalExceptionMappingConfigs

protected java.util.List<ExceptionMappingConfig> globalExceptionMappingConfigs

parents

protected java.util.List<PackageConfig> parents

defaultInterceptorRef

protected java.lang.String defaultInterceptorRef

defaultActionRef

protected java.lang.String defaultActionRef

defaultResultType

protected java.lang.String defaultResultType

defaultClassRef

protected java.lang.String defaultClassRef

name

protected java.lang.String name

namespace

protected java.lang.String namespace

isAbstract

protected boolean isAbstract

needsRefresh

protected boolean needsRefresh
Constructor Detail

PackageConfig

protected PackageConfig(java.lang.String name)

PackageConfig

protected PackageConfig(PackageConfig orig)
Method Detail

isAbstract

public boolean isAbstract()

getActionConfigs

public java.util.Map<java.lang.String,ActionConfig> getActionConfigs()

getAllActionConfigs

public java.util.Map<java.lang.String,ActionConfig> getAllActionConfigs()
returns the Map of all the ActionConfigs available in the current package. ActionConfigs defined in ancestor packages will be included in this Map.

Returns:
a Map of ActionConfig Objects with the action name as the key
See Also:
ActionConfig

getAllGlobalResults

public java.util.Map<java.lang.String,ResultConfig> getAllGlobalResults()
returns the Map of all the global ResultConfigs available in the current package. Global ResultConfigs defined in ancestor packages will be included in this Map.

Returns:
a Map of Result Objects with the result name as the key
See Also:
ResultConfig

getAllInterceptorConfigs

public java.util.Map<java.lang.String,java.lang.Object> getAllInterceptorConfigs()
returns the Map of all InterceptorConfigs and InterceptorStackConfigs available in the current package. InterceptorConfigs defined in ancestor packages will be included in this Map.

Returns:
a Map of InterceptorConfig and InterceptorStackConfig Objects with the ref-name as the key
See Also:
InterceptorConfig, InterceptorStackConfig

getAllResultTypeConfigs

public java.util.Map<java.lang.String,ResultTypeConfig> getAllResultTypeConfigs()
returns the Map of all the ResultTypeConfigs available in the current package. ResultTypeConfigs defined in ancestor packages will be included in this Map.

Returns:
a Map of ResultTypeConfig Objects with the result type name as the key
See Also:
ResultTypeConfig

getAllExceptionMappingConfigs

public java.util.List<ExceptionMappingConfig> getAllExceptionMappingConfigs()
returns the List of all the ExceptionMappingConfigs available in the current package. ExceptionMappingConfigs defined in ancestor packages will be included in this list.

Returns:
a List of ExceptionMappingConfigs Objects with the result type name as the key
See Also:
ExceptionMappingConfig

getDefaultInterceptorRef

public java.lang.String getDefaultInterceptorRef()

getDefaultActionRef

public java.lang.String getDefaultActionRef()

getDefaultClassRef

public java.lang.String getDefaultClassRef()

getDefaultResultType

public java.lang.String getDefaultResultType()
Returns the default result type for this package.


getFullDefaultInterceptorRef

public java.lang.String getFullDefaultInterceptorRef()
gets the default interceptor-ref name. If this is not set on this PackageConfig, it searches the parent PackageConfigs in order until it finds one.


getFullDefaultActionRef

public java.lang.String getFullDefaultActionRef()
gets the default action-ref name. If this is not set on this PackageConfig, it searches the parent PackageConfigs in order until it finds one.


getFullDefaultResultType

public java.lang.String getFullDefaultResultType()
Returns the default result type for this package.

If there is no default result type, but this package has parents - we will try to look up the default result type of a parent.


getGlobalResultConfigs

public java.util.Map<java.lang.String,ResultConfig> getGlobalResultConfigs()
gets the global ResultConfigs local to this package

Returns:
a Map of ResultConfig objects keyed by result name
See Also:
ResultConfig

getInterceptorConfigs

public java.util.Map<java.lang.String,java.lang.Object> getInterceptorConfigs()
gets the InterceptorConfigs and InterceptorStackConfigs local to this package

Returns:
a Map of InterceptorConfig and InterceptorStackConfig objects keyed by ref-name
See Also:
InterceptorConfig, InterceptorStackConfig

getName

public java.lang.String getName()

getNamespace

public java.lang.String getNamespace()

getParents

public java.util.List<PackageConfig> getParents()

getResultTypeConfigs

public java.util.Map<java.lang.String,ResultTypeConfig> getResultTypeConfigs()
gets the ResultTypeConfigs local to this package

Returns:
a Map of ResultTypeConfig objects keyed by result name
See Also:
ResultTypeConfig

isNeedsRefresh

public boolean isNeedsRefresh()

getGlobalExceptionMappingConfigs

public java.util.List<ExceptionMappingConfig> getGlobalExceptionMappingConfigs()
gets the ExceptionMappingConfigs local to this package

Returns:
a Map of ExceptionMappingConfig objects keyed by result name
See Also:
ExceptionMappingConfig

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

getInterceptorConfig

public java.lang.Object getInterceptorConfig(java.lang.String name)
Description copied from interface: InterceptorLocator
Gets an interceptor configuration object.

Specified by:
getInterceptorConfig in interface InterceptorLocator
Parameters:
name - The interceptor or interceptor stack name
Returns:
Either an InterceptorConfig or InterceptorStackConfig object


Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.