info.magnolia.jcr.decoration
Class NodePredicateContentDecorator

java.lang.Object
  extended by info.magnolia.jcr.decoration.AbstractContentDecorator
      extended by info.magnolia.jcr.decoration.NodePredicateContentDecorator
All Implemented Interfaces:
ContentDecorator
Direct Known Subclasses:
ChannelVisibilityContentDecorator

public class NodePredicateContentDecorator
extends AbstractContentDecorator

ContentDecorator that applies a predicate to all nodes in a JCR object graph. The predicate is checked against all parent nodes and for properties its tested on their node and all its parents. This effectively hides the entire sub-tree below a node that doesn't match the predicate.

Version:
$Id$

Constructor Summary
NodePredicateContentDecorator(AbstractPredicate<javax.jcr.Node> nodePredicate)
           
 
Method Summary
 boolean evaluateNode(javax.jcr.Node node)
          Evaluates if a node should be hidden by wrappers.
 boolean evaluateProperty(javax.jcr.Property property)
          Evaluates if a property should be hidden by wrappers.
 boolean isMultipleWrapEnabled()
          Tells if multiple wrapping with this content decorator is enabled.
 
Methods inherited from class info.magnolia.jcr.decoration.AbstractContentDecorator
wrapNode, wrapNodeIterator, wrapProperty, wrapPropertyIterator, wrapSession, wrapWorkspace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodePredicateContentDecorator

public NodePredicateContentDecorator(AbstractPredicate<javax.jcr.Node> nodePredicate)
Method Detail

evaluateNode

public boolean evaluateNode(javax.jcr.Node node)
Description copied from interface: ContentDecorator
Evaluates if a node should be hidden by wrappers.

Specified by:
evaluateNode in interface ContentDecorator
Overrides:
evaluateNode in class AbstractContentDecorator
Parameters:
node - the node to evaluate
Returns:
true if the node should be visible or false to hide it

evaluateProperty

public boolean evaluateProperty(javax.jcr.Property property)
Description copied from interface: ContentDecorator
Evaluates if a property should be hidden by wrappers.

Specified by:
evaluateProperty in interface ContentDecorator
Overrides:
evaluateProperty in class AbstractContentDecorator
Parameters:
property - the property to evaluate.
Returns:
true if the property should be visible or false to hide it

isMultipleWrapEnabled

public boolean isMultipleWrapEnabled()
Description copied from interface: ContentDecorator
Tells if multiple wrapping with this content decorator is enabled.



Copyright © 2003-2013 Magnolia International Ltd.. All Rights Reserved.