Package com.exedio.cope
Class Field<E>
- java.lang.Object
-
- com.exedio.cope.Feature
-
- com.exedio.cope.Field<E>
-
- All Implemented Interfaces:
Settable<E>
,Serializable
- Direct Known Subclasses:
DataField
,FunctionField
public abstract class Field<E> extends Feature implements Settable<E>
Anfield
represents a persistently stored field of aType
. Subclasses specify the type of information to be stored in the field.- Author:
- Ralf Wiebicke
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Collection<E>
castCollection(Collection<?> c)
Deprecated.UseCast.castElements(Class, Collection)
insteadvoid
check(E value)
SetValue<?>[]
execute(E value, Item exceptionItem)
abstract E
get(Item item)
String
getColumnName()
Deprecated.UseSchemaInfo.getColumnName(Field)
insteadSet<Class<? extends Throwable>>
getInitialExceptions()
Returns the exceptions possibly thrown, when setting a value for this settable.Class<?>
getInitialType()
List<Pattern>
getPatterns()
Deprecated.Class<E>
getValueClass()
boolean
isFinal()
Returns true, if a value for the settable can be specified on the creation of an item only, thus cannot be modified later.boolean
isInitial()
Returns true, if a value for the field should be specified on the creation of an item.boolean
isMandatory()
SetValue<E>
mapNull()
abstract Field<E>
optional()
Returns a new Field, that differs from this Field by being optional.abstract void
set(Item item, E value)
abstract Field<E>
toFinal()
Returns a new Field, that differs from this Field by being final.-
Methods inherited from class com.exedio.cope.Feature
afterModelCreated, getAbstractType, getAnnotation, getID, getLocalizationKeys, getName, getPattern, getType, isAnnotationPresent, isSourceAlready, mount, readResolve, requireMounted, toString, toString, writeReplace
-
-
-
-
Method Detail
-
toFinal
public abstract Field<E> toFinal()
Returns a new Field, that differs from this Field by being final. If this Field is already final, the the result is equal to this Field.- See Also:
isFinal()
-
optional
public abstract Field<E> optional()
Returns a new Field, that differs from this Field by being optional. If this Field is already optional, the the result is equal to this Field.- See Also:
isMandatory()
-
isFinal
public final boolean isFinal()
Description copied from interface:Settable
Returns true, if a value for the settable can be specified on the creation of an item only, thus cannot be modified later.
-
isMandatory
public final boolean isMandatory()
- Specified by:
isMandatory
in interfaceSettable<E>
-
getInitialType
public final Class<?> getInitialType()
- Specified by:
getInitialType
in interfaceSettable<E>
-
isInitial
public boolean isInitial()
Returns true, if a value for the field should be specified on the creation of an item. This default implementation returns{@link #isFinal()} || {@link #isMandatory()}
.
-
getInitialExceptions
public Set<Class<? extends Throwable>> getInitialExceptions()
Description copied from interface:Settable
Returns the exceptions possibly thrown, when setting a value for this settable.- Specified by:
getInitialExceptions
in interfaceSettable<E>
-
castCollection
@Deprecated public final Collection<E> castCollection(Collection<?> c)
Deprecated.UseCast.castElements(Class, Collection)
instead
-
check
public final void check(E value)
- Throws:
ConstraintViolationException
- ifvalue
does not satisfy constraints.
-
getColumnName
@Deprecated public final String getColumnName()
Deprecated.UseSchemaInfo.getColumnName(Field)
instead
-
getPatterns
@Deprecated public final List<Pattern> getPatterns()
Deprecated.
-
-