Class 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.
    • Method Detail

      • propertyNamePredicate

        public static Predicate propertyNamePredicate​(String propertyName)
        Tests if the property has the following name.
        Parameters:
        propertyName - the property name.
        Returns:
        true if the property has the given name, false otherwise.
      • 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:
        true if the property has on of the given names, false otherwise.
      • 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:
        true if the property has the given name, false otherwise.
      • nodeNamePredicate

        public static Predicate nodeNamePredicate​(String nodeName)
        Tests if the node has the following name.
        Parameters:
        nodeName - the node name.
        Returns:
        true if the node has the given name, false otherwise.
      • ametysAttributePredicate

        public static Predicate ametysAttributePredicate()
        Tests if the node or property is a Ametys attribute, ie. it is prefixed by 'ametys:'
        Returns:
        true if the name starts with 'ametys:' false otherwise.
      • nodeTypePredicate

        public static Predicate nodeTypePredicate​(String nodeTypeName)
        Tests if the node is of the given node type.
        Parameters:
        nodeTypeName - the node type name.
        Returns:
        true if the node has the given node type, false otherwise.
      • isAllowedForLiveContent

        public static Predicate isAllowedForLiveContent()
        Tests if the node or property is allowed in the live workspace
        Returns:
        true if the property or node is allowed, false otherwise.
      • 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:
        true if the property or node is allowed, false otherwise.