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.

Version:
$Revision$ ($Author$)
Author:
Sameer Charles
See Also:
Serialized Form

Constructor Summary
Rule()
           
Rule(String[] allowedTypes)
          Generate list from string array.
Rule(String allowedTypes, String separator)
          Generate list from the string.
 
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 info.magnolia.cms.util.Rule.isAllowed(Node) instead.
 void removeAllowType(String nodeType)
          Remove from allow list.
 void reverse()
          Set reverse.
 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.

Parameters:
allowedTypes -

Rule

public Rule(String allowedTypes,
            String separator)
Generate list from the string.

Parameters:
allowedTypes -
separator -
Method Detail

addAllowType

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

Parameters:
nodeType -

removeAllowType

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

Parameters:
nodeType -

isAllowed

public boolean isAllowed(String nodeType)
Deprecated. since 4.5.5 - use info.magnolia.cms.util.Rule.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.

Overrides:
toString in class Object
Returns:
string representation

reverse

public void reverse()
Set reverse.



Copyright © 2003–2014 Magnolia International Ltd.. All rights reserved.