Class FeatureContainer
- java.lang.Object
-
- de.hybris.platform.catalog.jalo.classification.util.FeatureContainer
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
@Deprecated public class FeatureContainer extends java.lang.Object implements java.lang.Cloneable, java.io.SerializableDeprecated.since ages - useFeatureListinstead.Container object for allfeaturesof a specified product. It ensures that no duplicate features are added and provides easy persistence logic.Loading and storing of features is done like this:
FeatureContainer typed = FeatureContainer.loadTyped( myProduct ); Feature f = all.getFeature("MyClass.myTextAttr"); FeatureValue v = f.get( 0 ); v.setDescription("Some Text here"); Feature f2 = all.getFeature("MyClass.myNumberAttr"); FeatureValue newOne = f2.createValue( new Double(1.234) ); newOne.setClassificationUnit( myUnit ); all.store(); // or if just features of one class should be managed ClassificationClass myClass = ... FeatureContainer cont = featureContainer.loadTyped( p, myClass ); // ... make changed cont.store();- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringWITHIN_FEATURE_CONTAINER_TRANSACTIONDeprecated.
-
Constructor Summary
Constructors Modifier Constructor Description protectedFeatureContainer(FeatureContainer src)Deprecated.Copy constructor.protectedFeatureContainer(Product product, java.util.List<ClassAttributeAssignment> classAssignments)Deprecated.Creates a new feature container with exactly specified class-attribute mappings.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected FeatureaddFeature(Feature feat)Deprecated.Adds a new feature to this container.voidclearFeatures()Deprecated.For untyped containers only : deletes all features (and of course their values too).voidclearValues()Deprecated.Deletes all features but leaves features itself unchanged.FeatureContainerclone()Deprecated.Creates a deep copy of this feature container.static FeatureContainercreate(Product product)Deprecated.Creates an empty product feature container.<T> UntypedFeature<T>createFeature(java.lang.String qualifer)Deprecated.Factory method to create (and add) a new unlocalized untyped feature.<T> UntypedFeature<T>createFeature(java.lang.String qualifer, boolean localized)Deprecated.Factory method to create (and add) a new untyped feature.static FeatureContainercreateTyped(Product product, java.util.List<ClassAttributeAssignment> assignments)Deprecated.Creates an empty product feature container which is able to handle all features for the specified set of classification attribute assignments.static FeatureContainercreateTyped(Product product, java.util.Set<ClassificationClass> classes)Deprecated.Creates an empty product feature container which is able to handle all features for the specified set of classification classes.protected voidcreateTypedFeatures()Deprecated.static java.lang.StringcreateUniqueKey(ClassAttributeAssignment assignment)Deprecated.Assembles the unique key representation for a typed feature.static FeatureContainercreateUntyped(Product product)Deprecated.Creates an empty product feature container which will only handle feature values which are not associated with a classification class.voiddeleteFeature(java.lang.String qualifier)Deprecated.Removes the feature for a given unique key.protected static java.util.List<ClassAttributeAssignment>extractAssignments(java.util.Set<ClassificationClass> classes)Deprecated.protected static java.util.Set<ClassificationClass>extractClasses(java.util.Collection<ClassAttributeAssignment> assignments)Deprecated.protected static java.util.Set<ClassificationSystemVersion>extractVersions(java.util.Collection<ClassificationClass> classes)Deprecated.protected java.util.Map<ClassAttributeAssignment,java.util.List<ProductFeature>>fetchItems(Product product, java.util.Set<ClassAttributeAssignment> assignments, java.util.Collection<PK> excludePKs)Deprecated.protected voidfillFromDatabase()Deprecated.protected ClassAttributeAssignmentgetAssignment(ClassificationAttribute attr)Deprecated.protected java.util.Set<ClassAttributeAssignment>getAssignmentsInternal()Deprecated.protected java.lang.StringgetBooleanString(boolean booleanToString)Deprecated.Provides the textual representation for boolean values.java.util.Set<ClassificationClass>getClasses()Deprecated.Returns the classification classes which are managed by this container.ClassificationAttributegetClassificationAttribute(java.lang.String code)Deprecated.Provides a textual shortcut for getting a classification attribute out of the attributes which are managed by this container.ClassAttributeAssignmentgetClassificationAttributeAssignment(java.lang.String code)Deprecated.Provides a textual shortcut for getting a classification attribute assignment out of the assignments which are managed by this container.protected ClassAttributeAssignmentgetClassificationAttributeAssignment(java.lang.String code, boolean failIfNotExists)Deprecated.ClassificationClassgetClassificationClass(java.lang.String code)Deprecated.Provides a textual shortcut for getting a class out of the classes which are managed by this container.protected java.lang.StringgetEmptyValueString()Deprecated.Provides the empty textual representation.<T> TypedFeature<T>getFeature(ClassAttributeAssignment assignment)Deprecated.Returns the feature for a given classification attribute assignment.TypedFeaturegetFeature(ClassificationAttribute attr)Deprecated.Returns the feature for a given classification attribute.<T> TypedFeature<T>getFeature(ClassificationClass cclass, ClassificationAttribute attr)Deprecated.Returns the feature for a given classification class and attribute.<T> Feature<T>getFeature(java.lang.String qualifier)Deprecated.Retrieves a feature by its unique key.java.util.Set<ClassificationClass>getFeatureProvidingClasses()Deprecated.Returns all classes which provided manageable features to this container.java.util.List<? extends Feature>getFeatures()Deprecated.Returns all features currently held within this container.java.util.List<? extends Feature>getFeatures(ClassificationClass cclass)Deprecated.<T> Feature<T>getOrCreateFeature(java.lang.String qualifier)Deprecated.Returns a (untyped) feature with a specified qualifier.ProductgetProduct()Deprecated.java.util.Set<ClassAttributeAssignment>getSupportedAttributeAssignments()Deprecated.Returns all class-attribute assignments which this typed container is able to manage values for.java.util.List<ClassAttributeAssignment>getSupportedAttributeAssignments(ClassificationClass cclass)Deprecated.Returns all class-attribute assignments of the given class which are managed by this typed container.java.util.Set<ClassificationAttribute>getSupportedAttributes()Deprecated.Returns all classification attributes which this container is managing values for.protected java.util.Set<ClassificationClass>getSupportedSuperClasses(ClassificationClass classificationClass)Deprecated.java.util.Set<ClassificationSystemVersion>getSystemVersions()Deprecated.Returns all classification system versions which this container manages assignments for.static java.util.Map<ClassificationClass,java.util.List<ClassAttributeAssignment>>groupAssignments(java.util.Collection<ClassAttributeAssignment> assignments)Deprecated.booleanhasClass(ClassificationClass cclass)Deprecated.Tells whether or not this container manages features of this class.booleanhasFeature(ClassAttributeAssignment assignment)Deprecated.Checks whether or not the class-attribute assignment is supported by this container.booleanhasFeature(ClassificationAttribute attr)Deprecated.Checks whether or not the attribute is supported by this container.booleanhasFeature(java.lang.String qualifier)Deprecated.Tells whether or not this container holds aFeatureinstance with the specified key.booleanisEmpty()Deprecated.Returnstrueif this container doesn't hold any value.static booleanisInFeatureContainerTA(SessionContext ctx)Deprecated.booleanisUntyped()Deprecated.Tells whether or not the container actually manages features belonging toclassesreps.static FeatureContainerload(Product product)Deprecated.Loads all features for a given product from existingProductFeatureitems.static FeatureContainerloadTyped(Product product)Deprecated.Loads all typed features of the given product according to the classification classes it has been assigned to.static FeatureContainerloadTyped(Product product, ClassAttributeAssignment... assignments)Deprecated.Loads all typed features of the given product according to the classification attribute assignments specified.static FeatureContainerloadTyped(Product product, ClassificationClass... classes)Deprecated.Loads all typed features of the given product according to the classification classes specified.static FeatureContainerloadTyped(Product product, java.util.List<ClassAttributeAssignment> assignments)Deprecated.Loads all typed features of the given product according to the classification attribute assignments specified.static FeatureContainerloadTyped(Product product, java.util.Set<ClassificationClass> classes)Deprecated.Loads all typed features of the given product according to the classification classes specified.static FeatureContainerloadUntyped(Product product)Deprecated.Provides a container for all untyped features (and values) of the given product.protected ClassAttributeAssignmentmatchAttribute(ClassificationSystemVersion clSys, java.util.Set<ClassificationClass> permittedClasses, java.lang.String attributeIdentifier)Deprecated.protected ClassificationClassmatchClass(ClassificationSystemVersion clSys, java.lang.String classIdentifier)Deprecated.protected ClassificationSystemVersionmatchSystemVersion(java.lang.String catalogID, java.lang.String versionID, boolean failIfAmbiguous)Deprecated.Tries to find a matching classification system version using the version name and optionally the catalog id.voidreload()Deprecated.Discards any contained features and reloads the whole container from database.static voidremoveAllTypedValues(Product product)Deprecated.Shortcut for removing all typed values.static voidremoveAllTypedValues(Product product, ClassificationClass... classes)Deprecated.Shortcut for removing all values for the specified classification classes.static voidremoveAllTypedValues(Product product, java.util.List<ClassAttributeAssignment> assignments)Deprecated.Shortcut for removing all values for the specified classification attribute assignments.static voidremoveAllTypedValues(Product product, java.util.Set<ClassificationClass> classes)Deprecated.Shortcut for removing all values for the specified classification classes.static voidremoveAllUntypedValues(Product product)Deprecated.Shortcut for removing all untyped features for the given product.protected static java.util.Set<ClassificationClass>resolveClasses(Product product)Deprecated.This method is called during container creation and locates allclasseswhich the given product belongs to.voidstore()Deprecated.Persists the whole container by creating, removing or changingProductFeatureitems.java.lang.StringtoString()Deprecated.protected java.lang.Stringunescape(java.lang.String qualifier)Deprecated.protected voidwriteToDatabase()Deprecated.protected voidwriteToDatabase_Impl()Deprecated.protected voidwriteToDatabase_TX()Deprecated.
-
-
-
Field Detail
-
WITHIN_FEATURE_CONTAINER_TRANSACTION
public static final java.lang.String WITHIN_FEATURE_CONTAINER_TRANSACTION
Deprecated.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FeatureContainer
protected FeatureContainer(Product product, java.util.List<ClassAttributeAssignment> classAssignments)
Deprecated.Creates a new feature container with exactly specified class-attribute mappings. This way it is possible to manage even subsets of class attributes.- Parameters:
product- the product owning the featuresclassAssignments- the class-attribute assignments which should be manageable by this container
-
FeatureContainer
protected FeatureContainer(FeatureContainer src) throws java.lang.CloneNotSupportedException
Deprecated.Copy constructor. Don't use directly.- Throws:
java.lang.CloneNotSupportedException
-
-
Method Detail
-
isInFeatureContainerTA
public static final boolean isInFeatureContainerTA(SessionContext ctx)
Deprecated.
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toStringin classjava.lang.Object
-
getAssignmentsInternal
protected java.util.Set<ClassAttributeAssignment> getAssignmentsInternal()
Deprecated.
-
create
public static FeatureContainer create(Product product)
Deprecated.Creates an empty product feature container. Depending upon whether or not the product actually is classified (seeCatalogManager.getClassificationClasses(Product)) this method returns a container covering all its classification classes - otherwise it will include untyped features only!Please note that the container is neither loaded from the database not does it check whether or not features are existing for the given product!
- Parameters:
product- the product to create a new container for- Returns:
- the new container
-
createTyped
public static FeatureContainer createTyped(Product product, java.util.Set<ClassificationClass> classes) throws JaloInvalidParameterException
Deprecated.Creates an empty product feature container which is able to handle all features for the specified set of classification classes. In case the product is actually assigned to other classes as well this container wont change their values.Please note that the container is neither loaded from the database not does it check whether or not features are existing for the given product!
- Parameters:
product- the product to create a new container forclasses- the set of classification classes which this container should support- Returns:
- the new container
- Throws:
JaloInvalidParameterException- if now classes are provided
-
createTyped
public static FeatureContainer createTyped(Product product, java.util.List<ClassAttributeAssignment> assignments) throws JaloInvalidParameterException
Deprecated.Creates an empty product feature container which is able to handle all features for the specified set of classification attribute assignments. In case the product is actually assigned to other classes as well this container wont change their values.Please note that the container is neither loaded from the database not does it check whether or not features are existing for the given product!
- Parameters:
product- the product to create a new container forassignments- the set of classification classes which this container should support- Returns:
- the new container
- Throws:
JaloInvalidParameterException- if now classes are provided
-
createUntyped
public static FeatureContainer createUntyped(Product product)
Deprecated.Creates an empty product feature container which will only handle feature values which are not associated with a classification class. In case the product is actually assigned to other classes as well this container wont change their values.Please note that the container is neither loaded from the database not does it check whether or not features are existing for the given product!
- Parameters:
product- the product to create a new container for- Returns:
- the new container
-
load
public static FeatureContainer load(Product product)
Deprecated.Loads all features for a given product from existingProductFeatureitems. The container may either be typed or untyped depending upon whether or not the product has been assigned to classification classes or not.To assure the correct type of features please use methods like
loadTyped(Product)orloadUntyped(Product)instead.Please note that the container is not kept synchronous with the database - it merely shows the product's features at loading time!
- Parameters:
product- the product to load features for- Returns:
- a new feature container
-
loadTyped
public static FeatureContainer loadTyped(Product product) throws JaloInvalidParameterException
Deprecated.Loads all typed features of the given product according to the classification classes it has been assigned to.Please note that the container is not kept synchronous with the database - it merely shows the product's features at loading time!
- Parameters:
product- the product to load a feature container for- Returns:
- the new container
- Throws:
JaloInvalidParameterException- if the product is not classified at all
-
removeAllTypedValues
public static void removeAllTypedValues(Product product) throws JaloInvalidParameterException
Deprecated.Shortcut for removing all typed values.- Parameters:
product- the product to remove all values for- Throws:
JaloInvalidParameterException- if the product is not classified at all
-
loadTyped
public static FeatureContainer loadTyped(Product product, java.util.Set<ClassificationClass> classes) throws JaloInvalidParameterException
Deprecated.Loads all typed features of the given product according to the classification classes specified.Please note that the container is not kept synchronous with the database - it merely shows the product's features at loading time!
- Parameters:
product- the product to load a feature container forclasses- the classification classes to manage features for- Returns:
- the new container
- Throws:
JaloInvalidParameterException- if no classes are provided
-
loadTyped
public static FeatureContainer loadTyped(Product product, ClassAttributeAssignment... assignments) throws JaloInvalidParameterException
Deprecated.Loads all typed features of the given product according to the classification attribute assignments specified.Please note that the container is not kept synchronous with the database - it merely shows the product's features at loading time!
- Parameters:
product- the product to load a feature container forassignments- the class attribute assignments to manage features for- Returns:
- the new container
- Throws:
JaloInvalidParameterException- if no assignments are provided
-
loadTyped
public static FeatureContainer loadTyped(Product product, java.util.List<ClassAttributeAssignment> assignments) throws JaloInvalidParameterException
Deprecated.Loads all typed features of the given product according to the classification attribute assignments specified.Please note that the container is not kept synchronous with the database - it merely shows the product's features at loading time!
- Parameters:
product- the product to load a feature container forassignments- the class attribute assignments to manage features for- Returns:
- the new container
- Throws:
JaloInvalidParameterException- if no assignments are provided
-
removeAllTypedValues
public static void removeAllTypedValues(Product product, java.util.Set<ClassificationClass> classes) throws JaloInvalidParameterException
Deprecated.Shortcut for removing all values for the specified classification classes.- Parameters:
product- the product to remove all values forclasses- the classes to remove all values for- Throws:
JaloInvalidParameterException- if no assignments have been specified
-
loadTyped
public static FeatureContainer loadTyped(Product product, ClassificationClass... classes) throws JaloInvalidParameterException
Deprecated.Loads all typed features of the given product according to the classification classes specified.Please note that the container is not kept synchronous with the database - it merely shows the product's features at loading time!
- Parameters:
product- the product to load a feature container forclasses- the classification classes to manage features for- Returns:
- the new container
- Throws:
JaloInvalidParameterException- if no classes are provided
-
removeAllTypedValues
public static void removeAllTypedValues(Product product, ClassificationClass... classes) throws JaloInvalidParameterException
Deprecated.Shortcut for removing all values for the specified classification classes.- Parameters:
product- the product to remove all values forclasses- the classes to remove all values for- Throws:
JaloInvalidParameterException- if no assignments have been specified
-
removeAllTypedValues
public static void removeAllTypedValues(Product product, java.util.List<ClassAttributeAssignment> assignments) throws JaloInvalidParameterException
Deprecated.Shortcut for removing all values for the specified classification attribute assignments.- Parameters:
product- the product to remove all values forassignments- the assignments to remove all values for- Throws:
JaloInvalidParameterException- if no assignments have been specified
-
loadUntyped
public static FeatureContainer loadUntyped(Product product)
Deprecated.Provides a container for all untyped features (and values) of the given product.Untyped features are not assigned to a
ClassAttributeAssignment. Apart from that they offer full feature functionality like localization etc.Please note that the container is not kept synchronous with the database - it merely shows the product's features at loading time!
- Parameters:
product- the product to read untyped feature (-values) for- Returns:
- the feature container
-
removeAllUntypedValues
public static void removeAllUntypedValues(Product product)
Deprecated.Shortcut for removing all untyped features for the given product.
-
store
public void store() throws ConsistencyCheckExceptionDeprecated.Persists the whole container by creating, removing or changingProductFeatureitems. If the container is typed the features are stored ordered as their associatedClassAttributeAssignmentdefine - a typed container just stores them as they are ordered inside the container.The storage algorithm will preserve all
ProductFeatureitems which have been used for loading it - all other feature items actually belonging to features within this container are removed resp. replaced while storing values.- Throws:
ConsistencyCheckException- in case two containers for the same product are persisted concurrently
-
reload
public void reload()
Deprecated.Discards any contained features and reloads the whole container from database. The current class assignments and typed status are kept unchanged!
-
resolveClasses
protected static java.util.Set<ClassificationClass> resolveClasses(Product product)
Deprecated.This method is called during container creation and locates allclasseswhich the given product belongs to.As default
CatalogManager.getClassificationClasses(Product)is called.
-
clone
public FeatureContainer clone() throws java.lang.CloneNotSupportedException
Deprecated.Creates a deep copy of this feature container. This means that all features and their included values are being copied as well.- Overrides:
clonein classjava.lang.Object- Throws:
java.lang.CloneNotSupportedException
-
getSystemVersions
public java.util.Set<ClassificationSystemVersion> getSystemVersions()
Deprecated.Returns all classification system versions which this container manages assignments for.
-
matchSystemVersion
protected ClassificationSystemVersion matchSystemVersion(java.lang.String catalogID, java.lang.String versionID, boolean failIfAmbiguous)
Deprecated.Tries to find a matching classification system version using the version name and optionally the catalog id.- Parameters:
catalogID- optional, the catalog idversionID- the version name- Throws:
JaloInvalidParameterException- if just the version has been specified and more than one version is matching
-
getClasses
public java.util.Set<ClassificationClass> getClasses()
Deprecated.Returns the classification classes which are managed by this container. These are the classes which the owning product has been assigned to or which have been configured usingcreateTyped(Product, Set),createTyped(Product, List),loadTyped(Product, ClassificationClass...),loadTyped(Product, List)orloadTyped(Product, Set).
-
getSupportedSuperClasses
protected java.util.Set<ClassificationClass> getSupportedSuperClasses(ClassificationClass classificationClass)
Deprecated.
-
hasClass
public boolean hasClass(ClassificationClass cclass)
Deprecated.Tells whether or not this container manages features of this class. Since there are several ways of configuring the container it may manage all features of this class or just a subset. Please check viahasFeature(ClassAttributeAssignment)to be sure.- Parameters:
cclass- the classification class to check
-
getFeatureProvidingClasses
public java.util.Set<ClassificationClass> getFeatureProvidingClasses()
Deprecated.Returns all classes which provided manageable features to this container. These may differ fromgetClasses()since not each assigned class must actually provide a feature and on the other hand there may be features inherited from super classes which are show here as well.
-
getClassificationClass
public ClassificationClass getClassificationClass(java.lang.String code) throws JaloInvalidParameterException
Deprecated.Provides a textual shortcut for getting a class out of the classes which are managed by this container. Since classes from different classification systems may be contained the identifier may be defined as one of the following patterns:- {code of class} - may throw exception if ambigous
- {version of systemversion}/{code of class} - may throw exception if ambigous
- {id of system}/{version of systemversion}/{code of class} - fully qualified
- Parameters:
code- the class identifier pattern- Throws:
JaloInvalidParameterException- if there is no such class or more than one class matches
-
matchClass
protected ClassificationClass matchClass(ClassificationSystemVersion clSys, java.lang.String classIdentifier)
Deprecated.
-
getClassificationAttributeAssignment
public ClassAttributeAssignment getClassificationAttributeAssignment(java.lang.String code) throws JaloInvalidParameterException
Deprecated.Provides a textual shortcut for getting a classification attribute assignment out of the assignments which are managed by this container. Since classes from different classification systems may be contained the identifier may be defined as one of the following patterns:- {code of attribute} - may throw exception if ambigous
- {code of class}/{code of attribute} - may throw exception if ambigous
- {version of systemversion}/{code of class}/{code of attribute} - may throw exception if ambigous
- {id of system}/{version of systemversion}/{code of class}/{code of attribute} - fully qualified
- Parameters:
code- the class identifier pattern- Throws:
JaloInvalidParameterException- if there is no such class or more than one class matches
-
getClassificationAttributeAssignment
protected ClassAttributeAssignment getClassificationAttributeAssignment(java.lang.String code, boolean failIfNotExists) throws JaloInvalidParameterException
Deprecated.- Throws:
JaloInvalidParameterException
-
getClassificationAttribute
public ClassificationAttribute getClassificationAttribute(java.lang.String code) throws JaloInvalidParameterException
Deprecated.Provides a textual shortcut for getting a classification attribute out of the attributes which are managed by this container. Since classes from different classification systems may be contained the identifier may be defined as one of the following patterns:- {code of attribute} - may throw exception if ambigous
- {code of class}/{code of attribute} - may throw exception if ambigous
- {version of systemversion}/{code of class}/{code of attribute} - may throw exception if ambigous
- {id of system}/{version of systemversion}/{code of class}/{code of attribute} - fully qualified
- Parameters:
code- the class identifier pattern- Throws:
JaloInvalidParameterException- if there is no such class or more than one class matches
-
matchAttribute
protected ClassAttributeAssignment matchAttribute(ClassificationSystemVersion clSys, java.util.Set<ClassificationClass> permittedClasses, java.lang.String attributeIdentifier)
Deprecated.
-
isUntyped
public boolean isUntyped()
Deprecated.Tells whether or not the container actually manages features belonging toclassesreps.assignmentsor simply collects untyped features.- Returns:
trueif the container does not manage typed features
-
isEmpty
public boolean isEmpty()
Deprecated.Returnstrueif this container doesn't hold any value. This does not necessarily mean that there is no feature - just no feature with existing value.
-
getSupportedAttributeAssignments
public java.util.Set<ClassAttributeAssignment> getSupportedAttributeAssignments() throws java.lang.IllegalStateException
Deprecated.Returns all class-attribute assignments which this typed container is able to manage values for.- Throws:
java.lang.IllegalStateException- if the container is actually untyped
-
getSupportedAttributeAssignments
public java.util.List<ClassAttributeAssignment> getSupportedAttributeAssignments(ClassificationClass cclass) throws java.lang.IllegalStateException
Deprecated.Returns all class-attribute assignments of the given class which are managed by this typed container.Please note that this will also include inherited assignments!
- Parameters:
cclass- the classification class to get supported assignments for- Throws:
java.lang.IllegalStateException- if the container is actually untyped
-
getSupportedAttributes
public java.util.Set<ClassificationAttribute> getSupportedAttributes() throws java.lang.IllegalStateException
Deprecated.Returns all classification attributes which this container is managing values for.Since the container may manage values for multiple classes, which may have separate assignments for the same attribute this method may return less elements than
getSupportedAttributeAssignments()!- Throws:
java.lang.IllegalStateException- if the container is actually untyped
-
getProduct
public Product getProduct()
Deprecated.- Returns:
- the product which this container belongs to
-
createFeature
public <T> UntypedFeature<T> createFeature(java.lang.String qualifer) throws java.lang.IllegalStateException, JaloInvalidParameterException
Deprecated.Factory method to create (and add) a new unlocalized untyped feature.- Parameters:
qualifer- the unique key of the feature within this container- Returns:
- the new feature
- Throws:
java.lang.IllegalStateException- if the container is typed so it cannot manage untyped features.JaloInvalidParameterException- if the container already holds a untyped feature with the same qualifier
-
createFeature
public <T> UntypedFeature<T> createFeature(java.lang.String qualifer, boolean localized) throws java.lang.IllegalStateException, JaloInvalidParameterException
Deprecated.Factory method to create (and add) a new untyped feature.- Parameters:
qualifer- the unique key of the value within this containerlocalized- whether or not the attribute should be able to store localized values- Returns:
- the new feature
- Throws:
java.lang.IllegalStateException- if the container is typed so it cannot manage untyped features.JaloInvalidParameterException- if the container already holds a untyped feature with the same qualifier
-
getFeatures
public java.util.List<? extends Feature> getFeatures()
Deprecated.Returns all features currently held within this container.If the container is untyped this returns all features which were added or loaded explicitly. If the container is typed a feature for each manageable class-attribute assignment is returned regardless if it actually got values.
-
getFeatures
public java.util.List<? extends Feature> getFeatures(ClassificationClass cclass)
Deprecated.
-
unescape
protected java.lang.String unescape(java.lang.String qualifier)
Deprecated.
-
hasFeature
public boolean hasFeature(java.lang.String qualifier)
Deprecated.Tells whether or not this container holds aFeatureinstance with the specified key.A feature should be qualified as follows:
classification system id"/"version"/"class code"."attribute code. Nevertheless system id, version or class may be omitted in case the remaining qualifier is not ambiguous. In case one of these codes contain '/' or '.' these characters must be escaped by putting a '\' in front of them !For example if there is just one attribute
colorcallinghasFeature("color")would be legal. If there are two classes havingcolorthe qualifier must specify which class is meant:hasFeature("Car.color")etc.- Parameters:
qualifier- the feature qualifier
-
getFeature
public <T> Feature<T> getFeature(java.lang.String qualifier) throws JaloInvalidParameterException
Deprecated.Retrieves a feature by its unique key.Since the container may only either untyped or typed features exclusively there are different allowed qualifiers:
- untyped container : here the qualifier is simply the feature qualifier
- typed container : a typed feature is always described as
classification system id"/"version"/"class code"."attribute codee.g.eclass/4.1.80c/27020102.AAA009Nevertheless system id, version or class may be omitted in case the remaining qualifier is not ambiguous.
For example if there is just one attribute
colorcallinghasFeature("color")would be legal. If there are two classes havingcolorthe qualifier must specify which class is meant:hasFeature("Car.color")etc.
- Parameters:
qualifier- the unique key.- Returns:
- the stored feature or null, if nothing has been stored
- Throws:
JaloInvalidParameterException- if the container is typed and no feature exists with the specified qualifier
-
getOrCreateFeature
public <T> Feature<T> getOrCreateFeature(java.lang.String qualifier)
Deprecated.Returns a (untyped) feature with a specified qualifier. If no such feature exists a new untyped feature is beeing created.- Type Parameters:
T- the feature class- Parameters:
qualifier- the feature qualifier- Returns:
- the existing or newly created feature
-
getFeature
public <T> TypedFeature<T> getFeature(ClassAttributeAssignment assignment) throws JaloInvalidParameterException
Deprecated.Returns the feature for a given classification attribute assignment.- Parameters:
assignment- the attribute assignment describing the value- Returns:
- the feature object
- Throws:
JaloInvalidParameterException
-
getFeature
public <T> TypedFeature<T> getFeature(ClassificationClass cclass, ClassificationAttribute attr) throws JaloInvalidParameterException
Deprecated.Returns the feature for a given classification class and attribute.- Parameters:
cclass- the class of the featureattr- the attribute of the feature (within the class)- Returns:
- the feature object
- Throws:
JaloInvalidParameterException
-
hasFeature
public boolean hasFeature(ClassAttributeAssignment assignment)
Deprecated.Checks whether or not the class-attribute assignment is supported by this container.- Parameters:
assignment- the assignment to check- Returns:
trueif the container is type and is configured to manage values for this assignment
-
hasFeature
public boolean hasFeature(ClassificationAttribute attr) throws JaloInvalidParameterException
Deprecated.Checks whether or not the attribute is supported by this container.- Parameters:
attr- the attribute to check- Returns:
trueif the container is type and is configured to manage values for this attribute- Throws:
JaloInvalidParameterException- if more than one assignment exists for the given attribute
-
getFeature
public TypedFeature getFeature(ClassificationAttribute attr) throws JaloInvalidParameterException
Deprecated.Returns the feature for a given classification attribute.- Parameters:
attr- the attribute describing the value- Returns:
- the feature object
- Throws:
JaloInvalidParameterException- if no assignment exists for this attribute and the product's classification classes
-
clearValues
public void clearValues()
Deprecated.Deletes all features but leaves features itself unchanged.Please note that this only affects this container. To persist these changes ( means: removing the database entries as well )
store()must be called.
-
clearFeatures
public void clearFeatures() throws java.lang.IllegalStateExceptionDeprecated.For untyped containers only : deletes all features (and of course their values too).- Throws:
java.lang.IllegalStateException- if the container is typed - typed features are not removable.
-
deleteFeature
public void deleteFeature(java.lang.String qualifier) throws java.lang.IllegalStateExceptionDeprecated.Removes the feature for a given unique key.- Parameters:
qualifier- the unique which describes the value- Throws:
java.lang.IllegalStateException- if the container is typed - typed features are not removable.
-
addFeature
protected Feature addFeature(Feature feat)
Deprecated.Adds a new feature to this container.Adding is done implicitly by the
createFeature(String)methods!- Parameters:
feat- the new value- Returns:
- the previously stored feature with the same key or null
-
createUniqueKey
public static java.lang.String createUniqueKey(ClassAttributeAssignment assignment)
Deprecated.Assembles the unique key representation for a typed feature.- Parameters:
assignment- the class-attribute assignment which the feature is based upon- Returns:
assignment.class.code+'.'+assignment.attribute.code
-
extractVersions
protected static java.util.Set<ClassificationSystemVersion> extractVersions(java.util.Collection<ClassificationClass> classes)
Deprecated.
-
extractClasses
protected static java.util.Set<ClassificationClass> extractClasses(java.util.Collection<ClassAttributeAssignment> assignments)
Deprecated.
-
extractAssignments
protected static java.util.List<ClassAttributeAssignment> extractAssignments(java.util.Set<ClassificationClass> classes)
Deprecated.
-
writeToDatabase_TX
protected void writeToDatabase_TX()
Deprecated.
-
writeToDatabase
protected void writeToDatabase()
Deprecated.
-
writeToDatabase_Impl
protected void writeToDatabase_Impl()
Deprecated.
-
fetchItems
protected java.util.Map<ClassAttributeAssignment,java.util.List<ProductFeature>> fetchItems(Product product, java.util.Set<ClassAttributeAssignment> assignments, java.util.Collection<PK> excludePKs)
Deprecated.
-
createTypedFeatures
protected void createTypedFeatures()
Deprecated.
-
fillFromDatabase
protected void fillFromDatabase()
Deprecated.
-
getAssignment
protected ClassAttributeAssignment getAssignment(ClassificationAttribute attr) throws JaloInvalidParameterException
Deprecated.- Throws:
JaloInvalidParameterException
-
getEmptyValueString
protected java.lang.String getEmptyValueString()
Deprecated.Provides the empty textual representation. Returns-as default.
-
getBooleanString
protected java.lang.String getBooleanString(boolean booleanToString)
Deprecated.Provides the textual representation for boolean values. ReturnsBoolean.toString(b)as default.
-
groupAssignments
public static java.util.Map<ClassificationClass,java.util.List<ClassAttributeAssignment>> groupAssignments(java.util.Collection<ClassAttributeAssignment> assignments)
Deprecated.
-
-