public class AttributeOptionsImpl extends CommonOptionsImpl implements AttributeOptions
| Modifier and Type | Field and Description |
|---|---|
static String |
OPTION_CONTEXT
this is the object id holding the context.
|
static String |
OPTION_DEFAULT
generate SQL DEFAULT.
|
static String |
OPTION_DOMAINKEY
this is a unique domain key (or part of it).
|
static String |
OPTION_HIDDEN
hidden attribute (no interface definition).
|
static String |
OPTION_TZ
timestamp, date or time with database timezone.
|
BIND_SIZE, OPTION_BIND, OPTION_DERIVED, OPTION_MAPNULL, OPTION_NOCONSTANT, OPTION_NODECLARE, OPTION_NOMETHOD, OPTION_READONLY, OPTION_SETGET, OPTION_SUPER, OPTION_TRIM, OPTION_TRIM_READ, OPTION_TRIM_WRITE, OPTION_WRITEONLY| Constructor and Description |
|---|
AttributeOptionsImpl(Attribute attribute,
SourceInfo sourceInfo)
Creates attribute options.
|
| Modifier and Type | Method and Description |
|---|---|
void |
applyEntityOptions(EntityOptions options,
DataType dataType)
Sets the default from entity options.
|
boolean |
applyOption(String option,
Boolean ctrl)
Applies given option string.
|
ModelException |
createModelException(String message) |
List<String> |
getAnnotations()
list of annotations.
|
AttributeImpl |
getAttribute()
Gets the attribute this option-set belongs to.
|
Object |
getDefaultValue()
Gets the default value if [DEFAULT value] given.
The returned type corresponds to the DataType of the Attribute. |
boolean |
isContextId()
Returns whether this is the object id holding the context.
|
boolean |
isDomainKey()
Returns whether this is a unique domain key (or part of it).
|
boolean |
isHidden()
Returns whether the attribute is not declared in the interface.
|
boolean |
isUnsigned()
Returns whether this is an unsigned numeric field.
|
boolean |
isUTC()
Returns whether this is a UTC timestamp.
|
boolean |
isWithTimezone()
Returns whether to use a dedicated timezone.
If set, the PDO must provide a method to configure the timezone for the given attribute of the form: |
void |
setAnnotations(List<String> annotations) |
void |
setContextId(boolean contextId) |
void |
setDefaultValue(Object defaultValue) |
void |
setDomainKey(boolean domainKey) |
void |
setHidden(boolean hidden) |
void |
setUnsigned(boolean unsigned) |
void |
setUTC(boolean utc) |
void |
setWithTimezone(boolean withTimezone) |
addBindOption, getAccessScope, getBindOptions, getComment, getSourceInfo, isAutoSelect, isBind, isDerived, isFromSuper, isLowerCase, isMapNull, isMaxCol, isNoConstant, isNoDeclare, isNoMethod, isReadOnly, isSetGet, isTrimRead, isTrimWrite, isUpperCase, isWriteOnly, processBindOption, processOption, removeBindOption, setAccessScope, setAutoSelect, setBind, setBindOptions, setComment, setDerived, setFromSuper, setLowerCase, setMapNull, setMaxCol, setNoConstant, setNoDeclare, setNoMethod, setReadOnly, setSetGet, setTrimRead, setTrimWrite, setUpperCase, setWriteOnly, validateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAccessScope, getBindOptions, getComment, isAutoSelect, isBind, isDerived, isFromSuper, isLowerCase, isMapNull, isMaxCol, isNoConstant, isNoDeclare, isNoMethod, isReadOnly, isSetGet, isTrimRead, isTrimWrite, isUpperCase, isWriteOnly, validatepublic static final String OPTION_DEFAULT
public static final String OPTION_CONTEXT
public static final String OPTION_DOMAINKEY
public static final String OPTION_TZ
public static final String OPTION_HIDDEN
public AttributeOptionsImpl(Attribute attribute, SourceInfo sourceInfo)
attribute - the attributesourceInfo - the source info, null if nonepublic AttributeImpl getAttribute()
AttributeOptionsgetAttribute in interface AttributeOptionspublic void applyEntityOptions(EntityOptions options, DataType dataType)
options - the entity optionsdataType - the datatype of the attributepublic boolean applyOption(String option, Boolean ctrl) throws ModelException
CommonOptionsImplapplyOption in class CommonOptionsImploption - the option stringctrl - option control: true if turn option on, false if oprion off, null if on/off missing (defaults to on)ModelException - if applying the option failedpublic List<String> getAnnotations()
AttributeOptionsgetAnnotations in interface AttributeOptionspublic Object getDefaultValue()
AttributeOptionsgetDefaultValue in interface AttributeOptionspublic void setDefaultValue(Object defaultValue)
public boolean isContextId()
AttributeOptionsisContextId in interface AttributeOptionspublic void setContextId(boolean contextId)
public boolean isDomainKey()
AttributeOptionsisDomainKey in interface AttributeOptionspublic void setDomainKey(boolean domainKey)
public boolean isUTC()
AttributeOptionsisUTC in interface AttributeOptionspublic void setUTC(boolean utc)
public boolean isWithTimezone()
AttributeOptionsCalendar get<attribute-name>TimezoneConfig(); Example: Calendar getPrintedTimezoneConfig();
isWithTimezone in interface AttributeOptionspublic void setWithTimezone(boolean withTimezone)
public boolean isUnsigned()
AttributeOptionsisUnsigned in interface AttributeOptionspublic void setUnsigned(boolean unsigned)
public boolean isHidden()
AttributeOptionsisHidden in interface AttributeOptionspublic void setHidden(boolean hidden)
public ModelException createModelException(String message)
createModelException in class CommonOptionsImplTentackle - a domain driven enterprise framework