Class EditorVariablesBase

    • Method Detail

      • expandEnvAndSystem

        public static java.lang.String expandEnvAndSystem​(java.lang.String expr)
        Expand the environment and system variables.
        Parameters:
        expr - The expression containing environment and system variables.
        Returns:
        The expression with the environment and system variables expanded.
      • registerEnvAndSystemResolver

        protected static void registerEnvAndSystemResolver​(ro.sync.util.editorvars.expander.EditorVariableExpander expander)
        Register the resolvers for the environment and system variables.
        Parameters:
        expander - The expander where to register the resolvers.
      • getName

        protected static final java.lang.String getName​(java.lang.String editorVariable)
        Get the name of the given editor variable.

        For example, for "${pd}", get "pd."
        Parameters:
        editorVariable - The editor variable.
        Returns:
        the name.
      • fastEquals

        protected static final boolean fastEquals​(java.lang.String varName,
                                                  java.lang.String varPrefix)
        Checks if the variable name is the one that appears inside the prefix form. A prefix form is either ${varName} or ${varName(
        Parameters:
        varName - Variable name.
        varPrefix - ${varName} or ${varName(
        Returns:
        true if the variable name is the one present inside the prefix form.
      • replaceFunctions

        public static java.lang.String replaceFunctions​(java.lang.String expr,
                                                        java.lang.String functionVariablePrefix,
                                                        java.lang.String functionVariableSuffix,
                                                        EditorVariables.FunctionResolver keyToValueMap)
        Replace all functions with the value taken from the map corresponding to the key
        Parameters:
        expr - The expression to modify.
        functionVariablePrefix - Prefix of function signature.
        functionVariableSuffix - Suffix of function signature.
        keyToValueMap - Map between keys and values.
        Returns:
        The processed expression.