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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringReturns 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()booleanbooleanisKey()Tells if this field is the or part of the primary key.booleanTells if the field accepts the null value to be stored in it.booleanbooleanisUnique()Tells if the field's values are unique (i.e.booleanvoidsetDefaultValue(Object defaultValue) voidsetKey(boolean key) voidvoidsetNullable(boolean nullable) voidsetSynthetic(boolean synthetic) voidvoidvoidsetUnique(boolean unique) voidsetValidator(AndGroupValidator validator) Sets the primary validator which may contain real validation validators and other groups.voidsetVirtual(boolean virtual) Methods inherited from class ch.tocco.nice2.model.entity.api.DefaultModelBase
toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ch.tocco.nice2.model.entity.api.FieldModel
addDocumentation, getBaseField, getDocumentation, getLabel, isBinaryReplacementDisabled, isLocalized, isMandatory, isPrivilegedAccessOnly, isXssFilter, setBaseField, setBinaryReplacementDisabled, setLabel, setLocalized, setPrivilegedAccessOnly, setXssFilterMethods 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:FieldModelReturns the entity field name; the name attribute of the field tag in xml.- Specified by:
getNamein interfaceFieldModel- Overrides:
getNamein classDefaultModelBase
-
setName
- Specified by:
setNamein interfaceFieldModel- Overrides:
setNamein classDefaultModelBase- Parameters:
name- the name, non-null- See Also:
-
getTarget
Description copied from interface:FieldModelReturns the internal field name, eg db table field name; the target attribute of the field tag in xml.- Specified by:
getTargetin interfaceFieldModel
-
setTarget
- Specified by:
setTargetin interfaceFieldModel- Parameters:
target- the target- See Also:
-
isNullable
public boolean isNullable()Description copied from interface:FieldModelTells if the field accepts the null value to be stored in it.Key fieldsare never nullable.- Specified by:
isNullablein interfaceFieldModel
-
setNullable
public void setNullable(boolean nullable) - Specified by:
setNullablein interfaceFieldModel- Parameters:
nullable- true/false- See Also:
-
isUnique
public boolean isUnique()Description copied from interface:FieldModelTells if the field's values are unique (i.e. a value may only exists once)- Specified by:
isUniquein interfaceFieldModel- Returns:
- true if the field's values are unique
-
setUnique
public void setUnique(boolean unique) - Specified by:
setUniquein interfaceFieldModel- Parameters:
unique- true/false
-
isVirtual
public boolean isVirtual()- Specified by:
isVirtualin interfaceFieldModel
-
setVirtual
public void setVirtual(boolean virtual) - Specified by:
setVirtualin interfaceFieldModel
-
isSynthetic
public boolean isSynthetic()- Specified by:
isSyntheticin interfaceFieldModel
-
setSynthetic
public void setSynthetic(boolean synthetic) - Specified by:
setSyntheticin interfaceFieldModel
-
isKey
public boolean isKey()Description copied from interface:FieldModelTells 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:
isKeyin interfaceFieldModel
-
setKey
public void setKey(boolean key) -
getType
- Specified by:
getTypein interfaceFieldModel- Returns:
- Returns the nice Type object which for example represents a string.
-
getDefaultValue
Description copied from interface:FieldModelReturns 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:
getDefaultValuein interfaceFieldModel- Returns:
- instance of DefaultValueDescriptor
-
setDefaultValue
- Specified by:
setDefaultValuein interfaceFieldModel
-
setType
- Specified by:
setTypein interfaceFieldModel- Parameters:
type- the type- See Also:
-
getAdditionalToStringInfo
- Overrides:
getAdditionalToStringInfoin classDefaultModelBase
-
hasNonEmptyValidator
public boolean hasNonEmptyValidator()- Specified by:
hasNonEmptyValidatorin 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:
getValidatorin interfaceFieldModel- Returns:
- Returns the outermost group validator which may be empty.
- See Also:
-
setValidator
Description copied from interface:FieldModelSets the primary validator which may contain real validation validators and other groups.Method for the startup process.
- Specified by:
setValidatorin interfaceFieldModel- Parameters:
validator- The group validator.
-