Package com.exedio.cope
Class Pattern
- java.lang.Object
-
- com.exedio.cope.Feature
-
- com.exedio.cope.Pattern
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AbstractListField
,BlockField
,ColorField
,CompositeField
,Dispatcher
,DrivebyHashMigration
,DynamicModel
,EnumMapField
,EnumSetField
,FeatureField
,Hash
,HashConstraint
,History
,Importer
,JavaView
,MapField
,MediaPath
,MoneyField
,MultiItemField
,NestedHashMigration
,PartOf
,PasswordLimiter
,PasswordRecovery
,PriceField
,RangeField
,Schedule
,Serializer
,SetField
,Singleton
,TypeField
,UniqueHashedMedia
public abstract class Pattern extends Feature
A common super class for all patterns.Patterns should be constructable in three different ways:
- 1) by an explicit external source
-
This is the most verbose kind of defining a pattern.
First the source for the pattern is created, such as:
static final StringField source = new StringField(OPTIONAL)
Then the pattern ist created using the previously defined source:static final Hash hash = new MD5Hash(source)
- 2) by an implicit external source
-
More concisely the pattern can be constructed by defining the source
implicitely when the defining the pattern itself:
static final Hash hash = new MD5Hash(new StringField(OPTIONAL))
- 3) by an internal source
-
Finally, the construction of the source can be done the the pattern itself:
static final Hash hash = new MD5Hash(OPTIONAL)
- Author:
- Ralf Wiebicke
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Pattern()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
addSource(Feature feature, String postfix)
Deprecated.UseaddSourceFeature(Feature, String)
instead and benefit from result.protected void
addSource(Feature feature, String postfix, AnnotatedElement annotationSource)
Deprecated.UseaddSourceFeature(Feature, String, AnnotatedElement)
instead and benefit from result.protected void
addSource(Feature feature, String postfix, AnnotatedElement annotationSource, Class<?> precedingLocalizationKeysClass)
Deprecated.UseaddSourceFeature(Feature, String, AnnotatedElement, Class)
instead and benefit from result.protected void
addSource(Feature feature, String postfix, Field annotationSource)
Deprecated.For binary compatibility only, useaddSourceFeature(Feature,String,AnnotatedElement)
instead.protected <F extends Feature>
FaddSourceFeature(F feature, String postfix)
protected <F extends Feature>
FaddSourceFeature(F feature, String postfix, AnnotatedElement annotationSource)
protected <F extends Feature>
FaddSourceFeature(F feature, String postfix, AnnotatedElement annotationSource, Class<?> precedingLocalizationKeysClass)
protected Field
annotationField(String name)
Deprecated.Do not use this method anymore.boolean
equals(Object other)
Forbid override by subclasses.List<Type<?>>
getGeneratedTypes()
Deprecated.UsegetSourceTypes()
insteadList<? extends Feature>
getSourceFeatures()
Map<String,Feature>
getSourceFeaturesGather()
List<? extends Field<?>>
getSourceFields()
Deprecated.UsegetSourceFeatures()
insteadList<? extends Field<?>>
getSources()
Deprecated.UsegetSourceFields()
insteadList<Type<?>>
getSourceTypes()
Type<?>
getType()
Forbid override by subclasses.int
hashCode()
Forbid override by subclasses.protected void
initialize()
Deprecated.OverrideonMount()
insteadprotected <T extends Item>
Type<T>newSourceType(Class<T> javaClass, boolean isAbstract, Type<? super T> supertype, Features features, String postfix)
protected <T extends Item>
Type<T>newSourceType(Class<T> javaClass, boolean isAbstract, Type<? super T> supertype, LinkedHashMap<String,Feature> features, String postfix)
Deprecated.protected <T extends Item>
Type<T>newSourceType(Class<T> javaClass, Features features)
protected <T extends Item>
Type<T>newSourceType(Class<T> javaClass, Features features, String postfix)
protected <T extends Item>
Type<T>newSourceType(Class<T> javaClass, LinkedHashMap<String,Feature> features)
Deprecated.protected <T extends Item>
Type<T>newSourceType(Class<T> javaClass, LinkedHashMap<String,Feature> features, String postfix)
Deprecated.protected <T extends Item>
Type<T>newType(Class<T> javaClass, LinkedHashMap<String,Feature> features)
Deprecated.UsenewSourceType(Class,LinkedHashMap)
insteadprotected <T extends Item>
Type<T>newType(Class<T> javaClass, LinkedHashMap<String,Feature> features, String postfix)
Deprecated.UsenewSourceType(Class,LinkedHashMap,String)
insteadprotected void
onMount()
Here you can do additional initialization not yet done in the constructor.protected void
registerSource(Field<?> field, String postfix)
Deprecated.UseaddSourceFeature(Feature,String)
instead-
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
-
addSourceFeature
protected final <F extends Feature> F addSourceFeature(F feature, String postfix)
- Returns:
- parameter
feature
- See Also:
getSourceFeatures()
-
addSourceFeature
protected final <F extends Feature> F addSourceFeature(F feature, String postfix, AnnotatedElement annotationSource)
- Returns:
- parameter
feature
- See Also:
getSourceFeatures()
-
addSourceFeature
protected final <F extends Feature> F addSourceFeature(F feature, String postfix, AnnotatedElement annotationSource, Class<?> precedingLocalizationKeysClass)
- Returns:
- parameter
feature
- See Also:
getSourceFeatures()
-
onMount
protected void onMount()
Here you can do additional initialization not yet done in the constructor. In this method you can call methodsgetType()
andFeature.getName()
for the first time.
-
newSourceType
protected final <T extends Item> Type<T> newSourceType(Class<T> javaClass, Features features)
- See Also:
getSourceTypes()
-
newSourceType
protected final <T extends Item> Type<T> newSourceType(Class<T> javaClass, Features features, String postfix)
- See Also:
getSourceTypes()
-
newSourceType
protected final <T extends Item> Type<T> newSourceType(Class<T> javaClass, boolean isAbstract, Type<? super T> supertype, Features features, String postfix)
- See Also:
getSourceTypes()
-
getSourceTypes
public final List<Type<?>> getSourceTypes()
- See Also:
newSourceType(Class, Features)
,Type.getPattern()
-
getType
public final Type<?> getType()
Forbid override by subclasses.- Overrides:
getType
in classFeature
- See Also:
Feature.getAbstractType()
-
equals
public final boolean equals(Object other)
Forbid override by subclasses.
-
hashCode
public final int hashCode()
Forbid override by subclasses.
-
addSource
@Deprecated protected final void addSource(Feature feature, String postfix)
Deprecated.UseaddSourceFeature(Feature, String)
instead and benefit from result.- See Also:
getSourceFeatures()
-
addSource
@Deprecated protected final void addSource(Feature feature, String postfix, AnnotatedElement annotationSource)
Deprecated.UseaddSourceFeature(Feature, String, AnnotatedElement)
instead and benefit from result.- See Also:
getSourceFeatures()
-
addSource
@Deprecated protected final void addSource(Feature feature, String postfix, AnnotatedElement annotationSource, Class<?> precedingLocalizationKeysClass)
Deprecated.UseaddSourceFeature(Feature, String, AnnotatedElement, Class)
instead and benefit from result.- See Also:
getSourceFeatures()
-
getSourceFields
@Deprecated public List<? extends Field<?>> getSourceFields()
Deprecated.UsegetSourceFeatures()
instead
-
getSources
@Deprecated public final List<? extends Field<?>> getSources()
Deprecated.UsegetSourceFields()
instead
-
getGeneratedTypes
@Deprecated public final List<Type<?>> getGeneratedTypes()
Deprecated.UsegetSourceTypes()
instead
-
registerSource
@Deprecated protected final void registerSource(Field<?> field, String postfix)
Deprecated.UseaddSourceFeature(Feature,String)
instead
-
newType
@Deprecated protected final <T extends Item> Type<T> newType(Class<T> javaClass, LinkedHashMap<String,Feature> features)
Deprecated.UsenewSourceType(Class,LinkedHashMap)
instead
-
newType
@Deprecated protected final <T extends Item> Type<T> newType(Class<T> javaClass, LinkedHashMap<String,Feature> features, String postfix)
Deprecated.UsenewSourceType(Class,LinkedHashMap,String)
instead
-
newSourceType
@Deprecated protected final <T extends Item> Type<T> newSourceType(Class<T> javaClass, LinkedHashMap<String,Feature> features)
Deprecated.
-
newSourceType
@Deprecated protected final <T extends Item> Type<T> newSourceType(Class<T> javaClass, LinkedHashMap<String,Feature> features, String postfix)
Deprecated.
-
newSourceType
@Deprecated protected final <T extends Item> Type<T> newSourceType(Class<T> javaClass, boolean isAbstract, Type<? super T> supertype, LinkedHashMap<String,Feature> features, String postfix)
Deprecated.
-
initialize
@Deprecated protected void initialize()
Deprecated.OverrideonMount()
instead
-
annotationField
@Deprecated protected final Field annotationField(String name)
Deprecated.Do not use this method anymore.
-
addSource
@Deprecated protected final void addSource(Feature feature, String postfix, Field annotationSource)
Deprecated.For binary compatibility only, useaddSourceFeature(Feature,String,AnnotatedElement)
instead.
-
-