exedio cope

com.exedio.cope
Class Field<E>

java.lang.Object
  extended by com.exedio.cope.Feature
      extended by com.exedio.cope.Field<E>
All Implemented Interfaces:
Settable<E>
Direct Known Subclasses:
DataField, FunctionField

public abstract class Field<E>
extends Feature
implements Settable<E>

An field represents a persistently stored field of a Type. Subclasses specify the type of information to be stored in the field.

For an overview here is a UML diagram.

Author:
Ralf Wiebicke

Method Summary
 Collection<E> castCollection(Collection<?> c)
           
 void check(E value)
           
 SetValue[] execute(E value, Item exceptionItem)
           
abstract  E get(Item item)
           
 String getColumnName()
          Deprecated. Use SchemaInfo.getColumnName(Field) instead
 Set<Class<? extends Throwable>> getInitialExceptions()
          Returns the exceptions possibly thrown, when setting a value for this settable.
 Class getInitialType()
           
 Pattern getPattern()
           
 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> map(E value)
           
 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
getAnnotation, getID, getName, getType, getWrappers, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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.

Specified by:
isFinal in interface Settable<E>
See Also:
toFinal()

isMandatory

public final boolean isMandatory()

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 isFinal() || isMandatory().

Specified by:
isInitial in interface Settable<E>

getInitialType

public Class getInitialType()
Specified by:
getInitialType in interface Settable<E>

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 interface Settable<E>

getValueClass

public final Class<E> getValueClass()

castCollection

public final Collection<E> castCollection(Collection<?> c)

map

public final SetValue<E> map(E value)
Specified by:
map in interface Settable<E>

mapNull

public final SetValue<E> mapNull()

execute

public final SetValue[] execute(E value,
                                Item exceptionItem)
Specified by:
execute in interface Settable<E>

check

public final void check(E value)
                 throws ConstraintViolationException
Throws:
ConstraintViolationException

getPattern

public final Pattern getPattern()
See Also:
Pattern.getSourceFields()

get

public abstract E get(Item item)

set

public abstract void set(Item item,
                         E value)

getColumnName

@Deprecated
public final String getColumnName()
Deprecated. Use SchemaInfo.getColumnName(Field) instead


getPatterns

@Deprecated
public final List<Pattern> getPatterns()
Deprecated. 


Cope with
Object
Persistence

SourceForge.net LogoCopyright © 2004-2008 exedio Gesellschaft für Softwareentwicklung mbH. All rights reserved.
svn.12752 build.5319 20090312135114