Package play

Class PlayPlugin.Filter<T>

  • Direct Known Subclasses:
    JPAPlugin.TransactionalFilter
    Enclosing class:
    PlayPlugin

    public abstract static class PlayPlugin.Filter<T>
    extends java.lang.Object
    Class that define a filter. A filter is a class that wrap a certain behavior around an action. You can access your Request and Response object within the filter. See the JPA plugin for an example. The JPA plugin wraps a transaction around an action. The filter applies a transaction to the current Action.
    • Constructor Detail

      • Filter

        public Filter​(java.lang.String name)
    • Method Detail

      • withinFilter

        public abstract T withinFilter​(F.Function0<T> fct)
                                throws java.lang.Throwable
        Throws:
        java.lang.Throwable
      • decorate

        public PlayPlugin.Filter<T> decorate​(PlayPlugin.Filter<T> innerFilter)
        Surround innerFilter with this. (innerFilter after this)
        Parameters:
        innerFilter - filter to be wrapped.
        Returns:
        a new Filter object. newFilter.withinFilter(x) is outerFilter.withinFilter(innerFilter.withinFilter(x))
      • getName

        public java.lang.String getName()