Package com.saperion.rs.parameter
Class WeblinkParameter
- java.lang.Object
-
- com.saperion.rs.parameter.WeblinkParameter
-
public class WeblinkParameter extends java.lang.Object
The Class WeblinkParameter. Holds all path and query parameters from a weblink request. Parameters are filled by the ProviderWeblinkParameterFactory
.
-
-
Constructor Summary
Constructors Constructor Description WeblinkParameter(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> parameters)
Instantiates a new weblink parameter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WeblinkParameter
addValidation(java.lang.String parameter)
Adds the standard validation to this WeblinkParameter object.WeblinkParameter
addValidation(java.lang.String parameter, Validation validation)
Adds a validation to this WeblinkParameter object.WeblinkParameter
clearValidation()
Clear validation.java.lang.String
getArchive()
Gets the archive/DDC from request.boolean
getCurrentRevision()
Gets the current revision.int
getElement()
Gets the doc element from request.java.lang.String
getField()
Gets the DDC field from request.java.lang.String
getFilename()
Gets the document filename from request.java.lang.String
getId()
Gets the id.java.util.Map<java.lang.String,java.lang.String>
getQueryParameterMap()
Creates the query parameter map with all query parameter given by the MultivaluedMap map queryParameters.boolean
getReleased()
Gets the released .java.lang.String
getSecure()
Gets the secure parameter from request.long
getTimeout()
Gets the timeout parameter from request.java.util.List<java.lang.String>
getWeblinkPath()
Builds the weblink path.boolean
isSecure()
Checks if is secure parameter is set.java.lang.String
toString()
boolean
validate()
Validate.
-
-
-
Method Detail
-
getArchive
public java.lang.String getArchive()
Gets the archive/DDC from request.- Returns:
- the archive
-
getField
public java.lang.String getField()
Gets the DDC field from request.- Returns:
- the field
-
getId
public java.lang.String getId()
Gets the id.- Returns:
- the id
-
getElement
public int getElement()
Gets the doc element from request.- Returns:
- the element number,
WeblinkUtil.ALL_ELEMENT
if not set
-
getSecure
public java.lang.String getSecure()
Gets the secure parameter from request.- Returns:
- the secure
-
isSecure
public boolean isSecure()
Checks if is secure parameter is set.- Returns:
- true, if is secure parameter is set to true
-
getFilename
public java.lang.String getFilename()
Gets the document filename from request.- Returns:
- the filename
-
getReleased
public boolean getReleased()
Gets the released .- Returns:
- true, if released parameter is set to "true" in request
-
getTimeout
public long getTimeout()
Gets the timeout parameter from request.- Returns:
- the timeout
-
getCurrentRevision
public boolean getCurrentRevision()
Gets the current revision.- Returns:
- true, if the current revision parameter is set to "true" in request
-
getWeblinkPath
public java.util.List<java.lang.String> getWeblinkPath()
Builds the weblink path. Returns the path segments as list,.- Returns:
- the path segment list
-
getQueryParameterMap
public java.util.Map<java.lang.String,java.lang.String> getQueryParameterMap()
Creates the query parameter map with all query parameter given by the MultivaluedMap map queryParameters. Keys are the REQ_PARAM constants (@seeWeblinkUtil
. Values are the query parameters.- Returns:
- the map with key = REQ_PARAM constant, value = query parameter
-
addValidation
public WeblinkParameter addValidation(java.lang.String parameter, Validation validation)
Adds a validation to this WeblinkParameter object. Validation of this object can be started by calling the validate() method.- Parameters:
parameter
- the request parameter to validatevalidation
- the Validation implementation to do the validation- Returns:
- this object for build pattern
-
addValidation
public WeblinkParameter addValidation(java.lang.String parameter)
Adds the standard validation to this WeblinkParameter object. Standard validation isBlankValidation
. Convenience method, calls addValidation(parameter, new BlankValidation()).- Parameters:
parameter
- the request parameter to validate- Returns:
- this object for build pattern
-
clearValidation
public WeblinkParameter clearValidation()
Clear validation. Removes all added validations from this object.- Returns:
- this object for build pattern
-
validate
public boolean validate()
Validate. Starts the validation process. Iterates over all added validations and checks the query parameter against the validation.- Returns:
- true, if validation was successful
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- See Also:
Object.toString()
-
-