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
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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidDeprecated.protected final voidaddSource(Feature feature, String postfix, AnnotatedElement annotationSource) Deprecated.UseaddSourceFeature(Feature, String, AnnotatedElement)instead and benefit from result.protected final voidaddSource(Feature feature, String postfix, AnnotatedElement annotationSource, Class<?> precedingLocalizationKeysClass) Deprecated.UseaddSourceFeature(Feature, String, AnnotatedElement, Class)instead and benefit from result.protected final voidDeprecated.For binary compatibility only, useaddSourceFeature(Feature,String,AnnotatedElement)instead.protected final <F extends Feature>
FaddSourceFeature(F feature, String postfix) protected final <F extends Feature>
FaddSourceFeature(F feature, String postfix, AnnotatedElement annotationSource) protected final <F extends Feature>
FaddSourceFeature(F feature, String postfix, AnnotatedElement annotationSource, Class<?> precedingLocalizationKeysClass) protected final FieldannotationField(String name) Deprecated.Do not use this method anymore.final booleanForbid override by subclasses.Deprecated.UsegetSourceTypes()insteadDeprecated.UsegetSourceFeatures()insteadDeprecated.UsegetSourceFields()insteadfinal Type<?>getType()Forbid override by subclasses.final inthashCode()Forbid override by subclasses.protected voidDeprecated.OverrideonMount()insteadnewSourceType(Class<T> javaClass, boolean isAbstract, Type<? super T> supertype, Features features, String postfix) newSourceType(Class<T> javaClass, boolean isAbstract, Type<? super T> supertype, LinkedHashMap<String, Feature> features, String postfix) Deprecated.newSourceType(Class<T> javaClass, Features features) newSourceType(Class<T> javaClass, Features features, String postfix) newSourceType(Class<T> javaClass, LinkedHashMap<String, Feature> features) Deprecated.newSourceType(Class<T> javaClass, LinkedHashMap<String, Feature> features, String postfix) Deprecated.newType(Class<T> javaClass, LinkedHashMap<String, Feature> features) Deprecated.UsenewSourceType(Class,LinkedHashMap)insteadDeprecated.UsenewSourceType(Class,LinkedHashMap,String)insteadprotected voidonMount()Here you can do additional initialization not yet done in the constructor.protected final voidregisterSource(Field<?> field, String postfix) Deprecated.UseaddSourceFeature(Feature,String)insteadMethods inherited from class com.exedio.cope.Feature
afterModelCreated, getAbstractType, getAnnotation, getID, getLocalizationKeys, getName, getPattern, isAnnotationPresent, isSourceAlready, mount, readResolve, requireMounted, toString, toString, writeReplace
-
Constructor Details
-
Pattern
public Pattern()
-
-
Method Details
-
addSourceFeature
- Returns:
- parameter
feature - See Also:
-
addSourceFeature
protected final <F extends Feature> F addSourceFeature(F feature, String postfix, AnnotatedElement annotationSource) - Returns:
- parameter
feature - See Also:
-
addSourceFeature
protected final <F extends Feature> F addSourceFeature(F feature, String postfix, AnnotatedElement annotationSource, Class<?> precedingLocalizationKeysClass) - Returns:
- parameter
feature - See Also:
-
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
- See Also:
-
newSourceType
protected final <T extends Item> Type<T> newSourceType(Class<T> javaClass, Features features, String postfix) - See Also:
-
newSourceType
protected final <T extends Item> Type<T> newSourceType(Class<T> javaClass, boolean isAbstract, Type<? super T> supertype, Features features, String postfix) - See Also:
-
getSourceFeaturesGather
-
getSourceFeatures
-
getSourceTypes
-
getType
Forbid override by subclasses. -
equals
Forbid override by subclasses. -
hashCode
public final int hashCode()Forbid override by subclasses. -
addSource
Deprecated.UseaddSourceFeature(Feature, String)instead and benefit from result.- See Also:
-
addSource
@Deprecated protected final void addSource(Feature feature, String postfix, AnnotatedElement annotationSource) Deprecated.UseaddSourceFeature(Feature, String, AnnotatedElement)instead and benefit from result.- See Also:
-
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:
-
getSourceFields
Deprecated.UsegetSourceFeatures()instead -
getSources
Deprecated.UsegetSourceFields()instead -
getGeneratedTypes
Deprecated.UsegetSourceTypes()instead -
registerSource
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.OverrideonMount()instead -
annotationField
Deprecated.Do not use this method anymore. -
addSource
Deprecated.For binary compatibility only, useaddSourceFeature(Feature,String,AnnotatedElement)instead.
-
addSourceFeature(Feature, String)instead and benefit from result.