Class JexlSandbox.Permissions

  • Enclosing class:
    JexlSandbox

    public static final class JexlSandbox.Permissions
    extends java.lang.Object
    Contains the allow or block lists for properties and methods for a given class.
    • Field Detail

      • inheritable

        private final boolean inheritable
        Whether these permissions are inheritable, ie can be used by derived classes.
    • Constructor Detail

      • Permissions

        Permissions​(boolean inherit,
                    boolean readFlag,
                    boolean writeFlag,
                    boolean executeFlag)
        Creates a new permissions instance.
        Parameters:
        inherit - whether these permissions are inheritable
        readFlag - whether the read property list is allow or block
        writeFlag - whether the write property list is allow or block
        executeFlag - whether the method list is allow of block
      • Permissions

        Permissions​(boolean inherit,
                    JexlSandbox.Names nread,
                    JexlSandbox.Names nwrite,
                    JexlSandbox.Names nexecute)
        Creates a new permissions instance.
        Parameters:
        inherit - whether these permissions are inheritable
        nread - the read set
        nwrite - the write set
        nexecute - the method set
    • Method Detail

      • execute

        public JexlSandbox.Names execute()
        Gets the set of method names in these permissions.
        Returns:
        the set of method names
      • execute

        public JexlSandbox.Permissions execute​(java.lang.String... methodNames)
        Adds a list of executable methods names to these permissions.

        The constructor is denoted as the empty-string, all other methods by their names.

        Parameters:
        methodNames - the method names
        Returns:
        this instance of permissions
      • isInheritable

        public boolean isInheritable()
        Returns:
        whether these permissions applies to derived classes.
      • read

        public JexlSandbox.Names read()
        Gets the set of readable property names in these permissions.
        Returns:
        the set of property names
      • read

        public JexlSandbox.Permissions read​(java.lang.String... propertyNames)
        Adds a list of readable property names to these permissions.
        Parameters:
        propertyNames - the property names
        Returns:
        this instance of permissions
      • write

        public JexlSandbox.Names write()
        Gets the set of writable property names in these permissions.
        Returns:
        the set of property names
      • write

        public JexlSandbox.Permissions write​(java.lang.String... propertyNames)
        Adds a list of writable property names to these permissions.
        Parameters:
        propertyNames - the property names
        Returns:
        this instance of permissions