Package dev.cel.common
Interface Source
-
-
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 toline
.
-
-
-
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 toline
. Snippets are split based on the newline ('\n').- Parameters:
line
- the line number starting from 1.
-
-