Class Macro


  • public class Macro
    extends Object
    Macro representation for roles and users. Implements following format: @macroId[:index][(parameter1, parameter2, ...)],
    • macroId - name of the macro. Supports alphanumeric symbols
    • index - optional integer, which allow to duplicate macro calls
    • parameters - optional set of strings. each parameter should be string without quotes
    TODO: Macro parameters (ex, multiple usage of macro)
    Since:
    2.1.0
    Author:
    Oleg Nenashev, Synopsys Inc.
    • Constructor Detail

      • Macro

        public Macro​(String name,
                     Integer index,
                     String[] parameters)
        Create new Macro.
        Parameters:
        name - Name of Macro
        index - Index of Macro
        parameters - List of Parameters
    • Method Detail

      • getName

        public String getName()
        Get name of the macro.
        Returns:
        Name of the macro (without prefix)
      • getDisplayName

        public String getDisplayName()
      • getIndex

        public int getIndex()
      • hasIndex

        public boolean hasIndex()
      • getParameters

        public String[] getParameters()
      • hasParameters

        public boolean hasParameters()
      • isMacro

        public static boolean isMacro​(Role role)
        Check if role is a macro.
        Parameters:
        role - Role to be checked
        Returns:
        true if role meets macro criteria
      • isMacro

        public static boolean isMacro​(String macroString)
      • parse

        public static Macro parse​(String macroString)
                           throws MacroException
        Parse macro from string.
        Parameters:
        macroString - - macro string
        Returns:
        Macro instance
        Throws:
        MacroException - - Parse error
        Since:
        2.3.0