Interface DateField<F extends DateField<F>>
- All Superinterfaces:
Comparable<F>,Component<F>,Copyable<F>,Field<F>,FormComponent<F>,Serializable
- All Known Subinterfaces:
DateRangeField<F>
- All Known Implementing Classes:
DefaultDateField,DefaultDateRangeField
Represents the metadata for a date picker field.
- Author:
- Dima Myroniuk (dmyroniuk)
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classstatic enum -
Method Summary
Modifier and TypeMethodDescriptiondefault FcomputedFrom(String dateField, String durationField, String durationUnit) default FdateFormat(String format) Adds theDateField.Attributes.DATE_FORMATattribute.default FdefaultEndOf(DateField.DateStartUnit endUnit) Use the current date default ending at the particular unit.default FRepresents a default value for a date set to the exact moment it is generated on the frontenddefault FdefaultStartOf(DateField.DateStartUnit startUnit) Use the current date default starting at the particular unit.Finds theDateColumn.Attributes.DATE_FORMATattribute.default StringGets theDateField.Attributes.COMPUTED_FROM_DATEattribute.default StringGets theDateField.Attributes.COMPUTED_FROM_DURATIONattribute.default StringGets theDateField.Attributes.COMPUTED_FROM_DURATION_UNITattribute.default StringGets theDateField.Attributes.DATE_FORMATattribute.default booleanChecks whether theDateField.Attributes.COMPUTED_FROM_DATEattribute has been set.default booleanChecks whether theDateField.Attributes.COMPUTED_FROM_DURATIONattribute has been set.default booleanChecks whether theDateField.Attributes.COMPUTED_FROM_DURATION_UNITattribute has been set.default booleanChecks whether theDateField.Attributes.DATE_FORMATattribute has been set.default booleanChecks whether theDateField.Attributes.COMPUTED_FROM_DATEandDateField.Attributes.COMPUTED_FROM_DURATIONattributes have been set.default Fdefault FRemoves theDateField.Attributes.DATE_FORMATattribute.default FvalidateIsAfter(String messageKey, Object... arg) Creates a validation schema to verify that a date in this field is after a date in another field.Methods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.broadleafcommerce.metadata.dsl.core.Component
addAction, addAction, addComponent, addEndpoint, addEndpoint, addSimpleComponent, apply, attribute, augmentable, augmentationKey, classifier, clearConditionals, clearEndpoints, conditional, conditionals, description, description, findAction, findAction, findActions, findAttribute, findAttribute, findComponent, findComponent, findComponents, findEndpoint, findEndpoint, findEndpoint, findEndpoints, get, get, getAction, getAction, getActions, getActionsList, getAttribute, getAttribute, getAttributes, getAugmentableFlag, getAugmentationKey, getClassifier, getComponent, getComponent, getComponents, getComponentsList, getConditionals, getDescription, getEndpoint, getEndpoint, getEndpoints, getEndpointsList, getId, getLabel, getOrder, getScope, getType, hasAction, hasAttribute, hasComponent, hasEndpoint, id, isAugmentable, isTranslatable, label, label, notTranslatable, order, removeAction, removeAttribute, removeComponent, removeEndpoint, scope, self, setActions, setAttributes, setAugmentable, setAugmentationKey, setClassifier, setComponents, setConditionals, setDescription, setEndpoints, setId, setLabel, setOrder, setScope, setTranslatable, setType, translatable, translatable, typeMethods inherited from interface com.broadleafcommerce.metadata.dsl.core.Field
clearReadOnlyConditionals, decorated, decorated, defaultValue, displayOnly, displayOnly, getDefaultValue, getMaxLength, getName, getPlaceholder, getReadOnlyConditionals, getRequiredMessage, getValidationSchema, isReadOnly, isRequired, isShowInQueryBuilder, isTargetCollection, maxLength, name, noMaxLength, notReadOnly, notRequired, placeholder, placeholder, readOnly, readOnly, readOnlyConditional, readOnlyConditionals, required, required, required, required, requiredMessage, requiredMessage, setDefaultValue, setMaxLength, setName, setPlaceholder, setReadOnly, setReadOnlyConditionals, setRequired, setRequiredMessage, setShowInQueryBuilder, setValidationSchema, targetIsCollection, targetIsNotCollection, validationMethod, validationSchema, validationSchemaMethods inherited from interface com.broadleafcommerce.metadata.dsl.core.FormComponent
getHelpText, getHint, getTooltip, helpText, helpText, helpText, hidden, hidden, hint, hint, isHidden, notHidden, setHelpText, setHidden, setHint, setTooltip, tooltip, tooltip
-
Method Details
-
defaultNow
Represents a default value for a date set to the exact moment it is generated on the frontend- Returns:
- this field for further customization
-
defaultStartOf
Use the current date default starting at the particular unit.defaultStartOf(DateStartUnit.YEAR)= 2018-01-01 00:00:00defaultStartOf(DateStartUnit.HOUR)= 2018-07-12 09:00:00
- Parameters:
startUnit- the unit the default date should start at, never null- Returns:
- this field for further customization
-
defaultEndOf
Use the current date default ending at the particular unit. Examples of how the frontend will intepret certain values:defaultEndOf(DateStartUnit.YEAR)= 2018-12-31 23:59:59defaultEndOf(DateStartUnit.HOUR)= 2018-07-12 09:59:00
- Parameters:
endUnit- the unit the default date should end, never null- Returns:
- this field for further customization
-
validateIsAfter
Creates a validation schema to verify that a date in this field is after a date in another field.- Parameters:
messageKey- the message key of the validation errorarg- the arguments for the validation method- Returns:
- this field for further customization
-
dateFormat
Adds theDateField.Attributes.DATE_FORMATattribute.- Parameters:
format- The format to set. SeeDateFormatTypes- Returns:
this
-
getDateFormat
Gets theDateField.Attributes.DATE_FORMATattribute.- Returns:
- the value of the attribute
-
findDateFormat
Finds theDateColumn.Attributes.DATE_FORMATattribute.- Returns:
- the value of the attribute or
Optional.empty()if not present.
-
removeDateFormat
Removes theDateField.Attributes.DATE_FORMATattribute.- Returns:
this
-
hasDateFormat
default boolean hasDateFormat()Checks whether theDateField.Attributes.DATE_FORMATattribute has been set.- Returns:
- Whether the attribute is set.
-
computedFrom
Adds theDateField.Attributes.COMPUTED_FROM_DATE,DateField.Attributes.COMPUTED_FROM_DURATION, andDateField.Attributes.COMPUTED_FROM_DURATION_UNITattributes. These attributes will only take effect if the field isreadOnly.- Parameters:
dateField- the date field from which to dynamically compute the new date.durationField- the duration field from which to get the value to add to the date.durationUnit- the unit of the duration field.- Returns:
this- Since:
- Metadata Service 2.0.8, Release Train 2.1.6, 2.2.2
-
hasComputedFromDate
default boolean hasComputedFromDate()Checks whether theDateField.Attributes.COMPUTED_FROM_DATEattribute has been set.- Returns:
- Whether the attribute is set.
- Since:
- Metadata Service 2.0.8, Release Train 2.1.6, 2.2.2
-
hasComputedFromDuration
default boolean hasComputedFromDuration()Checks whether theDateField.Attributes.COMPUTED_FROM_DURATIONattribute has been set.- Returns:
- Whether the attribute is set.
- Since:
- Metadata Service 2.0.8, Release Train 2.1.6, 2.2.2
-
hasComputedFromDurationUnit
default boolean hasComputedFromDurationUnit()Checks whether theDateField.Attributes.COMPUTED_FROM_DURATION_UNITattribute has been set.- Returns:
- Whether the attribute is set.
-
getComputedFromDate
Gets theDateField.Attributes.COMPUTED_FROM_DATEattribute.- Returns:
- the value of the attribute
- Since:
- Metadata Service 2.0.8, Release Train 2.1.6, 2.2.2
-
getComputedFromDuration
Gets theDateField.Attributes.COMPUTED_FROM_DURATIONattribute.- Returns:
- the value of the attribute
- Since:
- Metadata Service 2.0.8, Release Train 2.1.6, 2.2.2
-
getComputedFromDurationUnit
Gets theDateField.Attributes.COMPUTED_FROM_DURATION_UNITattribute.- Returns:
- the value of the attribute
- Since:
- Metadata Service 2.0.8, Release Train 2.1.6, 2.2.2
-
removeComputedFrom
Removes theDateField.Attributes.COMPUTED_FROM_DATE,DateField.Attributes.COMPUTED_FROM_DURATION, andDateField.Attributes.COMPUTED_FROM_DURATION_UNITattributes.- Returns:
this- Since:
- Metadata Service 2.0.8, Release Train 2.1.6, 2.2.2
-
isComputedFrom
default boolean isComputedFrom()Checks whether theDateField.Attributes.COMPUTED_FROM_DATEandDateField.Attributes.COMPUTED_FROM_DURATIONattributes have been set.- Returns:
- Whether the computed from attributes are set.
- Since:
- Metadata Service 2.0.8, Release Train 2.1.6, 2.2.2
-