All Implemented Interfaces:
FromSourceLocation, ToNode, TypeCheck, ToCondition, ToExpression

public final class ParseUrl extends LibraryFunction
A rule-set function to parse a URI from a string.
  • Field Details

  • Method Details

    • getDefinition

      public static ParseUrl.Definition getDefinition()
      Gets the FunctionDefinition implementation.
      Returns:
      the function definition.
    • ofExpressions

      public static ParseUrl ofExpressions(ToExpression arg1)
      Creates a ParseUrl function from the given expressions.
      Parameters:
      arg1 - the URI to parse.
      Returns:
      The resulting ParseUrl function.
    • accept

      public <T> T accept(ExpressionVisitor<T> visitor)
      Description copied from class: Expression
      Invoke the ExpressionVisitor functions for this expression.
      Specified by:
      accept in class Expression
      Type Parameters:
      T - the visitor return type.
      Parameters:
      visitor - the visitor to be invoked.
      Returns:
      the return value of the visitor.
    • isIpAddr

      public static boolean isIpAddr(String host)
      Checks if a host is an IP address for use with endpoint rules.
      Parameters:
      host - Host to check.
      Returns:
      true if it is an IP address.
    • normalizePath

      public static String normalizePath(String path)
      Normalizes a path string according to the ParseURL function.
      Parameters:
      path - Path string to normalize.
      Returns:
      the normalized path.