M
- type representing methodsP
- type representing source code locationL
- represeting stack element
locationpublic interface GraphLocations<M,P,L>
GraphElements
- by default the elements work with classical StackTraceElement
.
Should the default behavior not be sufficient, feel free to implement the additional operations
available in this interface and register your implementation when building
the GraphOutput
instance.Modifier and Type | Method and Description |
---|---|
String |
locationLanguage(L location)
Identification of the language.
|
int |
locationLineNumber(L location)
Line number of a location.
|
int |
locationOffsetEnd(L location)
Offset of the location.
|
int |
locationOffsetStart(L location)
Offset of the location.
|
URI |
locationURI(L location)
The universal resource identification that contains the location.If the location can be found
in an assummably accessible resource, then use such resource identification.
|
Iterable<L> |
methodLocation(M method,
int bci,
P pos)
Stack trace element for a method, index and position.
|
Iterable<L> methodLocation(M method, int bci, P pos)
language
.method
- the methodbci
- the indexpos
- the positionString locationLanguage(L location)
location
- the locationURI locationURI(L location) throws URISyntaxException
file
,
http
, or https
are assumed to be accessible.
If the location is inside of a virtual source, or source which is unlikely to be accessible outside of running program, then it may be better to encode the whole source into the resource identifier. This can be done by using data URIs like:
data:text/javascript,alert('Vivat graphs!')
location
- the locationnull
if it is not knownURISyntaxException
- yielding this exception aborts the graph dumpingint locationLineNumber(L location)
GraphLocations.locationOffsetStart(java.lang.Object)
and
GraphLocations.locationOffsetEnd(java.lang.Object)
methods.location
- the locationint locationOffsetStart(L location)
line number
of a location in source. In such
case return the start offset from this method and end offset via
GraphLocations.locationOffsetEnd(java.lang.Object)
method. Offsets are counted from 0
.location
- the locationint locationOffsetEnd(L location)
line number
of a location in source. In such
case return the start offset via GraphLocations.locationOffsetStart(java.lang.Object)
method and
end from this method. Offsets are counted from 0
.location
- the location