Package org.apache.sling.cms.reference.forms.impl.fields

## Class SelectionHandler

- java.lang.Object
- - org.apache.sling.cms.reference.forms.impl.fields.SelectionHandler

All Implemented Interfaces:
  `FieldHandler`

    public class SelectionHandler
    extends Object
    implements FieldHandler

### Nested Class Summary

Nested Classes
`static interface` `SelectionHandler.Config`

### Field Summary

Fields
`static String` `DEFAULT_RESOURCE_TYPE`

### Constructor Summary

Constructors
`SelectionHandler​(SelectionHandler.Config config)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `handleField​(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.resource.Resource fieldResource, Map<String,​Object> formData)` Handle the field being submitted.
`boolean` `handles​(org.apache.sling.api.resource.Resource fieldResource)` Returns true if the FieldHandler should handle the field resource

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### DEFAULT_RESOURCE_TYPE

    public static final String DEFAULT_RESOURCE_TYPE

See Also:
  Constant Field Values

### Constructor Detail

#### SelectionHandler

    public SelectionHandler​(SelectionHandler.Config config)

### Method Detail

#### handles

    public boolean handles​(org.apache.sling.api.resource.Resource fieldResource)

Description copied from interface: `FieldHandler`
Returns true if the FieldHandler should handle the field resource

Specified by:
  `handles` in interface `FieldHandler`
Parameters:
  `fieldResource` - the field resource to handle
Returns:
  true if the FieldHandler will handle, false otherwise

#### handleField

    public void handleField​(org.apache.sling.api.SlingHttpServletRequest request,
                            org.apache.sling.api.resource.Resource fieldResource,
                            Map<String,​Object> formData)
                     throws FormException

Description copied from interface: `FieldHandler`
Handle the field being submitted. Uses the configuration from the fieldResource and the data from the request and saves the value into the formData.

Specified by:
  `handleField` in interface `FieldHandler`
Parameters:
  `request` - the request for the form submission
  `fieldResource` - the resource from which to get the field configuration
  `formData` - the Map to which to save the data for the field
Throws:
  `FormException` - an exception occurs attempting to handle the field including the field not being set or being invalid