Package com.adobe.acs.commons.forms
Interface Form
-
@ProviderType public interface Form
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Stringget(String key)Gets the data associated with a Form data keyMap<String,String>getData()Gets a Map of the Form dataStringgetError(String key)Gets the error messageMap<String,String>getErrors()Gets a Map of the error dataorg.apache.sling.api.resource.ValueMapgetErrorsValueMap()Get Errors as ValueMapStringgetName()Get the Form's nameStringgetResourcePath()Get the Form's resource pathorg.apache.sling.api.resource.ValueMapgetValueMap()Get data as ValueMapbooleanhas(String key)Determines if a Form data key exists and has non-blank databooleanhasData()Determines if any Form Data exists; atleast 1 key w non-blank data must exist in the data map.booleanhasError(String key)Determines if an error existsbooleanhasErrors()Checks if has datavoidset(String key, String value)Sets Form datavoidsetError(String key)Sets an errorvoidsetError(String key, String value)Sets an error for key with corresponding error message/datavoidsetName(String name)Sets the Form namevoidsetResourcePath(String resourcePath)Sets the Form's resource path
-
-
-
Method Detail
-
getName
String getName()
Get the Form's nameThis should uniquely identify a Form on a Page
- Returns:
-
setName
void setName(String name)
Sets the Form nameTypically 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
- Parameters:
name-
-
getResourcePath
String getResourcePath()
Get the Form's resource path- Returns:
-
setResourcePath
void setResourcePath(String resourcePath)
Sets the Form's resource path- Parameters:
resourcePath-
-
has
boolean has(String key)
Determines if a Form data key exists and has non-blank data- Parameters:
key-- Returns:
-
get
String get(String key)
Gets the data associated with a Form data key- Parameters:
key-- Returns:
-
hasData
boolean hasData()
Determines if any Form Data exists; atleast 1 key w non-blank data must exist in the data map.- Returns:
-
hasError
boolean hasError(String key)
Determines if an error exists- Parameters:
key-- Returns:
-
setError
void setError(String key)
Sets an errorThis 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.
- Parameters:
key-
-
setError
void setError(String key, String value)
Sets an error for key with corresponding error message/data- Parameters:
key-value-
-
hasErrors
boolean hasErrors()
Checks if has data- Returns:
-
getValueMap
org.apache.sling.api.resource.ValueMap getValueMap()
Get data as ValueMap- Returns:
-
getErrorsValueMap
org.apache.sling.api.resource.ValueMap getErrorsValueMap()
Get Errors as ValueMap- Returns:
-
-