juzu.request
Interface Dispatch

All Known Implementing Classes:
Phase.Action.Dispatch, Phase.Resource.Dispatch, Phase.View.Dispatch, Response.View

public interface Dispatch

The Dispatch object represents the dispatch to a controller method. It can be used for generating URL or as a Response.View objects. A dispatch object can be obtained from a RequestContext object for building controller methods, however the best way to obtain a builder is to use a controller companion that provides a type safe way for creating fully configured dispatch.

Type safe Dispatch factory method are generated for each view, action or resource controller methods. The signature of a dispatch factory is the same as the original method.

    public void MyController {

       @Action
       public Response.View myAction(String param) {
          return MyController_.myRender();
       }

       @View
       public void myRender() {
          String url = MyController_.myAction("hello");
       }
    }
 

Author:
Julien Viet

Method Summary
 Dispatch escapeXML(Boolean escapeXML)
           
 Dispatch setParameter(Encoding encoding, String name, String value)
          Set a parameter on the URL that will be built by this builder.
 Dispatch setParameter(Encoding encoding, String name, String[] value)
          Set a parameter on the URL that will be built by this builder.
 Dispatch setParameter(String name, String value)
          Set a parameter on the URL that will be built by this builder.
 Dispatch setParameter(String name, String[] value)
          Set a parameter.
<T> Dispatch
setProperty(PropertyType<T> propertyType, T propertyValue)
          Set or clear a property of the URL.
 String toString()
           
 Dispatch with(juzu.impl.common.MimeType mimeType)
           
 Dispatch with(PropertyMap properties)
           
 

Method Detail

with

Dispatch with(juzu.impl.common.MimeType mimeType)

with

Dispatch with(PropertyMap properties)

escapeXML

Dispatch escapeXML(Boolean escapeXML)

setProperty

<T> Dispatch setProperty(PropertyType<T> propertyType,
                         T propertyValue)
                     throws IllegalArgumentException
Set or clear a property of the URL.

Type Parameters:
T - the property generic type
Parameters:
propertyType - the property type
propertyValue - the property value
Returns:
this URL builder
Throws:
IllegalArgumentException - if the property is not valid

setParameter

Dispatch setParameter(String name,
                      String value)
                      throws NullPointerException

Set a parameter on the URL that will be built by this builder. This method replaces the parameter with the given name . A parameter value of null indicates that this parameter should be removed.

Parameters:
name - the parameter name
value - the parameter value
Throws:
NullPointerException - if the name parameter is null

setParameter

Dispatch setParameter(Encoding encoding,
                      String name,
                      String value)
                      throws NullPointerException

Set a parameter on the URL that will be built by this builder. This method replaces the parameter with the given name . A parameter value of null indicates that this parameter should be removed.

Parameters:
encoding - the character encoding
name - the parameter name
value - the parameter value
Throws:
NullPointerException - if the name parameter is null
IllegalArgumentException - if the encoding is not allowed

setParameter

Dispatch setParameter(String name,
                      String[] value)
                      throws NullPointerException,
                             IllegalArgumentException
Set a parameter. This method replaces the parameter with the given name . An zero length parameter value indicates that this parameter should be removed.

The inserted value is cloned before its insertion in the map.

Parameters:
name - the parameter name
value - the parameter value
Throws:
NullPointerException - if the name parameter or the value parameter is null
IllegalArgumentException - if any component of the value is null

setParameter

Dispatch setParameter(Encoding encoding,
                      String name,
                      String[] value)
                      throws IllegalArgumentException,
                             NullPointerException

Set a parameter on the URL that will be built by this builder. This method replaces the parameter with the given name . A parameter value of null indicates that this parameter should be removed.

Parameters:
encoding - the character encoding
name - the parameter name
value - the parameter value
Throws:
NullPointerException - if the name parameter is null
IllegalArgumentException - if the encoding is not allowed, if any component of the value is null

toString

String toString()
Overrides:
toString in class Object


Copyright © 2013 eXo Platform SAS. All Rights Reserved.