Package com.exedio.cope.reflect
Class FeatureField<E extends Feature>
- java.lang.Object
-
- com.exedio.cope.Feature
-
- com.exedio.cope.Pattern
-
- com.exedio.cope.reflect.FeatureField<E>
-
- All Implemented Interfaces:
Settable<E>
,Serializable
public final class FeatureField<E extends Feature> extends Pattern implements Settable<E>
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FeatureField.NotFound
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static FeatureField<Feature>
create()
static <E extends Feature>
FeatureField<E>create(Class<E> valueClass)
SetValue<?>[]
execute(E value, Item exceptionItem)
E
get(Item item)
String
getId(Item item)
StringField
getIdField()
UniqueConstraint
getImplicitUniqueConstraint()
Set<Class<? extends Throwable>>
getInitialExceptions()
Returns the exceptions possibly thrown, when setting a value for this settable.Class<?>
getInitialType()
Class<E>
getValueClass()
List<E>
getValues()
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 settable should be specified on the creation of an item.Condition
isInvalid()
boolean
isMandatory()
static FeatureField<Feature>
newField()
Deprecated.Usecreate()
insteadstatic <E extends Feature>
FeatureField<E>newField(Class<E> valueClass)
Deprecated.Usecreate(Class)
insteadFeatureField<E>
optional()
<P extends Item>
PsearchUnique(Class<P> typeClass, E value)
Finds an item by it's unique fields.void
set(Item item, E value)
FeatureField<E>
toFinal()
FeatureField<E>
unique()
-
Methods inherited from class com.exedio.cope.Pattern
addSource, addSource, addSource, addSource, addSourceFeature, addSourceFeature, addSourceFeature, annotationField, equals, getGeneratedTypes, getSourceFeatures, getSourceFeaturesGather, getSourceFields, getSources, getSourceTypes, getType, hashCode, initialize, newSourceType, newSourceType, newSourceType, newSourceType, newSourceType, newSourceType, newType, newType, onMount, registerSource
-
Methods inherited from class com.exedio.cope.Feature
afterModelCreated, getAbstractType, getAnnotation, getID, getLocalizationKeys, getName, getPattern, isAnnotationPresent, isSourceAlready, mount, readResolve, requireMounted, toString, toString, writeReplace
-
-
-
-
Method Detail
-
create
public static FeatureField<Feature> create()
-
create
public static <E extends Feature> FeatureField<E> create(Class<E> valueClass)
-
toFinal
public FeatureField<E> toFinal()
-
optional
public FeatureField<E> optional()
-
unique
public FeatureField<E> unique()
-
getIdField
public StringField getIdField()
-
isInitial
public boolean isInitial()
Description copied from interface:Settable
Returns true, if a value for the settable should be specified on the creation of an item.
-
isFinal
public 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 boolean isMandatory()
- Specified by:
isMandatory
in interfaceSettable<E extends Feature>
-
getInitialType
public Class<?> getInitialType()
- Specified by:
getInitialType
in interfaceSettable<E extends Feature>
-
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 extends Feature>
-
getImplicitUniqueConstraint
public UniqueConstraint getImplicitUniqueConstraint()
-
isInvalid
public Condition isInvalid()
-
searchUnique
@Nullable public <P extends Item> P searchUnique(@Nonnull Class<P> typeClass, @Nonnull E value)
Finds an item by it's unique fields.- Returns:
- null if there is no matching item.
- Throws:
NullPointerException
- if value is null.
-
newField
@Deprecated public static FeatureField<Feature> newField()
Deprecated.Usecreate()
instead
-
newField
@Deprecated public static <E extends Feature> FeatureField<E> newField(Class<E> valueClass)
Deprecated.Usecreate(Class)
instead
-
-