Class PathConstraintBag


  • public class PathConstraintBag
    extends PathConstraint
    Representation of a constraint to a bag in the PathQuery
    Author:
    Matthew Wakeling
    • Field Detail

      • VALID_OPS

        public static final java.util.Set<ConstraintOp> VALID_OPS
        List of valid ops for this type of constraint
    • Constructor Detail

      • PathConstraintBag

        public PathConstraintBag​(java.lang.String path,
                                 ConstraintOp op,
                                 java.lang.String bag)
        Constructs a new PathConstraintBag. The path should be a normal path expression with dots separating the parts. Do not use colons to represent outer joins, and do not use square brackets to represent subclass constraints. The path will be checked for format, but can only be verified once inside a PathQuery object by the PathQuery.verifyQuery() method. This object is used to form a constraint to a bag.
        Parameters:
        path - the path that the constraint is attached to
        op - the type of operation
        bag - the name of the bag to constrain to
        Throws:
        java.lang.NullPointerException - if path, op, or bag are null
        java.lang.IllegalArgumentException - if the path contains colons or square brackets, or is otherwise in a bad format, or if the op is invalid for this constraint type
    • Method Detail

      • getBag

        public java.lang.String getBag()
        Returns the bag name that the constraint is constraining to.
        Returns:
        a String
      • toString

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