HDIV API 2.0.4

org.hdiv.config
Class HDIVConfig

java.lang.Object
  extended by org.hdiv.config.HDIVConfig

public class HDIVConfig
extends java.lang.Object

Class containing HDIV configuration initialized from Spring Factory.

Author:
Roberto Velasco, Gorka Vicente

Field Summary
protected  java.util.Hashtable startPages
          Map with the pages that will not be Treated by the HDIV filter.
 
Constructor Summary
HDIVConfig()
           
 
Method Summary
 boolean areEditableParameterValuesValid(java.lang.String url, java.lang.String parameter, java.lang.String[] values, java.lang.String dataType)
           Checks if the values values are valid for the editable parameter parameter, using the validations defined in the hdiv-validations.xml configuration file of Spring.
 java.lang.String checkValue(java.lang.String value, java.util.Map startValues)
          Checks if value is an init action or parameter, in which case it will not be treated by HDIV.
 boolean existValidations()
          Checks if there are validations defined for editable fields
 java.lang.Boolean getConfidentiality()
           
 java.lang.String getErrorPage()
           
 java.util.Map getParamsWithoutValidation()
           
 java.util.Hashtable getProtectedURLPatterns()
           
 boolean isCookiesConfidentialityActivated()
           
 boolean isCookiesIntegrityActivated()
           
 boolean isParameterWithoutValidation(java.lang.String action, java.lang.String parameter)
          Checks if the parameter parameter is defined by the user as a no required validation parameter for the action action.
 boolean isStartPage(java.lang.String target)
          Checks if target is an init action, in which case it will not be treated by HDIV.
 boolean isStartParameter(java.lang.String parameter)
          Checks if parameter is an init parameter, in which case it will not be treated by HDIV.
 boolean needValidation(java.lang.String parameter, java.lang.String hdivParameter)
          Checks if the HDIV validation must be applied to the parameter parameter
 void setConfidentiality(java.lang.Boolean confidentiality)
           
 void setCookiesConfidentiality(java.lang.Boolean cookiesConfidentiality)
           
 void setCookiesIntegrity(java.lang.Boolean cookiesIntegrity)
           
 void setErrorPage(java.lang.String errorPage)
           
 void setParamsWithoutValidation(java.util.Map paramsWithoutValidation)
           
 void setProtectedExtensions(java.util.List protectedExtensions)
           
 void setUserStartPages(java.util.List userStartPages)
          It creates a map from the list of start pages defined by the user.
 void setUserStartParameters(java.util.List userStartParameters)
          It creates a map from the list of init parameters defined by the user.
 void setValidations(HDIVValidations validations)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

startPages

protected java.util.Hashtable startPages
Map with the pages that will not be Treated by the HDIV filter. The init pages are initialized by the Spring factory.

Constructor Detail

HDIVConfig

public HDIVConfig()
Method Detail

isStartParameter

public boolean isStartParameter(java.lang.String parameter)
Checks if parameter is an init parameter, in which case it will not be treated by HDIV.

Parameters:
parameter - Parameter name
Returns:
True if parameter is an init parameter. False otherwise.

isStartPage

public boolean isStartPage(java.lang.String target)
Checks if target is an init action, in which case it will not be treated by HDIV.

Parameters:
target - target name
Returns:
True if target is an init action. False otherwise.

isParameterWithoutValidation

public boolean isParameterWithoutValidation(java.lang.String action,
                                            java.lang.String parameter)
Checks if the parameter parameter is defined by the user as a no required validation parameter for the action action.

Parameters:
action - action name
parameter - parameter name
Returns:
True if it is parameter that needs no validation. False otherwise.

checkValue

public java.lang.String checkValue(java.lang.String value,
                                   java.util.Map startValues)
Checks if value is an init action or parameter, in which case it will not be treated by HDIV.

Parameters:
value - target or parameter name
startValues - Map with start values
Returns:
True if value is an init action or parameter. False otherwise.
Since:
HDIV 1.1.1

needValidation

public boolean needValidation(java.lang.String parameter,
                              java.lang.String hdivParameter)
Checks if the HDIV validation must be applied to the parameter parameter

Parameters:
parameter - Parameter name
hdivParameter - Name of the parameter that HDIV will include in the requests or/and forms which contains the state identifier parameter
Returns:
True if parameter doesn't need HDIV validation.

getErrorPage

public java.lang.String getErrorPage()

setErrorPage

public void setErrorPage(java.lang.String errorPage)

getConfidentiality

public java.lang.Boolean getConfidentiality()

setConfidentiality

public void setConfidentiality(java.lang.Boolean confidentiality)

getParamsWithoutValidation

public java.util.Map getParamsWithoutValidation()

setParamsWithoutValidation

public void setParamsWithoutValidation(java.util.Map paramsWithoutValidation)

setUserStartPages

public void setUserStartPages(java.util.List userStartPages)
It creates a map from the list of start pages defined by the user.

Parameters:
userStartPages - list of start pages defined by the user

setUserStartParameters

public void setUserStartParameters(java.util.List userStartParameters)
It creates a map from the list of init parameters defined by the user.

Parameters:
userStartPages - list of init parameters defined by the user

setValidations

public void setValidations(HDIVValidations validations)
Parameters:
validations - The validations to set.
Since:
HDIV 1.1

existValidations

public boolean existValidations()
Checks if there are validations defined for editable fields

Returns:
True if validations for editable fields have been defined. False otherwise.
Since:
HDIV 1.1

areEditableParameterValuesValid

public boolean areEditableParameterValuesValid(java.lang.String url,
                                               java.lang.String parameter,
                                               java.lang.String[] values,
                                               java.lang.String dataType)

Checks if the values values are valid for the editable parameter parameter, using the validations defined in the hdiv-validations.xml configuration file of Spring.

There are two types of validations:

  • accepted: the value is valid only if it passes the validation
  • rejected: the value is rejected if doesn't pass the validation
  • Parameters:
    target - target name
    parameter - parameter name
    values - parameter's values
    dataType - editable data type
    Returns:
    True if the values values are valid for the parameter parameter.
    Since:
    HDIV 1.1

    isCookiesConfidentialityActivated

    public boolean isCookiesConfidentialityActivated()
    Returns:
    Returns true if cookies' confidentiality is activated.

    setCookiesConfidentiality

    public void setCookiesConfidentiality(java.lang.Boolean cookiesConfidentiality)
    Parameters:
    cookiesConfidentiality - The cookiesConfidentiality to set.

    isCookiesIntegrityActivated

    public boolean isCookiesIntegrityActivated()
    Returns:
    Returns true if cookies' integrity is activated.

    setCookiesIntegrity

    public void setCookiesIntegrity(java.lang.Boolean cookiesIntegrity)
    Parameters:
    cookiesIntegrity - The cookiesIntegrity to set.

    setProtectedExtensions

    public void setProtectedExtensions(java.util.List protectedExtensions)
    Parameters:
    protectedExtensions - The protected extensions to set.
    Since:
    HDIV 2.0

    getProtectedURLPatterns

    public java.util.Hashtable getProtectedURLPatterns()
    Returns:
    Returns the protected extensions.
    Since:
    HDIV 2.0

    HDIV 2.0.4

    Copyright © 2008 hdiv.org. All Rights Reserved.