com.ibm.commerce.marketing.promotion.condition

Class CatalogEntryAttributeFilter

  • java.lang.Object
    • com.ibm.commerce.marketing.promotion.condition.CatalogEntryAttributeFilter
  • All Implemented Interfaces:
    Filter, XMLizable, java.io.Serializable


    public class CatalogEntryAttributeFilter
    extends java.lang.Object
    implements Filter
    CatalogEntryAttributeFilter class filters LineItemSet based on CatalogEntry attribute values of the LineItems. It returns all LineItem whose attribute value satisfies the defined matching rule. This class implements Filter interface.

    XML Snippet for this type of Filter.

     
           <Filter impl="com.ibm.commerce.marketing.promotion.condition.CatalogEntryAttributeFilter"> 
              <AssociatedLanguage>-1</AssociatedLanguage>
              <CaseSensitive>false</CaseSensitive>
              <SupportAttributeWithNoAssociatedLanguage>false</SupportAttributeWithNoAssociatedLanguage>
              <AttributeRule>
                 <Name>Color</Name>
                 <MatchingType>EqualTo</MatchingType>
                 <Value>Blue</Value>
                 <Value>Red</Value>
              </AttributeRule>
              <AttributeRule>
                 <Name>Size</Name>
                 <MatchingType>GreaterThan</MatchingType>
                 <Value>12</Value>
             </AttributeRule>
          </Filter>
     
     
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM copyright notice field.
      static int MATCH_RESULT_FALSE
      A constant indicates that the attribute value does not match the rule.
      static int MATCH_RESULT_TRUE
      A constant indicates that the attribute value matches the rule.
      static int MATCH_RESULT_UNKNOWN
      A constant indicates that the matching rule is not currently supported.
      static java.lang.String TAG_ATTR_RULE
      XML tag - "AttributeRule"
      static java.lang.String TAG_CASE_SENSITIVE
      XML tag - "CaseSensitive"
      static java.lang.String TAG_FILTER
      XML tag - "Filter"
      static java.lang.String TAG_INCLUSION
      XML tag - "Inclusion"
      static java.lang.String TAG_LANGUAGE
      XML tag - "AssociatedLanguage"
      static java.lang.String TAG_SUPPORT_NONE_LANGUAGE
      XML tag - "SupportAttributeWithNoAssociatedLanguage"
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      LineItemSet filter(LineItemSet input, PromotionContext context)
      This method performs the business logic to filter the input LineItemSet and return a subset of the original LineItemSet.
      void fromXML(org.w3c.dom.Node anXMLNode)
      Transforms the XML node into its corresponding real Object.
      java.lang.String getAssociatedLanguage()
      Gets the language used for the attribute matching rules.
      java.util.List getAttributeRules()
      Gets list of attribute matching rules.
      boolean isCaseSensitive()
      Gets the flag indicating whether the name or value of an attribute is case-sensitive or not.
      boolean isInclusion()
      Gets the flag indicating whether the filtering logic is for inclusion or exclusion.
      boolean isSupportAttributeWithNoAssociatedLanguage()
      A flag indicates whether the filter will support attributes that does not have associated language.
      void setAssociatedLanguage(java.lang.String aLanguageId)
      Sets the language used for attribute rules.
      void setCaseSensitive(boolean aCaseSensitive)
      Sets the case-sensitive flag that indicates whether the value of an attribute is case-sensitive or not.
      void setInclusion(boolean aInclusion)
      Sets the flag to indicate whether the filtering logic is for inclusion or exclusion.
      void setSupportAttributeWithNoAssociatedLanguage(boolean aFlag)
      Sets the flag that indicates whether the filter will support language insensitive attributes or not.
      java.lang.String toXML()
      Converts the object into its corresponding XML format representation.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
      • TAG_FILTER

        public static final java.lang.String TAG_FILTER
        XML tag - "Filter"
        See Also:
        Constant Field Values
      • TAG_LANGUAGE

        public static final java.lang.String TAG_LANGUAGE
        XML tag - "AssociatedLanguage"
        See Also:
        Constant Field Values
      • TAG_INCLUSION

        public static final java.lang.String TAG_INCLUSION
        XML tag - "Inclusion"
        See Also:
        Constant Field Values
      • TAG_SUPPORT_NONE_LANGUAGE

        public static final java.lang.String TAG_SUPPORT_NONE_LANGUAGE
        XML tag - "SupportAttributeWithNoAssociatedLanguage"
        See Also:
        Constant Field Values
      • TAG_CASE_SENSITIVE

        public static final java.lang.String TAG_CASE_SENSITIVE
        XML tag - "CaseSensitive"
        See Also:
        Constant Field Values
      • TAG_ATTR_RULE

        public static final java.lang.String TAG_ATTR_RULE
        XML tag - "AttributeRule"
        See Also:
        Constant Field Values
      • MATCH_RESULT_TRUE

        public static final int MATCH_RESULT_TRUE
        A constant indicates that the attribute value matches the rule.
        See Also:
        Constant Field Values
      • MATCH_RESULT_FALSE

        public static final int MATCH_RESULT_FALSE
        A constant indicates that the attribute value does not match the rule.
        See Also:
        Constant Field Values
      • MATCH_RESULT_UNKNOWN

        public static final int MATCH_RESULT_UNKNOWN
        A constant indicates that the matching rule is not currently supported. By default implementation, it considers as failed.
        See Also:
        Constant Field Values
    • Constructor Detail

      • CatalogEntryAttributeFilter

        public CatalogEntryAttributeFilter()
        Constructor for CatalogEntryAttributeFilter.
    • Method Detail

      • getAttributeRules

        public java.util.List getAttributeRules()
        Gets list of attribute matching rules.
        Returns:
        A list of attribute matching rules.
      • filter

        public LineItemSet filter(LineItemSet input,
                                  PromotionContext context)
        Description copied from interface: Filter
        This method performs the business logic to filter the input LineItemSet and return a subset of the original LineItemSet. An empty LineItemSet may be returned if no line item matches the filtering condition.
        Specified by:
        filter in interface Filter
        Parameters:
        input - LineItemSet
        context - PromotionContext
        Returns:
        the filtered LineItemSet
        See Also:
        com.ibm.commerce.marketing.promotion.condition.Filter#filter(LineItemSet)
      • getAssociatedLanguage

        public java.lang.String getAssociatedLanguage()
        Gets the language used for the attribute matching rules.
        Returns:
        Returns the language ID.
      • setAssociatedLanguage

        public void setAssociatedLanguage(java.lang.String aLanguageId)
        Sets the language used for attribute rules.
        Parameters:
        aLanguageId - The language ID to set.
      • isSupportAttributeWithNoAssociatedLanguage

        public boolean isSupportAttributeWithNoAssociatedLanguage()
        A flag indicates whether the filter will support attributes that does not have associated language. Once the flag is set to true, if an attribute value cannot be found under the associated language ID, it will also check the value of the attribute under predefined language ID "NONE".
        Returns:
        Returns true or false.
      • setSupportAttributeWithNoAssociatedLanguage

        public void setSupportAttributeWithNoAssociatedLanguage(boolean aFlag)
        Sets the flag that indicates whether the filter will support language insensitive attributes or not.
        Parameters:
        aFlag - The value of true or false.
      • isCaseSensitive

        public boolean isCaseSensitive()
        Gets the flag indicating whether the name or value of an attribute is case-sensitive or not.
        Returns:
        A value true indicates that the name or value is case-sensitive; false otherwise.
      • setCaseSensitive

        public void setCaseSensitive(boolean aCaseSensitive)
        Sets the case-sensitive flag that indicates whether the value of an attribute is case-sensitive or not.
        Parameters:
        aCaseSensitive - The value to set.
      • isInclusion

        public boolean isInclusion()
        Gets the flag indicating whether the filtering logic is for inclusion or exclusion. By default, it returns a value true.
        Returns:
        The inclusion flag value.
      • setInclusion

        public void setInclusion(boolean aInclusion)
        Sets the flag to indicate whether the filtering logic is for inclusion or exclusion.
        Parameters:
        aInclusion - The value to set.