info.magnolia.cms.util
Class Rule

java.lang.Object
  extended by info.magnolia.cms.util.Rule
All Implemented Interfaces:
Serializable

public class Rule
extends Object
implements Serializable

This class defines the rules to be used by the activation content aggregator this is simply a collection of node types.

See Also:
Serialized Form

Constructor Summary
Rule()
           
Rule(String[] allowedTypes)
          Generate list from string array.
Rule(String ruleStringRepresentation, String separator)
          Generate Rule from the string representation of Rule.
 
Method Summary
 void addAllowType(String nodeType)
          Add to allow list.
 boolean isAllowed(javax.jcr.Node node)
          True if given nodeType is allowed.
 boolean isAllowed(String nodeType)
          Deprecated. since 4.5.5 - use isAllowed(Node) instead.
 void removeAllowType(String nodeType)
          Remove from allow list.
 void reverse()
          Set reverse.
 void setAllowedTypes(String[] types)
           
 String toString()
          Get a string representation of this rule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Rule

public Rule()

Rule

public Rule(String[] allowedTypes)
Generate list from string array.


Rule

public Rule(String ruleStringRepresentation,
            String separator)
Generate Rule from the string representation of Rule. Rule string representation can have two patterns: 1. "nodeType1,nodeType2,nodeType3,..." 2. "[nodeType1, nodeType2, ...]; Reverse:false/true". see toString()

Method Detail

setAllowedTypes

public void setAllowedTypes(String[] types)

addAllowType

public void addAllowType(String nodeType)
Add to allow list.


removeAllowType

public void removeAllowType(String nodeType)
Remove from allow list.


isAllowed

public boolean isAllowed(String nodeType)
Deprecated. since 4.5.5 - use isAllowed(Node) instead.

True if allowedTypes contains nodeType. Method return false also if nodeType is subtype of one of the allowedTypes.


isAllowed

public boolean isAllowed(javax.jcr.Node node)
                  throws javax.jcr.RepositoryException
True if given nodeType is allowed.

Throws:
javax.jcr.RepositoryException

toString

public String toString()
Get a string representation of this rule. Pattern is "[nodeType1, nodeType2, ...]; Reverse:false/true".

Overrides:
toString in class Object
Returns:
string representation

reverse

public void reverse()
Set reverse.



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