public abstract class CommonOptionsImpl extends Object implements CommonOptions
| Modifier and Type | Field and Description |
|---|---|
static String |
BIND_SIZE
set max columns and/or scale.
|
static String |
OPTION_BIND
add binding information.
|
static String |
OPTION_DERIVED
attribute is derived (table per class).
|
static String |
OPTION_MAPNULL
map null to non-null value.
|
static String |
OPTION_NOCONSTANT
don't generate static constants.
|
static String |
OPTION_NODECLARE
don't generate declaration.
|
static String |
OPTION_NOMETHOD
don't generate accessor methods.
|
static String |
OPTION_READONLY
don't generate a set-method.
|
static String |
OPTION_SETGET
always use set/get, don't use attributes directly in read/write.
|
static String |
OPTION_SUPER
attribute is derived (table per concrete class).
|
static String |
OPTION_TRIM
trim on read and write.
|
static String |
OPTION_TRIM_READ
trim string on read.
|
static String |
OPTION_TRIM_WRITE
trim string on write.
|
static String |
OPTION_WRITEONLY
don't generate a get-method.
|
| Constructor and Description |
|---|
CommonOptionsImpl(SourceInfo sourceInfo)
Creates options.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBindOption(String option)
Adds a bind option.
|
boolean |
applyOption(String option,
Boolean ctrl)
Applies given option string.
|
ModelException |
createModelException(String message) |
AccessScope |
getAccessScope()
The access scope.
|
String |
getBindOptions()
The bind options.
|
String |
getComment()
The comment.
|
SourceInfo |
getSourceInfo()
Gets the source info.
|
boolean |
isAutoSelect()
Returns whether autoselect should be turned on.
|
boolean |
isBind()
true if [BIND]-option set.
|
boolean |
isDerived()
true if [DERIVED]-option set.
|
boolean |
isFromSuper()
true if [SUPER]-option set.
|
boolean |
isLowerCase()
Returns whether lowercase conversion requested.
|
boolean |
isMapNull()
true if [MAPNULL]-option set.
|
boolean |
isMaxCol()
Returns true whether the maxcol binding option should be applied.
|
boolean |
isNoConstant()
true if [NOCONSTANT]-option set.
|
boolean |
isNoDeclare()
true if [NODECLARE]-option set.
|
boolean |
isNoMethod()
true if [NOMETHOD]-option set.
|
boolean |
isReadOnly()
true if [READONLY]-option set.
|
boolean |
isSetGet()
true if [SETGET]-option set.
|
boolean |
isTrimRead()
true if [TRIMREAD]-option set.
|
boolean |
isTrimWrite()
true if [TRIMWRITE]-option set.
|
boolean |
isUpperCase()
Returns whether uppercase conversion requested.
|
boolean |
isWriteOnly()
true if [WRITEONLY]-option set.
|
void |
processBindOption(String option,
boolean on)
Processes a bind option.
|
boolean |
processOption(String option)
Processes an option string.
If the option string starts with ! or -, the option is considered to be turned off. |
void |
removeBindOption(String option)
Removes a bind option.
|
void |
setAccessScope(AccessScope accessScope) |
void |
setAutoSelect(boolean autoSelect) |
void |
setBind(boolean bind) |
void |
setBindOptions(String bindOptions) |
void |
setComment(String comment)
Sets the comment.
|
void |
setDerived(boolean derived) |
void |
setFromSuper(boolean fromSuper) |
void |
setLowerCase(boolean lowerCase) |
void |
setMapNull(boolean mapNull) |
void |
setMaxCol(boolean maxCol) |
void |
setNoConstant(boolean noConstant) |
void |
setNoDeclare(boolean noDeclare) |
void |
setNoMethod(boolean noMethod) |
void |
setReadOnly(boolean readOnly) |
void |
setSetGet(boolean setGet) |
void |
setTrimRead(boolean trimRead) |
void |
setTrimWrite(boolean trimWrite) |
void |
setUpperCase(boolean upperCase) |
void |
setWriteOnly(boolean writeOnly) |
void |
validate()
Validates the options.
|
public static final String OPTION_NODECLARE
public static final String OPTION_NOMETHOD
public static final String OPTION_NOCONSTANT
public static final String OPTION_DERIVED
public static final String OPTION_SUPER
public static final String OPTION_READONLY
public static final String OPTION_WRITEONLY
public static final String OPTION_TRIM_READ
public static final String OPTION_TRIM_WRITE
public static final String OPTION_TRIM
public static final String OPTION_MAPNULL
public static final String OPTION_SETGET
public static final String OPTION_BIND
public static final String BIND_SIZE
public CommonOptionsImpl(SourceInfo sourceInfo)
sourceInfo - the source info, null if nonepublic SourceInfo getSourceInfo()
public boolean applyOption(String option, Boolean ctrl) throws ModelException
option - 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 boolean processOption(String option) throws ModelException
applyOption(java.lang.String, java.lang.Boolean)
how the option should be treated.option - the option stringModelException - if option malformedpublic void processBindOption(String option, boolean on)
option - the bind optionon - true if append, else removepublic String getComment()
CommonOptionsgetComment in interface CommonOptionspublic void setComment(String comment)
comment - the commentpublic String getBindOptions()
CommonOptionsgetBindOptions in interface CommonOptionspublic void setBindOptions(String bindOptions)
public void addBindOption(String option)
option - the optionpublic void removeBindOption(String option)
option - the optionpublic boolean isNoDeclare()
CommonOptionsisNoDeclare in interface CommonOptionspublic boolean isNoMethod()
CommonOptionsisNoMethod in interface CommonOptionspublic boolean isNoConstant()
CommonOptionsisNoConstant in interface CommonOptionspublic boolean isDerived()
CommonOptionsisDerived in interface CommonOptionspublic boolean isFromSuper()
CommonOptionsisFromSuper in interface CommonOptionspublic boolean isReadOnly()
CommonOptionsisReadOnly in interface CommonOptionspublic boolean isWriteOnly()
CommonOptionsisWriteOnly in interface CommonOptionspublic AccessScope getAccessScope()
CommonOptionsgetAccessScope in interface CommonOptionspublic boolean isTrimRead()
CommonOptionsisTrimRead in interface CommonOptionspublic boolean isTrimWrite()
CommonOptionsisTrimWrite in interface CommonOptionspublic boolean isMapNull()
CommonOptionsisMapNull in interface CommonOptionspublic boolean isSetGet()
CommonOptionsisSetGet in interface CommonOptionspublic boolean isBind()
CommonOptionsisBind in interface CommonOptionspublic void setAccessScope(AccessScope accessScope)
public void setBind(boolean bind)
public void setDerived(boolean derived)
public void setFromSuper(boolean fromSuper)
public void setMapNull(boolean mapNull)
public void setNoConstant(boolean noConstant)
public void setNoDeclare(boolean noDeclare)
public void setNoMethod(boolean noMethod)
public void setReadOnly(boolean readOnly)
public void setSetGet(boolean setGet)
public void setTrimRead(boolean trimRead)
public void setTrimWrite(boolean trimWrite)
public void setWriteOnly(boolean writeOnly)
public boolean isAutoSelect()
CommonOptionsisAutoSelect in interface CommonOptionspublic void setAutoSelect(boolean autoSelect)
public boolean isLowerCase()
CommonOptionsisLowerCase in interface CommonOptionspublic void setLowerCase(boolean lowerCase)
public boolean isMaxCol()
CommonOptionsisMaxCol in interface CommonOptionspublic void setMaxCol(boolean maxCol)
public boolean isUpperCase()
CommonOptionsisUpperCase in interface CommonOptionspublic void setUpperCase(boolean upperCase)
public void validate()
throws ModelException
CommonOptionsvalidate in interface CommonOptionsModelException - if validation failedpublic ModelException createModelException(String message)
Tentackle - a domain driven enterprise framework