Package org.apache.juneau.commons.svl
Record Class TemplateReference
java.lang.Object
java.lang.Record
org.apache.juneau.commons.svl.TemplateReference
- Record Components:
kind- What was referenced.name- The var prefix (P for the${name} shortcut), the function name (operators are$op.* ), the identifier, or forTemplateReference.Kind.SYNTAXthe error message.bound- Whether the name resolves in the resolver the template was compiled against: a registered var, or a registered function permitted by the allowlist. Alwaystrue for identifiers.listName- For an identifier read as a row field (inside the body of a select or projection whose target is a top-level identifier), that identifier's name;null for a top-level identifier. Identifiers in a body whose target is anything else are not reported.start- Start offset, inclusive.end- End offset, exclusive.
public record TemplateReference(TemplateReference.Kind kind, String name, boolean bound, String listName, int start, int end)
extends Record
One reference found in a compiled ${...} var, a function or operator call, an
identifier, or a syntax problem.
VarTemplate: a
Offsets are into VarTemplate.getSource(): TemplateReference.Kind.IDENT
entry for its key (the text before the first top-level
References are reported for markers that are evaluated at render time. A stable var folded at compile time (and an
expression folded with it) has no entry. A
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionTemplateReference(TemplateReference.Kind kind, String name, boolean bound, String listName, int start, int end) Creates an instance of aTemplateReferencerecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbound()Returns the value of theboundrecord component.intend()Returns the value of theendrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.kind()Returns the value of thekindrecord component.listName()Returns the value of thelistNamerecord component.name()Returns the value of thenamerecord component.intstart()Returns the value of thestartrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TemplateReference
public TemplateReference(TemplateReference.Kind kind, String name, boolean bound, String listName, int start, int end) Creates an instance of aTemplateReferencerecord class.- Parameters:
kind- the value for thekindrecord componentname- the value for thenamerecord componentbound- the value for theboundrecord componentlistName- the value for thelistNamerecord componentstart- the value for thestartrecord componentend- the value for theendrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
kind
Returns the value of thekindrecord component.- Returns:
- the value of the
kindrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
bound
Returns the value of theboundrecord component.- Returns:
- the value of the
boundrecord component
-
listName
Returns the value of thelistNamerecord component.- Returns:
- the value of the
listNamerecord component
-
start
Returns the value of thestartrecord component.- Returns:
- the value of the
startrecord component
-
end
Returns the value of theendrecord component.- Returns:
- the value of the
endrecord component
-