RelativeSource
RelativeSource represents an embedded source element within a larger source.
Implements
Section titled “Implements”Source
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new RelativeSource(
options):RelativeSource
constructor configures an embedded policy source.
Parameters
Section titled “Parameters”options
Section titled “options”RelativeSourceOptions
Returns
Section titled “Returns”RelativeSource
Methods
Section titled “Methods”containingSource()
Section titled “containingSource()”containingSource():
Source
containingSource returns the complete policy source containing this expression.
Returns
Section titled “Returns”Source
content()
Section titled “content()”content():
string
content returns the embedded source snippet.
Returns
Section titled “Returns”string
Implementation of
Section titled “Implementation of”CommonSource.content
description()
Section titled “description()”description():
string
description returns the containing source description.
Returns
Section titled “Returns”string
Implementation of
Section titled “Implementation of”CommonSource.description
lineOffsets()
Section titled “lineOffsets()”lineOffsets():
number[]
lineOffsets returns line offsets for the containing source.
Returns
Section titled “Returns”number[]
Implementation of
Section titled “Implementation of”CommonSource.lineOffsets
location()
Section titled “location()”location(
line,column):Location
location translates an embedded line and column to an absolute location.
Parameters
Section titled “Parameters”number
column
Section titled “column”number
Returns
Section titled “Returns”Location
Implementation of
Section titled “Implementation of”CommonSource.location
locationOffset()
Section titled “locationOffset()”locationOffset(
location): [number,boolean]
locationOffset translates an absolute location to a containing-source offset.
Parameters
Section titled “Parameters”location
Section titled “location”Location
Returns
Section titled “Returns”[number, boolean]
Implementation of
Section titled “Implementation of”CommonSource.locationOffset
offsetLocation()
Section titled “offsetLocation()”offsetLocation(
offset): [Location,boolean]
offsetLocation returns the absolute location for a relative offset, if found.
Parameters
Section titled “Parameters”offset
Section titled “offset”number
Returns
Section titled “Returns”[Location, boolean]
Implementation of
Section titled “Implementation of”CommonSource.offsetLocation
snippet()
Section titled “snippet()”snippet(
line): [string,boolean]
snippet returns a line from the containing policy source.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”[string, boolean]
Implementation of
Section titled “Implementation of”CommonSource.snippet