|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tapestry5.internal.services.LinkImpl
public class LinkImpl
Constructor Summary | |
---|---|
LinkImpl(String basePath,
boolean forForm,
LinkSecurity defaultSecurity,
Response response,
ContextPathEncoder contextPathEncoder,
BaseURLSource baseURLSource)
|
Method Summary | |
---|---|
void |
addParameter(String parameterName,
String value)
Adds a parameter value. |
Link |
addParameterValue(String parameterName,
Object value)
Adds a parameter value as a value object; the value object is converted to a string via ContextPathEncoder.encodeValue(Object) and the result is added via Link.addParameter(String, String) . |
Link |
copyWithBasePath(String basePath)
Creates a copy of this link that has the same parameters, anchor, and other attributes, but a different base path. |
String |
getAnchor()
Returns the link anchor. |
String |
getBasePath()
Returns the completely unadorned base path. |
List<String> |
getParameterNames()
Returns the names of any additional query parameters for the URI. |
String |
getParameterValue(String name)
Returns the value of a specifically named query parameter, or null if no such query parameter is stored in the link. |
String[] |
getParameterValues(String parameterName)
Returns the parameter values for the given name. |
LinkSecurity |
getSecurity()
Returns the current security for this link, which reflects whether the targetted page is itself secure or insecure. |
void |
removeParameter(String parameterName)
Removes a parameter value, which is occasionally useful when transforming a parameter into a portion of the path. |
void |
setAnchor(String anchor)
Sets the link anchor. |
void |
setSecurity(LinkSecurity newSecurity)
Changes the link's security, which can be useful to force a link to be either secure or insecure when normally it might not be. |
String |
toAbsoluteURI()
Returns the absolute URL, which includes the scheme, hostname and possibly port (as per BaseURLSource.getBaseURL(boolean) ). |
String |
toAbsoluteURI(boolean secure)
Returns either the secure or insecure URL, with complete scheme, hostname and possibly port (as per BaseURLSource.getBaseURL(boolean) ). |
String |
toRedirectURI()
Returns the link as a redirect URI. |
String |
toString()
Returns the value from toURI() |
String |
toURI()
Returns the URI portion of the link. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LinkImpl(String basePath, boolean forForm, LinkSecurity defaultSecurity, Response response, ContextPathEncoder contextPathEncoder, BaseURLSource baseURLSource)
Method Detail |
---|
public Link copyWithBasePath(String basePath)
Link
copyWithBasePath
in interface Link
public void addParameter(String parameterName, String value)
Link
URLCodec
.
addParameter
in interface Link
parameterName
- the name of the parameter to storevalue
- the value to store, a null or blank value is allowed (as of Tapestry 5.3)public String getBasePath()
Link
Link.toURI()
), may append
an anchor or query parameters.
getBasePath
in interface Link
public void removeParameter(String parameterName)
Link
removeParameter
in interface Link
public String getAnchor()
Link
getAnchor
in interface Link
public List<String> getParameterNames()
Link
getParameterNames
in interface Link
public String getParameterValue(String name)
Link
Use this method only when you are sure the parameter has only one value. If the parameter might have more than
one value, use Link.getParameterValues(java.lang.String)
.
If you use this method with a multivalued parameter, the value returned is equal to the first value in the
array returned by getParameterValues
.
getParameterValue
in interface Link
public void setAnchor(String anchor)
Link
setAnchor
in interface Link
anchor
- the link anchorpublic String toAbsoluteURI()
Link
BaseURLSource.getBaseURL(boolean)
).
By default, the scheme is chosen to match the current requests security.
Note: the semantics of this method changed between Tapestry 5.1 and 5.2. Most code should use toString() or
Link.toURI()
(which are equivalent) instead.
toAbsoluteURI
in interface Link
public String toAbsoluteURI(boolean secure)
Link
BaseURLSource.getBaseURL(boolean)
).
toAbsoluteURI
in interface Link
public void setSecurity(LinkSecurity newSecurity)
Link
setSecurity
in interface Link
newSecurity
- new security value, not null, typically LinkSecurity.FORCE_SECURE
or LinkSecurity.FORCE_INSECURE
public LinkSecurity getSecurity()
Link
getSecurity
in interface Link
public String toRedirectURI()
Link
toRedirectURI
in interface Link
public String toURI()
Link
toURI
in interface Link
public String toString()
toURI()
toString
in class Object
public Link addParameterValue(String parameterName, Object value)
Link
ContextPathEncoder.encodeValue(Object)
and the result is added via Link.addParameter(String, String)
.
The Link object is returned for further configuration.
addParameterValue
in interface Link
public String[] getParameterValues(String parameterName)
Link
getParameterValues
in interface Link
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |