Class EventFilterTag

  • All Implemented Interfaces:
    ConditionalTag, PropertySupport, org.apache.commons.jelly.DynaTag, org.apache.commons.jelly.impl.BeanSource, org.apache.commons.jelly.Tag
    Direct Known Subclasses:
    ChainedEventFilterTag

    public class EventFilterTag
    extends UseBeanBaseTag

    A specialized tag handler class for creating event filters.

    With this tag handler class simple (i.e. non chained) event filters can be constructed. By specifying the class attribute the concrete class of the filter to be created is defined. Then all the properties supported by this specific filter class can be set in further attributes.

    The tag also checks if it is nested inside a ChainedEventFilterTag tag. If this is the case, the current filter is added as a child filter to this chained filter tag. Otherwise the variable CURRENT_FILTER is set to the active event filter, which can be queried by other tags.

    By inheriting from UseBeanBaseTag all of the features provided by this base class are available for this tag handler class, too.

    Version:
    $Id: EventFilterTag.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    • Field Detail

      • CURRENT_FILTER

        public static final String CURRENT_FILTER
        Constant for the current filter variable. This variable will be set to the currently created event filter and can be evaluated by other tags.
        See Also:
        Constant Field Values
    • Constructor Detail

      • EventFilterTag

        public EventFilterTag()
        Creates a new instance of EventFilterTag.
      • EventFilterTag

        public EventFilterTag​(Class<?> defaultClass,
                              Class<?> baseClass)
        Creates a new instance of EventFilterTag and sets the default class and the base class.
        Parameters:
        defaultClass - the default class
        baseClass - the base class
    • Method Detail

      • passResults

        protected boolean passResults​(Object bean)
                               throws org.apache.commons.jelly.JellyTagException
        Performs post processing on the bean. This implementation checks if this tag is nested inside a ChainedEventFilter tag. If this is the case, the filter is added as a child filter. Otherwise the filter is set in the Jelly context as the current filter.
        Overrides:
        passResults in class UseBeanBaseTag
        Parameters:
        bean - the new bean
        Returns:
        a flag whether the bean could be passed to a target
        Throws:
        org.apache.commons.jelly.JellyTagException - if an error occurs