@ProviderType
public interface Form
| Modifier and Type | Method and Description |
|---|---|
String |
get(String key)
Gets the data associated with a Form data key
|
Map<String,String> |
getData()
Gets a Map of the Form data
|
String |
getError(String key)
Gets the error message
|
Map<String,String> |
getErrors()
Gets a Map of the error data
|
org.apache.sling.api.resource.ValueMap |
getErrorsValueMap()
Get Errors as ValueMap
|
String |
getName()
Get the Form's name
|
String |
getResourcePath()
Get the Form's resource path
|
org.apache.sling.api.resource.ValueMap |
getValueMap()
Get data as ValueMap
|
boolean |
has(String key)
Determines if a Form data key exists and has non-blank data
|
boolean |
hasData()
Determines if any Form Data exists; atleast 1 key w non-blank data must exist in the data map.
|
boolean |
hasError(String key)
Determines if an error exists
|
boolean |
hasErrors()
Checks if has data
|
void |
set(String key,
String value)
Sets Form data
|
void |
setError(String key)
Sets an error
|
void |
setError(String key,
String value)
Sets an error for key with corresponding error message/data
|
void |
setName(String name)
Sets the Form name
|
void |
setResourcePath(String resourcePath)
Sets the Form's resource path
|
String getName()
This should uniquely identify a Form on a Page
void setName(String name)
Typically this setter is not used and Form names are set in constructor.
This can be helpful for changing the flow or using Form X to populate Form Y
name - String getResourcePath()
void setResourcePath(String resourcePath)
resourcePath - boolean has(String key)
key - boolean hasData()
boolean hasError(String key)
key - void setError(String key)
This is used if no corresponding error message/data is required to be associated; and the only information required is that an error occurred against key X.
key - void setError(String key, String value)
key - value - boolean hasErrors()
org.apache.sling.api.resource.ValueMap getValueMap()
org.apache.sling.api.resource.ValueMap getErrorsValueMap()
Copyright © 2013–2020 Adobe. All rights reserved.