Package org.zaproxy.zap.model
Class DefaultValueGenerator
- java.lang.Object
-
- org.zaproxy.zap.model.DefaultValueGenerator
-
- All Implemented Interfaces:
ValueGenerator
public class DefaultValueGenerator extends java.lang.Object implements ValueGenerator
Default implementation of the ValueGenerator- Since:
- 2.6.0
-
-
Constructor Summary
Constructors Constructor Description DefaultValueGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Date
getDefaultDate()
Gets the defaultDate
, to be used for default values of date fields.java.lang.String
getValue(org.apache.commons.httpclient.URI uri, java.lang.String url, java.lang.String fieldId, java.lang.String defaultValue, java.util.List<java.lang.String> definedValues, java.util.Map<java.lang.String,java.lang.String> envAttributes, java.util.Map<java.lang.String,java.lang.String> fieldAttributes)
Generates accurate field values for following types: Text/Password/Search - DEFAULT_TEXT_VALUE number/range - if min is defined, then use min.void
setDefaultDate(java.util.Date date)
-
-
-
Method Detail
-
getDefaultDate
public java.util.Date getDefaultDate()
Gets the defaultDate
, to be used for default values of date fields.- Returns:
- the date, never
null
. - See Also:
setDefaultDate(Date)
-
setDefaultDate
public void setDefaultDate(java.util.Date date)
-
getValue
public java.lang.String getValue(org.apache.commons.httpclient.URI uri, java.lang.String url, java.lang.String fieldId, java.lang.String defaultValue, java.util.List<java.lang.String> definedValues, java.util.Map<java.lang.String,java.lang.String> envAttributes, java.util.Map<java.lang.String,java.lang.String> fieldAttributes)
Generates accurate field values for following types:- Text/Password/Search - DEFAULT_TEXT_VALUE
- number/range - if min is defined, then use min. If max is defined use max, otherwise DEFAULT_NUMBER_VALUE
- url - http://www.example.com
- email - [email protected]
- color - #ffffff
- tel - 9999999999
- date/datetime/time/month/week/datetime-local - current date in the proper format
- file - DEFAULT_FILE_VALUE
- Specified by:
getValue
in interfaceValueGenerator
- Parameters:
uri
- the uriurl
- the resolved URLfieldId
- the name associated with the current fielddefaultValue
- the value of 'value attribute' if it has onedefinedValues
- the predefined values for the field, if presentenvAttributes
- all attributes of the current formfieldAttributes
- all attributes of the current field- Returns:
- the default String value for each control type
-
-