org.mmbase.bridge.jsp.taglib.pageflow
Class Url

java.lang.Object
  extended by org.mmbase.bridge.jsp.taglib.pageflow.Url
All Implemented Interfaces:
CharSequence, Comparable, Casting.Unwrappable

public class Url
extends Object
implements Comparable, CharSequence, Casting.Unwrappable

A lazy 'URL' creator. A container object that contains all necessary information to construct an URL, but will only do it on actual request (by the get(boolean)) method. This is also what is stored by an url-tag with an id attribute.

The creation of the URL is delegated to the MMBase framework.

Since:
MMBase-1.9
Version:
$Id: Url.java 41054 2010-02-15 23:26:44Z michiel $;

Nested Class Summary
(package private) static class Url.ImplicitList
           
 
Field Summary
(package private) static Pattern ABSOLUTE_URLS
           
protected  Map<String,Object> frameworkParams
           
protected  Map<String,Object> params
           
 
Constructor Summary
Url(ContextReferrerTag t, CharSequence p, String a)
          Used e.g.
Url(Url u, boolean escapeAmps, boolean encode)
           
Url(UrlTag t, CharSequence p, Map<String,Object> framework, Map<String,Object> pars, boolean intern)
           
Url(UrlTag t, Url u, Map<String,Object> framework, Map<String,Object> pars, boolean intern)
           
 
Method Summary
static Map<String,Object> addParameter(Map<String,Object> map, String key, Object value)
          Add a key/value pair to a map, but does not replace the already exsiting mapping.
 char charAt(int index)
           
 int compareTo(Object o)
           
(package private)  void doEndTag()
           
 String get()
          Returns the actual URL, considering all options of the url-tag, like 'absolute' and 'encode'.
 String get(boolean escapeamp)
          Returns the URL as a String, always without the application context.
static Component getComponent(ContextReferrerTag tag)
           
 boolean getEncodeUrl()
           
 boolean getEscapeAmps()
           
 String getLegacy(boolean escapeamp)
           
protected  void invalidate()
           
 int length()
           
 void setLegacy()
           
 void setProcess()
           
 CharSequence subSequence(int start, int end)
           
 String toString()
           
protected  boolean useAbsoluteAttribute(StringBuilder show, String p)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

params

protected final Map<String,Object> params

frameworkParams

protected final Map<String,Object> frameworkParams

ABSOLUTE_URLS

static final Pattern ABSOLUTE_URLS
Constructor Detail

Url

public Url(UrlTag t,
           CharSequence p,
           Map<String,Object> framework,
           Map<String,Object> pars,
           boolean intern)
    throws JspTagException
Throws:
JspTagException

Url

public Url(UrlTag t,
           Url u,
           Map<String,Object> framework,
           Map<String,Object> pars,
           boolean intern)
    throws JspTagException
Throws:
JspTagException

Url

public Url(ContextReferrerTag t,
           CharSequence p,
           String a)
    throws JspTagException
Used e.g. by mm:form

Throws:
JspTagException

Url

Url(Url u,
    boolean escapeAmps,
    boolean encode)
Since:
MMBase-1.9.1
Method Detail

getComponent

public static Component getComponent(ContextReferrerTag tag)

setProcess

public void setProcess()

setLegacy

public void setLegacy()

getLegacy

public String getLegacy(boolean escapeamp)
                 throws JspTagException
Throws:
JspTagException

get

public String get(boolean escapeamp)
           throws JspTagException,
                  FrameworkException
Returns the URL as a String, always without the application context. Never null

Throws:
JspTagException
FrameworkException

useAbsoluteAttribute

protected boolean useAbsoluteAttribute(StringBuilder show,
                                       String p)
                                throws JspTagException
Throws:
JspTagException

get

public String get()
Returns the actual URL, considering all options of the url-tag, like 'absolute' and 'encode'.


getEncodeUrl

public boolean getEncodeUrl()

getEscapeAmps

public boolean getEscapeAmps()

invalidate

protected void invalidate()

charAt

public char charAt(int index)
Specified by:
charAt in interface CharSequence

length

public int length()
Specified by:
length in interface CharSequence

subSequence

public CharSequence subSequence(int start,
                                int end)
Specified by:
subSequence in interface CharSequence

toString

public String toString()
Specified by:
toString in interface CharSequence
Overrides:
toString in class Object

compareTo

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

doEndTag

void doEndTag()

addParameter

public static Map<String,Object> addParameter(Map<String,Object> map,
                                              String key,
                                              Object value)
Add a key/value pair to a map, but does not replace the already exsiting mapping. In stead, the already mapped value is converted to a list, contain both values.



MMBase 2.0-SNAPSHOT - null