Record Class XmlPath
java.lang.Object
java.lang.Record
io.jenkins.plugins.configsplice.engine.xml.XmlPath
A generic XML path: a chain of element steps ending in a selector (SRS section 8.7).
configuration.'system.webServer'.security.requestFiltering.requestLimits.@maxAllowedContentLength configuration.location[0].'system.webServer'.handlers.add[1].@name configuration.appSettings.add[0].#text
Note the quoting of 'system.webServer': a dot always separates steps, so an element whose
name contains one has to be quoted or it would be read as two steps.
The chain always starts at the document element, which is what distinguishes a generic path from
the DotNetPath shorthands: a path beginning appSettings. is shorthand, one beginning
configuration. is generic. That also means generic paths can reach content the shorthands
deliberately cannot, such as entries nested inside <location>.
Matching is entirely lexical. An element written xdt:add in the source is matched by the
path xdt:add and by nothing else; namespace URIs are never resolved and prefixes are never
treated as interchangeable (SRS section 8.7.2 rule 2).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record.@name— the value of that attribute on the resolved element.static final recordOne element step.static interfaceWhat the path finally targets: an attribute value or the element's text.static final record.#text— the element's own text content. -
Constructor Summary
ConstructorsConstructorDescriptionXmlPath(List<XmlPath.Element> elements, XmlPath.Selector selector) Creates an instance of aXmlPathrecord class. -
Method Summary
Modifier and TypeMethodDescriptionRenders the path back into source form.elements()Returns the value of theelementsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.selector()Returns the value of theselectorrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
XmlPath
Creates an instance of aXmlPathrecord class.- Parameters:
elements- the value for theelementsrecord componentselector- the value for theselectorrecord component
-
-
Method Details
-
canonical
Renders the path back into source form. Used in diagnostics; never contains a value. -
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
public final int 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. All components in this record class are compared withObjects::equals(Object,Object). -
elements
Returns the value of theelementsrecord component.- Returns:
- the value of the
elementsrecord component
-
selector
Returns the value of theselectorrecord component.- Returns:
- the value of the
selectorrecord component
-