org.pm4j.core.pm.impl
Class PmAttrDateBase<T_BACKING_DATE>

java.lang.Object
  extended by org.pm4j.core.pm.impl.PmObjectBase
      extended by org.pm4j.core.pm.impl.PmAttrBase<java.util.Date,T_BACKING_DATE>
          extended by org.pm4j.core.pm.impl.PmAttrDateBase<T_BACKING_DATE>
Type Parameters:
T_BACKING_DATE - The backing value type this attribute is bound to.
All Implemented Interfaces:
java.lang.Comparable<PmObject>, PmAttr<java.util.Date>, PmAttrDate, PmDataInput, PmObject
Direct Known Subclasses:
PmAttrDateBase.WithFormatTooltip, PmAttrDateImpl

public class PmAttrDateBase<T_BACKING_DATE>
extends PmAttrBase<java.util.Date,T_BACKING_DATE>
implements PmAttrDate

Base class for PM attributes the externally provide a Date.
Sub classes may bind it to other date representations (e.g. joda data, Long, ...).

Author:
OBOEDE

Nested Class Summary
protected static class PmAttrDateBase.MetaData
           
static class PmAttrDateBase.WithFormatTooltip<T_BACKING_DATE>
          A subclass with a tooltip that provides a hint about the format.
 
Nested classes/interfaces inherited from class org.pm4j.core.pm.impl.PmObjectBase
PmObjectBase.NameBuilder, PmObjectBase.NameBuilderAbsoluteName, PmObjectBase.NameBuilderShortName, PmObjectBase.NameBuilderTitle
 
Nested classes/interfaces inherited from interface org.pm4j.core.pm.PmAttr
PmAttr.Converter<T>
 
Field Summary
 
Fields inherited from class org.pm4j.core.pm.impl.PmObjectBase
pmCacheLog
 
Fields inherited from interface org.pm4j.core.pm.PmAttrDate
RESKEY_DEFAULT_FORMAT_PATTERN
 
Fields inherited from interface org.pm4j.core.pm.PmObject
STYLE_CLASS_DISABLED, STYLE_CLASS_ERROR, STYLE_CLASS_INFO, STYLE_CLASS_REQUIRED, STYLE_CLASS_WARN
 
Constructor Summary
PmAttrDateBase(PmObject pmParent)
           
 
Method Summary
 int compareTo(PmObject otherPm)
          The default implementation compares the results of PmAttrBase.getValueLocalized() according to the collation sequence of the current Locale.
protected  java.lang.String getFormatDefaultResKey()
          The default format key PmAttrDate.RESKEY_DEFAULT_FORMAT_PATTERN applies when no special format is defined (either by resource key with postfix or annotation).
 java.lang.String getOutputFormat()
          The last format definition provided by the format resource definition.
E.g.
protected  void initMetaData(PmObjectBase.MetaData metaData)
           
protected  PmObjectBase.MetaData makeMetaData()
          It's abstract because specific attribute types have to create their specific meta data.
 
Methods inherited from class org.pm4j.core.pm.impl.PmAttrBase
accept, clearCachedPmValues, clearPmInvalidValues, commitBufferedPmChanges, convertBackingValueToPmValue, convertPmValueToBackingValue, equalValues, getBackingValue, getBackingValueImpl, getConverter, getDefaultValue, getDefaultValueImpl, getFormatString, getMaxLen, getMinLen, getNullOptionDefault, getOptionSet, getOptionSetImpl, getOptionValues, getPmParentElement, getPmStyleClassesImpl, getUncachedValidValue, getValue, getValueAsString, getValueImpl, getValueLocalized, initMetaDataBeanConstraint, isBufferedPmValueMode, isEmptyValue, isPmEnabledImpl, isPmReadonlyImpl, isPmValueChanged, isPmVisibleImpl, isRequired, isSupportingAsStringValues, isValidatingOnSetPmValue, makeOptionSetDef, pmValidate, resetPmValues, rollbackBufferedPmChanges, setBackingValue, setBackingValueImpl, setPmValueChanged, setValue, setValueAsString, setValueImpl, validate
 
Methods inherited from class org.pm4j.core.pm.impl.PmObjectBase
addToPmComposite, canSetPmTitle, ensurePmMetaDataInitialization, findAnnotationsInPmHierarchy, getPmConversation, getPmConversationImpl, getPmIconPath, getPmMetaData, getPmMetaDataWithoutPmInitCall, getPmName, getPmParent, getPmProperty, getPmRelativeName, getPmResKey, getPmResKeyBase, getPmResLoaderCtxtClasses, getPmShortTitle, getPmStyleClasses, getPmTitle, getPmTitleDef, getPmTitleImpl, getPmTooltip, getPmTooltipImpl, getVisiblePmCommands, getVisiblePmCommands, isMetaDataInitialized, isPmEnabled, isPmReadonly, isPmValid, isPmVisible, onPmChildStateChange, onPmInit, onPmValueChange, readCacheStrategy, removePmChild, setPmEnabled, setPmParent, setPmProperty, setPmTitle, setPmVisible, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.pm4j.core.pm.PmAttr
getFormatString, getMaxLen, getMinLen, getOptionSet, getValue, getValueAsString, getValueLocalized, isPmValueChanged, isRequired, resetPmValues, setPmValueChanged, setValue, setValueAsString
 
Methods inherited from interface org.pm4j.core.pm.PmDataInput
commitBufferedPmChanges, isBufferedPmValueMode, pmValidate, rollbackBufferedPmChanges
 
Methods inherited from interface org.pm4j.core.pm.PmObject
accept, canSetPmTitle, getPmConversation, getPmIconPath, getPmName, getPmParent, getPmProperty, getPmRelativeName, getPmShortTitle, getPmStyleClasses, getPmTitle, getPmTooltip, isPmEnabled, isPmReadonly, isPmValid, isPmVisible, setPmEnabled, setPmParent, setPmProperty, setPmTitle, setPmVisible
 

Constructor Detail

PmAttrDateBase

public PmAttrDateBase(PmObject pmParent)
Method Detail

getFormatDefaultResKey

protected java.lang.String getFormatDefaultResKey()
The default format key PmAttrDate.RESKEY_DEFAULT_FORMAT_PATTERN applies when no special format is defined (either by resource key with postfix or annotation).

Overrides:
getFormatDefaultResKey in class PmAttrBase<java.util.Date,T_BACKING_DATE>
Returns:
The fallback resource key or null if there is none.
See Also:
PmAttrBase.getFormatString()

getOutputFormat

public java.lang.String getOutputFormat()
Description copied from interface: PmAttrDate
The last format definition provided by the format resource definition.
E.g. 'myElem.myAttr_format=yyyy.MM.dd;y.M.d' would return here 'y.M.d'

Is used for the method PmAttr.getValueAsString().

It is also intended to be used by UI help constructs such as calendar popups which provide their data as strings.

Specified by:
getOutputFormat in interface PmAttrDate
Returns:
The last item of the result of #getParseFormats()

compareTo

public int compareTo(PmObject otherPm)
Description copied from class: PmAttrBase
The default implementation compares the results of PmAttrBase.getValueLocalized() according to the collation sequence of the current Locale.

Specified by:
compareTo in interface java.lang.Comparable<PmObject>
Specified by:
compareTo in interface PmObject
Overrides:
compareTo in class PmAttrBase<java.util.Date,T_BACKING_DATE>
Parameters:
otherPm - The PM to compare.
Returns:
The usual Comparable result: a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

makeMetaData

protected PmObjectBase.MetaData makeMetaData()
Description copied from class: PmAttrBase
It's abstract because specific attribute types have to create their specific meta data.

Specified by:
makeMetaData in class PmAttrBase<java.util.Date,T_BACKING_DATE>
Returns:
A static data container for this presentation model.

initMetaData

protected void initMetaData(PmObjectBase.MetaData metaData)
Overrides:
initMetaData in class PmAttrBase<java.util.Date,T_BACKING_DATE>