Package ch.tocco.nice2.model.entity.api
Class DefaultFieldModel
java.lang.Object
ch.tocco.nice2.model.entity.api.DefaultModelBase
ch.tocco.nice2.model.entity.api.DefaultFieldModel
- All Implemented Interfaces:
FieldModel
,ModelElement
,ModuleTracker
- Direct Known Subclasses:
FieldModelImpl
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
Returns the DefaultValueDescriptor.getName()
Returns the entity field name; the name attribute of the field tag in xml.Returns the internal field name, eg db table field name; the target attribute of the field tag in xml.Type
<?> getType()
boolean
boolean
isKey()
Tells if this field is the or part of the primary key.boolean
Tells if the field accepts the null value to be stored in it.boolean
boolean
isUnique()
Tells if the field's values are unique (i.e.boolean
void
setDefaultValue
(Object defaultValue) void
setKey
(boolean key) void
void
setNullable
(boolean nullable) void
setSynthetic
(boolean synthetic) void
void
void
setUnique
(boolean unique) void
setValidator
(AndGroupValidator validator) Sets the primary validator which may contain real validation validators and other groups.void
setVirtual
(boolean virtual) Methods inherited from class ch.tocco.nice2.model.entity.api.DefaultModelBase
toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.tocco.nice2.model.entity.api.FieldModel
addDocumentation, getBaseField, getDocumentation, getLabel, isBinaryReplacementDisabled, isLocalized, isMandatory, isPrivilegedAccessOnly, isXssFilter, setBaseField, setBinaryReplacementDisabled, setLabel, setLocalized, setPrivilegedAccessOnly, setXssFilter
Methods inherited from interface ch.tocco.nice2.model.entity.api.ModuleTracker
addExtendingModule, getDefiningModule, getExtendingModules, setDefiningModule
-
Constructor Details
-
DefaultFieldModel
public DefaultFieldModel(boolean key) -
DefaultFieldModel
public DefaultFieldModel()
-
-
Method Details
-
getName
Description copied from interface:FieldModel
Returns the entity field name; the name attribute of the field tag in xml.- Specified by:
getName
in interfaceFieldModel
- Overrides:
getName
in classDefaultModelBase
-
setName
- Specified by:
setName
in interfaceFieldModel
- Overrides:
setName
in classDefaultModelBase
- Parameters:
name
- the name, non-null- See Also:
-
getTarget
Description copied from interface:FieldModel
Returns the internal field name, eg db table field name; the target attribute of the field tag in xml.- Specified by:
getTarget
in interfaceFieldModel
-
setTarget
- Specified by:
setTarget
in interfaceFieldModel
- Parameters:
target
- the target- See Also:
-
isNullable
public boolean isNullable()Description copied from interface:FieldModel
Tells if the field accepts the null value to be stored in it.Key fields
are never nullable.- Specified by:
isNullable
in interfaceFieldModel
-
setNullable
public void setNullable(boolean nullable) - Specified by:
setNullable
in interfaceFieldModel
- Parameters:
nullable
- true/false- See Also:
-
isUnique
public boolean isUnique()Description copied from interface:FieldModel
Tells if the field's values are unique (i.e. a value may only exists once)- Specified by:
isUnique
in interfaceFieldModel
- Returns:
- true if the field's values are unique
-
setUnique
public void setUnique(boolean unique) - Specified by:
setUnique
in interfaceFieldModel
- Parameters:
unique
- true/false
-
isVirtual
public boolean isVirtual()- Specified by:
isVirtual
in interfaceFieldModel
-
setVirtual
public void setVirtual(boolean virtual) - Specified by:
setVirtual
in interfaceFieldModel
-
isSynthetic
public boolean isSynthetic()- Specified by:
isSynthetic
in interfaceFieldModel
-
setSynthetic
public void setSynthetic(boolean synthetic) - Specified by:
setSynthetic
in interfaceFieldModel
-
isKey
public boolean isKey()Description copied from interface:FieldModel
Tells if this field is the or part of the primary key.It has nothing to do with indexed fields, nor with foreign keys.
- Specified by:
isKey
in interfaceFieldModel
-
setKey
public void setKey(boolean key) -
getType
- Specified by:
getType
in interfaceFieldModel
- Returns:
- Returns the nice Type object which for example represents a string.
-
getDefaultValue
Description copied from interface:FieldModel
Returns the DefaultValueDescriptor. This is the dynamic default value that can be defined on the entity as well as on the form.The reason that this signature returns 'Object' is because the interface cannot be seen.
- Specified by:
getDefaultValue
in interfaceFieldModel
- Returns:
- instance of DefaultValueDescriptor
-
setDefaultValue
- Specified by:
setDefaultValue
in interfaceFieldModel
-
setType
- Specified by:
setType
in interfaceFieldModel
- Parameters:
type
- the type- See Also:
-
getAdditionalToStringInfo
- Overrides:
getAdditionalToStringInfo
in classDefaultModelBase
-
hasNonEmptyValidator
public boolean hasNonEmptyValidator()- Specified by:
hasNonEmptyValidator
in interfaceFieldModel
- Returns:
- Tells if this field model has a validator, a GroupValidator to be precise, which has at least one entry.
- See Also:
-
getValidator
- Specified by:
getValidator
in interfaceFieldModel
- Returns:
- Returns the outermost group validator which may be empty.
- See Also:
-
setValidator
Description copied from interface:FieldModel
Sets the primary validator which may contain real validation validators and other groups.Method for the startup process.
- Specified by:
setValidator
in interfaceFieldModel
- Parameters:
validator
- The group validator.
-