org.juzu
Interface URLBuilder


public interface URLBuilder

The URLBuilder produces URL for a Juzu application.

Builders can be obtained from a MimeContext object for building controller methods, however the favorite way to obtain a builder is to use a controller companion that provides a type safe way for creating fully configured builders.

Type safe URLBuilder factory method are generated for each view, action or resource controller methods. The signature of an url builder factory is obtained by translating the signature of the controller method and appending the suffix URL after the method name.

    public void MyController {

       @Action
       public void myAction(String param) { }

       @View
       public void myRender() {
          URLBuilder builder = MyController_.myActionURL("hello");
          String url = builder.toString();
       }
    }
 

Author:
Julien Viet

Method Summary
 URLBuilder setParameter(String name, String value)
          Set a parameter on the URL that will be built by this builder.
 String toString()
          Build the string value of this URL.
 

Method Detail

setParameter

URLBuilder 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
Returns:
this builder
Throws:
NullPointerException - if the name parameter is null

toString

String toString()
Build the string value of this URL.

Overrides:
toString in class Object
Returns:
the string url


Copyright © 2011 eXo Platform SAS. All Rights Reserved.