Class GraphPolicyRule


  • public class GraphPolicyRule
    extends java.lang.Object
    A graph policy rule specifies a component of a GraphPolicy. It is designed to be conveniently created using Spring by supplying configuration metadata to the bean container.
    Since:
    5.1.0
    • Constructor Detail

      • GraphPolicyRule

        public GraphPolicyRule()
    • Method Detail

      • setMatches

        public void setMatches​(java.lang.String matches)
        Parameters:
        matches - the match conditions for this policy rule, comma-separated
      • setChanges

        public void setChanges​(java.lang.String changes)
        Parameters:
        changes - the changes caused by this policy rule, comma-separated
      • setError

        public void setError​(java.lang.String message)
        Parameters:
        message - the error message triggered by this policy rule
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • parseRules

        public static GraphPolicy parseRules​(GraphPathBean graphPathBean,
                                             java.util.Collection<GraphPolicyRule> rules)
                                      throws GraphException
        Convert the text-based rules as specified in the configuration metadata into a policy applicable in model object graph traversal. (A more advanced effort could construct an efficient decision tree, but that optimization may be premature.)
        Parameters:
        graphPathBean - the graph path bean
        rules - the rules to apply
        Returns:
        a policy for graph traversal by GraphTraversal
        Throws:
        GraphException - if the text-based rules could not be parsed