Class PackageConfig
java.lang.Object
org.apache.struts2.util.location.Located
org.apache.struts2.config.entities.PackageConfig
- All Implemented Interfaces:
Serializable
,Comparable<PackageConfig>
,InterceptorLocator
,Locatable
public class PackageConfig
extends Located
implements Comparable<PackageConfig>, Serializable, InterceptorLocator
Configuration for Package.
In the xml configuration file this is defined as the package
tag.
- See Also:
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map<String,
ActionConfig> protected String
protected String
protected String
protected String
protected List<ExceptionMappingConfig>
protected Map<String,
ResultConfig> protected boolean
protected boolean
protected String
protected String
protected boolean
protected List<PackageConfig>
protected Map<String,
ResultTypeConfig> protected boolean
-
Constructor Summary
ModifierConstructorDescriptionprotected
PackageConfig
(String name) protected
PackageConfig
(PackageConfig orig) -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(PackageConfig other) boolean
returns the Map of all the ActionConfigs available in the current package.returns the List of all the ExceptionMappingConfigs available in the current package.returns the Map of all the global ResultConfigs available in the current package.returns the Map of all InterceptorConfigs and InterceptorStackConfigs available in the current package.returns the Map of all the ResultTypeConfigs available in the current package.Returns the default result type for this package.gets the GlobalAllowedMethods local to this packagegets the ExceptionMappingConfigs local to this packagegets the global ResultConfigs local to this packagegetInterceptorConfig
(String name) Gets an interceptor configuration object.gets the InterceptorConfigs and InterceptorStackConfigs local to this packagegetName()
gets the ResultTypeConfigs local to this packageint
hashCode()
boolean
boolean
isFinal()
boolean
boolean
toString()
Methods inherited from class org.apache.struts2.util.location.Located
getLocation, setLocation
-
Field Details
-
actionConfigs
-
globalResultConfigs
-
globalAllowedMethods
-
interceptorConfigs
-
resultTypeConfigs
-
globalExceptionMappingConfigs
-
parents
-
defaultInterceptorRef
-
defaultActionRef
-
defaultResultType
-
defaultClassRef
-
name
-
namespace
-
isAbstract
protected boolean isAbstract -
isFinal
protected boolean isFinal -
needsRefresh
protected boolean needsRefresh -
strictMethodInvocation
protected boolean strictMethodInvocation
-
-
Constructor Details
-
PackageConfig
-
PackageConfig
-
-
Method Details
-
isAbstract
public boolean isAbstract() -
isFinal
public boolean isFinal() -
getActionConfigs
-
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:
-
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:
-
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:
-
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:
-
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:
-
getDefaultInterceptorRef
-
getDefaultActionRef
-
getDefaultClassRef
-
getDefaultResultType
- Returns:
- the default result type for this package.
-
getFullDefaultInterceptorRef
- Returns:
- 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
- Returns:
- 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
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.
- Returns:
- the default result type for this package.
-
getGlobalResultConfigs
gets the global ResultConfigs local to this package- Returns:
- a Map of ResultConfig objects keyed by result name
- See Also:
-
getInterceptorConfigs
gets the InterceptorConfigs and InterceptorStackConfigs local to this package- Returns:
- a Map of InterceptorConfig and InterceptorStackConfig objects keyed by ref-name
- See Also:
-
getName
-
getNamespace
-
getParents
-
getResultTypeConfigs
gets the ResultTypeConfigs local to this package- Returns:
- a Map of ResultTypeConfig objects keyed by result name
- See Also:
-
isNeedsRefresh
public boolean isNeedsRefresh() -
getGlobalExceptionMappingConfigs
gets the ExceptionMappingConfigs local to this package- Returns:
- a Map of ExceptionMappingConfig objects keyed by result name
- See Also:
-
getGlobalAllowedMethods
gets the GlobalAllowedMethods local to this package- Returns:
- a Set of method names allowed to be executed if strict method invocation is enabled
-
isStrictMethodInvocation
public boolean isStrictMethodInvocation() -
equals
-
hashCode
public int hashCode() -
toString
-
compareTo
- Specified by:
compareTo
in interfaceComparable<PackageConfig>
-
getInterceptorConfig
Description copied from interface:InterceptorLocator
Gets an interceptor configuration object.- Specified by:
getInterceptorConfig
in interfaceInterceptorLocator
- Parameters:
name
- The interceptor or interceptor stack name- Returns:
- Either an
InterceptorConfig
orInterceptorStackConfig
object
-