Package org.ametys.cms.support
Class AmetysPredicateUtils
- java.lang.Object
-
- org.apache.commons.collections.PredicateUtils
-
- org.ametys.cms.support.AmetysPredicateUtils
-
public class AmetysPredicateUtils extends PredicateUtils
Provides the following predicates:- propertyNamePredicate - accept a property depending on his name.
- nodeNamePredicate - accept a node depending on his name.
- nodeTypePredicate - accept a node depending on his node type.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classAmetysPredicateUtils.AllowedForLivePredicateprivate static classAmetysPredicateUtils.IgnoreProtectedPredicateprivate static classAmetysPredicateUtils.NonVersionnedPredicate
-
Field Summary
Fields Modifier and Type Field Description private static AmetysPredicateUtils.AllowedForLivePredicate_allowedLivePredicate
-
Constructor Summary
Constructors Constructor Description AmetysPredicateUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PredicateametysAttributePredicate()Tests if the node or property is a Ametys attribute, ie.static PredicateignoreProtectedProperties(Predicate predicate)Tests if the property is not a protected one (e.g.static PredicateisAllowedForLiveContent()Tests if the node or property is allowed in the live workspacestatic PredicateisNonVersionned(Node node)Tests if the node or property is allowed in the live workspacestatic PredicatenodeNamePredicate(String nodeName)Tests if the node has the following name.static PredicatenodeTypePredicate(String nodeTypeName)Tests if the node is of the given node type.static PredicatepropertyNamePredicate(String propertyName)Tests if the property has the following name.static PredicatepropertyNamesPredicate(String... propertyNames)Tests if the property has a given name in a list.-
Methods inherited from class org.apache.commons.collections.PredicateUtils
allPredicate, allPredicate, andPredicate, anyPredicate, anyPredicate, asPredicate, eitherPredicate, equalPredicate, exceptionPredicate, falsePredicate, identityPredicate, instanceofPredicate, invokerPredicate, invokerPredicate, neitherPredicate, nonePredicate, nonePredicate, notNullPredicate, notPredicate, nullIsExceptionPredicate, nullIsFalsePredicate, nullIsTruePredicate, nullPredicate, onePredicate, onePredicate, orPredicate, transformedPredicate, truePredicate, uniquePredicate
-
-
-
-
Field Detail
-
_allowedLivePredicate
private static AmetysPredicateUtils.AllowedForLivePredicate _allowedLivePredicate
-
-
Constructor Detail
-
AmetysPredicateUtils
public AmetysPredicateUtils()
-
-
Method Detail
-
propertyNamePredicate
public static Predicate propertyNamePredicate(String propertyName)
Tests if the property has the following name.- Parameters:
propertyName- the property name.- Returns:
trueif the property has the given name,falseotherwise.
-
propertyNamesPredicate
public static Predicate propertyNamesPredicate(String... propertyNames)
Tests if the property has a given name in a list.- Parameters:
propertyNames- one or several property names.- Returns:
trueif the property has on of the given names,falseotherwise.
-
ignoreProtectedProperties
public static Predicate ignoreProtectedProperties(Predicate predicate)
Tests if the property is not a protected one (e.g. jcr:uuid).- Parameters:
predicate- the additional predicate to evaluate.- Returns:
trueif the property has the given name,falseotherwise.
-
nodeNamePredicate
public static Predicate nodeNamePredicate(String nodeName)
Tests if the node has the following name.- Parameters:
nodeName- the node name.- Returns:
trueif the node has the given name,falseotherwise.
-
ametysAttributePredicate
public static Predicate ametysAttributePredicate()
Tests if the node or property is a Ametys attribute, ie. it is prefixed by 'ametys:'- Returns:
trueif the name starts with 'ametys:'falseotherwise.
-
nodeTypePredicate
public static Predicate nodeTypePredicate(String nodeTypeName)
Tests if the node is of the given node type.- Parameters:
nodeTypeName- the node type name.- Returns:
trueif the node has the given node type,falseotherwise.
-
isAllowedForLiveContent
public static Predicate isAllowedForLiveContent()
Tests if the node or property is allowed in the live workspace- Returns:
trueif the property or node is allowed,falseotherwise.
-
isNonVersionned
public static Predicate isNonVersionned(Node node)
Tests if the node or property is allowed in the live workspace- Parameters:
node- The parent node.- Returns:
trueif the property or node is allowed,falseotherwise.
-
-