org.pm4j.core.pm.impl
Class PmAttrBase.MetaData

java.lang.Object
  extended by org.pm4j.core.pm.impl.PmObjectBase.MetaData
      extended by org.pm4j.core.pm.impl.PmAttrBase.MetaData
Direct Known Subclasses:
PmAttrBooleanImpl.MetaData, PmAttrDateBase.MetaData, PmAttrEnumImpl.MetaData, PmAttrImpl.MetaData, PmAttrListImpl.MetaData, PmAttrNumBase.MetaData, PmAttrPmListImpl.MetaData, PmAttrPmRefImpl.MetaData, PmAttrStringImpl.MetaData
Enclosing class:
PmAttrBase<T_PM_VALUE,T_BEAN_VALUE>

protected abstract static class PmAttrBase.MetaData
extends PmObjectBase.MetaData

Shared meta data for all attributes of the same kind. E.g. for all 'myapp.User.name' attributes.


Field Summary
 
Fields inherited from class org.pm4j.core.pm.impl.PmObjectBase.MetaData
NAME_PATH_DELIMITER, validationChangeEventMask
 
Constructor Summary
protected PmAttrBase.MetaData()
           
 
Method Summary
 PmCacheStrategy getCacheStrategyForOptions()
           
 PmCacheStrategy getCacheStrategyForValue()
           
 PmAttr.Converter<?> getConverter()
           
 java.lang.String getFormatResKey()
           
 PmAttr.Converter<?> getItemConverter()
           
 int getMaxLen()
           
protected abstract  int getMaxLenDefault()
          Provides the attribute type specific default max length.
 int getMinLen()
           
 PmOptionCfg.NullOption getNullOption()
           
 PmOptionSetDef<PmAttr<?>> getOptionSetDef()
           
 boolean isRequired()
           
 void setConverter(PmAttr.Converter<?> converter)
           
 void setConverterDefault(PmAttr.Converter<?> converter)
          If the converter was not explicitly defined by a user annotation, this method will be used to define a attribute type specific converter.
 void setFormatResKey(java.lang.String formatResKey)
           
 void setItemConverter(PmAttr.Converter<?> converter)
          Multi value attributes (like lists) have specific item converters.
 void setRequired(boolean required)
           
 
Methods inherited from class org.pm4j.core.pm.impl.PmObjectBase.MetaData
getName, getPmElementFactory, getPmTitleProvider, init, isReadOnly, setPmElementFactory, setPmTitleProvider, setReadOnly
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PmAttrBase.MetaData

protected PmAttrBase.MetaData()
Method Detail

getOptionSetDef

public PmOptionSetDef<PmAttr<?>> getOptionSetDef()
Returns:
The statically defined option set algorithm.

getNullOption

public PmOptionCfg.NullOption getNullOption()

getFormatResKey

public java.lang.String getFormatResKey()

setFormatResKey

public void setFormatResKey(java.lang.String formatResKey)

getCacheStrategyForOptions

public PmCacheStrategy getCacheStrategyForOptions()

getCacheStrategyForValue

public PmCacheStrategy getCacheStrategyForValue()

getConverter

public PmAttr.Converter<?> getConverter()

setConverter

public void setConverter(PmAttr.Converter<?> converter)

setItemConverter

public void setItemConverter(PmAttr.Converter<?> converter)
Multi value attributes (like lists) have specific item converters.

For single value attributes there is no difference between converter and the itemConverter.

Parameters:
converter - The converter for attribute items.

getItemConverter

public PmAttr.Converter<?> getItemConverter()
See Also:
setItemConverter(org.pm4j.core.pm.PmAttr.Converter)

setConverterDefault

public void setConverterDefault(PmAttr.Converter<?> converter)
If the converter was not explicitly defined by a user annotation, this method will be used to define a attribute type specific converter.


isRequired

public boolean isRequired()

setRequired

public void setRequired(boolean required)

getMinLen

public int getMinLen()

getMaxLen

public int getMaxLen()

getMaxLenDefault

protected abstract int getMaxLenDefault()
Provides the attribute type specific default max length.

Returns:
The maximal number of characters default.