Class PermissionUtils


  • public class PermissionUtils
    extends java.lang.Object
    A helper class for applying Permission protected API method tags
    Author:
    Yuqing Chen, Jon Mathews, Ben Holland, Zach Lones
    • Constructor Summary

      Constructors 
      Constructor Description
      PermissionUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static com.ensoftcorp.atlas.core.db.graph.GraphElement tagMethod​(com.ensoftcorp.atlas.core.query.Q context, java.lang.String packageName, java.lang.String className, java.lang.String methodName, java.lang.String[] parameters, java.lang.String... tags)
      A method which find the methods matching the name, declarative structure, and parameters Tag the matched methods with corresponding permission tag.
      static com.ensoftcorp.atlas.core.db.graph.GraphElement tagMethod​(java.lang.String packageName, java.lang.String className, java.lang.String methodName, java.lang.String[] parameters, java.lang.String... tags)
      A method to return the method given the universe as a context
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PermissionUtils

        public PermissionUtils()
    • Method Detail

      • tagMethod

        public static com.ensoftcorp.atlas.core.db.graph.GraphElement tagMethod​(com.ensoftcorp.atlas.core.query.Q context,
                                                                                java.lang.String packageName,
                                                                                java.lang.String className,
                                                                                java.lang.String methodName,
                                                                                java.lang.String[] parameters,
                                                                                java.lang.String... tags)
        A method which find the methods matching the name, declarative structure, and parameters Tag the matched methods with corresponding permission tag.

        • Expected format is based on PScout mappings.
        • Class names are essentially the binary names.
        • Constructors are always named <init>.
        Parameters:
        context - A context from which to start searching
        packageName - The package containing the class(es) and method
        className - The type name, essentially the binary name (unqualified)
        parameters - fully qualified parameter type names of the method
        tag - a set of tags to apply to the method
        Returns:
        the GraphElement, or null if method could not be found
      • tagMethod

        public static com.ensoftcorp.atlas.core.db.graph.GraphElement tagMethod​(java.lang.String packageName,
                                                                                java.lang.String className,
                                                                                java.lang.String methodName,
                                                                                java.lang.String[] parameters,
                                                                                java.lang.String... tags)
        A method to return the method given the universe as a context
        Parameters:
        packageName - The package containing the class(es) and method
        className - A String containing the classes going from outermost class to innermost class delimited by $ Assume anonymous inner classes start with a number and non-anonymous classes do not.
        methodName - name of the method
        parameters - array containing fully qualified name of parameter types for the method
        tags - a set of tags to apply to the method
        Returns: