Interface Source

  • All Known Implementing Classes:
    CelSource

    @Internal
    public interface Source
    Common interface definition for source properties.

    CEL Library Internals. Do Not Use. Consumers should instead use the canonical implementations such as CelSource.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      CelCodePointArray getContent()
      Gets the original textual content of this source, represented in an array of code points.
      java.lang.String getDescription()
      Gets the description of this source that may optionally be set (example: location of the file containing the source).
      com.google.common.collect.ImmutableMap<java.lang.Long,​java.lang.Integer> getPositionsMap()
      Gets the map of each parsed node ID (ex: expression ID, policy ID) to their source positions.
      java.util.Optional<java.lang.String> getSnippet​(int line)
      Get the text from the source text that corresponds to line.
    • Method Detail

      • getContent

        CelCodePointArray getContent()
        Gets the original textual content of this source, represented in an array of code points.
      • getDescription

        java.lang.String getDescription()
        Gets the description of this source that may optionally be set (example: location of the file containing the source).
      • getPositionsMap

        com.google.common.collect.ImmutableMap<java.lang.Long,​java.lang.Integer> getPositionsMap()
        Gets the map of each parsed node ID (ex: expression ID, policy ID) to their source positions.
      • getSnippet

        java.util.Optional<java.lang.String> getSnippet​(int line)
        Get the text from the source text that corresponds to line. Snippets are split based on the newline ('\n').
        Parameters:
        line - the line number starting from 1.