public class EldaURL extends Object
Modifier and Type | Class and Description |
---|---|
static class |
EldaURL.NamedParameterValue
A pair of parameter name and value
|
static class |
EldaURL.URLParameterValue
A parameter value in the URL construction overall may have more than one value, with a comma separator
|
Constructor and Description |
---|
EldaURL(String url)
Construct an Elda page URL by parsing the given string as a URI
|
EldaURL(URI url)
Construct an Elda page URL from the given URI object
|
Modifier and Type | Method and Description |
---|---|
protected EldaURL |
generateURL(Map<String,EldaURL.URLParameterValue> parameters)
Generate a URL that has the same structure as this URL, except for the given parameters.
|
EldaURL.URLParameterValue |
getParameter(String paramName) |
List<EldaURL.NamedParameterValue> |
getParameters(boolean external)
Return a list of URL parameters, possibly excluding those internal
use parameters (i.e.
|
URI |
getUri() |
boolean |
hasParameter(String paramName,
String paramValue) |
protected boolean |
isInternalParameterName(String name) |
protected Map<String,EldaURL.URLParameterValue> |
parseQueryParameters()
Parse the query string, if there is one, into a structure we can manipulate
|
protected String |
queryString(Map<String,EldaURL.URLParameterValue> qParams)
Turn the parsed query parameters back into a string
|
String |
toString() |
protected void |
updateParameters(Map<String,EldaURL.URLParameterValue> parameters,
String paramName,
EldaURL.URLParameterValue value)
Use the given value to update the parameters.
|
EldaURL |
withParameter(com.epimorphics.lda.renderers.common.EldaURL.OPERATION op,
String paramName,
String paramValue)
Create a new EldaURL by applying an operation to this URL to add, remove or set
a parameter value.
|
EldaURL |
withParameter(String op,
String paramName,
String paramValue)
Create a new EldaURL by applying an operation to this URL to add, remove or set
a parameter value.
|
public EldaURL(String url)
url
- String denoting the page URLEldaException
- if the given string is not a legal URIpublic EldaURL(URI url)
url
- public EldaURL withParameter(String op, String paramName, String paramValue)
op
- The operation as a stringparamName
- The name of the parameter (e.g. _properties)paramValue
- The value to be used with the operationwithParameter(OPERATION, String, String)
public EldaURL withParameter(com.epimorphics.lda.renderers.common.EldaURL.OPERATION op, String paramName, String paramValue)
op
- The operation: ADD ensures that the parameter has the value, REMOVE ensures that the
parameter does not have the value, and SET ensures that the parameter has only
that valueparamName
- The name of the parameter (e.g. _properties)paramValue
- The value to be used with the operationpublic boolean hasParameter(String paramName, String paramValue)
public EldaURL.URLParameterValue getParameter(String paramName)
public List<EldaURL.NamedParameterValue> getParameters(boolean external)
external
- If true, remove internal-use parameterspublic URI getUri()
protected void updateParameters(Map<String,EldaURL.URLParameterValue> parameters, String paramName, EldaURL.URLParameterValue value)
value
is empty, remove
the paramName
key.parameters
- The parameters map to be updatedparamName
- The parameter keyvalue
- The revised valueprotected Map<String,EldaURL.URLParameterValue> parseQueryParameters()
protected String queryString(Map<String,EldaURL.URLParameterValue> qParams)
protected EldaURL generateURL(Map<String,EldaURL.URLParameterValue> parameters)
parameters
- Parameters of the new URL object, as a mapprotected boolean isInternalParameterName(String name)
Copyright © 2014. All Rights Reserved.