Class AbstractOptionsFieldImpl
- java.lang.Object
-
- com.adobe.cq.forms.core.components.util.AbstractComponentImpl
-
- com.adobe.cq.forms.core.components.util.AbstractFormComponentImpl
-
- com.adobe.cq.forms.core.components.util.AbstractBaseImpl
-
- com.adobe.cq.forms.core.components.util.AbstractFieldImpl
-
- com.adobe.cq.forms.core.components.util.AbstractOptionsFieldImpl
-
- All Implemented Interfaces:
com.adobe.cq.export.json.ComponentExporter,Base,BaseConstraint,Field,FormComponent,OptionsConstraint,Component
- Direct Known Subclasses:
AbstractCheckboxImpl
public abstract class AbstractOptionsFieldImpl extends AbstractFieldImpl implements OptionsConstraint
Abstract class which can be used as base class for optionsFieldimplementations.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.adobe.cq.forms.core.components.models.form.BaseConstraint
BaseConstraint.Type
-
-
Field Summary
-
Fields inherited from class com.adobe.cq.forms.core.components.util.AbstractFormComponentImpl
CUSTOM_DOR_PROPERTY_WRAPPER, CUSTOM_JCR_PATH_PROPERTY_WRAPPER, CUSTOM_RULE_PROPERTY_WRAPPER
-
Fields inherited from interface com.adobe.cq.forms.core.components.models.form.Base
DATE_FORMATTER, DEFAULT_LANGUAGE
-
Fields inherited from interface com.adobe.cq.forms.core.components.models.form.FormComponent
CUSTOM_PROPERTY_WRAPPER
-
-
Constructor Summary
Constructors Constructor Description AbstractOptionsFieldImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object[]getDefault()The value of the field when no value is provided by the end user or data model.java.lang.String[]getEnumNames()Returns a user friendly text to display for the possible options to be shown to the end user.java.lang.Object[]getEnums()Returns a list of options to put restrictions on the possible values of the field.booleanisEnforceEnum()Returnstrueif enforceEnum is set, otherwisefalse.-
Methods inherited from class com.adobe.cq.forms.core.components.util.AbstractFieldImpl
getDataFormat, getDisplayFormat, getDisplayValueExpression, getEditFormat, getPlaceHolder, getReadOnlyIfPresent, getRequiredIfPresent, isReadOnly, isRequired
-
Methods inherited from class com.adobe.cq.forms.core.components.util.AbstractBaseImpl
getConstraintMessages, getCustomLayoutProperties, getDescription, getEnabledIfPresent, getExportedType, getHtmlScreenReaderText, getLabel, getLang, getScreenReaderText, getTooltip, getTooltipText, getType, getValidationExpression, isEnabled, isTooltipVisible
-
Methods inherited from class com.adobe.cq.forms.core.components.util.AbstractFormComponentImpl
getData, getDataRef, getDorProperties, getEvents, getFieldType, getLinkUrl, getName, getPath, getProperties, getRules, getText, getTitle, getVisibleIfPresent, isVisible, setI18n
-
Methods inherited from class com.adobe.cq.forms.core.components.util.AbstractComponentImpl
getAppliedCssClasses, getId
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adobe.cq.forms.core.components.models.form.Base
getConstraintMessages, getDescription, getExportedType, getHtmlScreenReaderText, getLabel, getLang, getScreenReaderText, getTooltip, isEnabled, isTooltipVisible
-
Methods inherited from interface com.adobe.cq.forms.core.components.models.form.BaseConstraint
getType, getValidationExpression
-
Methods inherited from interface com.adobe.cq.wcm.core.components.models.Component
getAppliedCssClasses, getData, getId
-
Methods inherited from interface com.adobe.cq.forms.core.components.models.form.FormComponent
getDataRef, getDorProperties, getEvents, getFieldType, getName, getPath, getProperties, getRules, isVisible, setI18n
-
-
-
-
Method Detail
-
isEnforceEnum
public boolean isEnforceEnum()
Description copied from interface:OptionsConstraintReturnstrueif enforceEnum is set, otherwisefalse. Whether a user can enter a value that is not present in the enum array. If set to true, a user will be able to enter any other value that is not in the list of enum. That generally means that enum is used a aid for users to enter the value but is not a validation constraint. The constraint is applicable only if the enum property is defined on the Field- Specified by:
isEnforceEnumin interfaceOptionsConstraint- Returns:
trueif enforceEnum is set, otherwisefalse.
-
getEnums
public java.lang.Object[] getEnums()
Description copied from interface:OptionsConstraintReturns a list of options to put restrictions on the possible values of the field. The type of values in the enum array must match the value of the type property defined in the field.- Specified by:
getEnumsin interfaceOptionsConstraint- Returns:
- the list of enum
-
getEnumNames
public java.lang.String[] getEnumNames()
Description copied from interface:OptionsConstraintReturns a user friendly text to display for the possible options to be shown to the end user. The length of enum and enumNames array must match- Specified by:
getEnumNamesin interfaceOptionsConstraint- Returns:
- the list of enum names
-
getDefault
public java.lang.Object[] getDefault()
Description copied from interface:FieldThe value of the field when no value is provided by the end user or data model. The type of this property should match the value of the type property defined in the Field. If not, then a type coercion will be tried and if that fails, the value will be set to null.- Specified by:
getDefaultin interfaceField- Overrides:
getDefaultin classAbstractFieldImpl- Returns:
- default value of the field
-
-