org.apache.sling.api.request
Class RequestDispatcherOptions

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<java.lang.String,java.lang.String>
          extended by org.apache.sling.api.request.RequestDispatcherOptions
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,java.lang.String>

public class RequestDispatcherOptions
extends java.util.HashMap<java.lang.String,java.lang.String>

RequestDispatcherOptions are used in the SlingHttpServletRequest.getRequestDispatcher(org.apache.sling.api.resource.Resource, RequestDispatcherOptions) method, to give more control on some aspects of the include/forward mechanism. Typical use cases include:

This class currently only inherits from Map, and defines some constants for well-known options.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>
 
Field Summary
static java.lang.String OPT_ADD_SELECTORS
          When dispatching, add the value provided by this option to the RequestPathInfo selectors.
static java.lang.String OPT_FORCE_RESOURCE_TYPE
          When dispatching, use the value provided by this option as the resource type, instead of the one defined by the Resource.
static java.lang.String OPT_REPLACE_SELECTORS
          When dispatching, replace RequestPathInfo selectors by the value provided by this option.
static java.lang.String OPT_REPLACE_SUFFIX
          When dispatching, replace the RequestPathInfo suffix by the value provided by this option
 
Constructor Summary
RequestDispatcherOptions()
          Creates an instance with no options set.
RequestDispatcherOptions(java.lang.String options)
          Creates a new instances setting options by parsing the given options string as follows: If the string is empty or null no options are set.
 
Method Summary
 java.lang.String getAddSelectors()
          Returns the OPT_ADD_SELECTORS option or null if not set.
 java.lang.String getForceResourceType()
          Returns the OPT_FORCE_RESOURCE_TYPE option or null if not set.
 java.lang.String getReplaceSelectors()
          Returns the OPT_REPLACE_SELECTORS option or null if not set.
 java.lang.String getReplaceSuffix()
          Returns the OPT_REPLACE_SUFFIX option or null if not set.
 void setAddSelectors(java.lang.String additionalSelectors)
          Sets the OPT_ADD_SELECTORS option to the given additionalSelectors if not null.
 void setForceResourceType(java.lang.String resourceType)
          Sets the OPT_FORCE_RESOURCE_TYPE option to the given resourceType if not null.
 void setReplaceSelectors(java.lang.String replaceSelectors)
          Sets the OPT_REPLACE_SELECTORS option to the given replaceSelectors if not null.
 void setReplaceSuffix(java.lang.String replaceSuffix)
          Sets the OPT_REPLACE_SUFFIX option to the given replaceSuffix if not null.
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

OPT_FORCE_RESOURCE_TYPE

public static final java.lang.String OPT_FORCE_RESOURCE_TYPE
When dispatching, use the value provided by this option as the resource type, instead of the one defined by the Resource.

See Also:
Constant Field Values

OPT_REPLACE_SELECTORS

public static final java.lang.String OPT_REPLACE_SELECTORS
When dispatching, replace RequestPathInfo selectors by the value provided by this option.

See Also:
Constant Field Values

OPT_ADD_SELECTORS

public static final java.lang.String OPT_ADD_SELECTORS
When dispatching, add the value provided by this option to the RequestPathInfo selectors.

See Also:
Constant Field Values

OPT_REPLACE_SUFFIX

public static final java.lang.String OPT_REPLACE_SUFFIX
When dispatching, replace the RequestPathInfo suffix by the value provided by this option

See Also:
Constant Field Values
Constructor Detail

RequestDispatcherOptions

public RequestDispatcherOptions()
Creates an instance with no options set.


RequestDispatcherOptions

public RequestDispatcherOptions(java.lang.String options)
Creates a new instances setting options by parsing the given options string as follows:

Parameters:
options - The options to set.
Method Detail

setForceResourceType

public void setForceResourceType(java.lang.String resourceType)
Sets the OPT_FORCE_RESOURCE_TYPE option to the given resourceType if not null.


getForceResourceType

public java.lang.String getForceResourceType()
Returns the OPT_FORCE_RESOURCE_TYPE option or null if not set.


setAddSelectors

public void setAddSelectors(java.lang.String additionalSelectors)
Sets the OPT_ADD_SELECTORS option to the given additionalSelectors if not null.


getAddSelectors

public java.lang.String getAddSelectors()
Returns the OPT_ADD_SELECTORS option or null if not set.


setReplaceSelectors

public void setReplaceSelectors(java.lang.String replaceSelectors)
Sets the OPT_REPLACE_SELECTORS option to the given replaceSelectors if not null.


getReplaceSelectors

public java.lang.String getReplaceSelectors()
Returns the OPT_REPLACE_SELECTORS option or null if not set.


setReplaceSuffix

public void setReplaceSuffix(java.lang.String replaceSuffix)
Sets the OPT_REPLACE_SUFFIX option to the given replaceSuffix if not null.


getReplaceSuffix

public java.lang.String getReplaceSuffix()
Returns the OPT_REPLACE_SUFFIX option or null if not set.



Copyright © 2007-2009. All Rights Reserved.