Record Class ResolverContext
java.lang.Object
java.lang.Record
dev.jcputney.mjml.ResolverContext
- Record Components:
includingPath- the path of the file that contains the mj-include, or null for the root documentincludeType- the include type (e.g. "mjml", "html", "css", "css-inline")depth- the current nesting depth (0 for top-level includes)
Context information passed to
IncludeResolver when resolving includes. Provides metadata
about the include chain: which file is doing the including, what type of include it is, and how
deep in the include chain we are.-
Constructor Summary
ConstructorsConstructorDescriptionResolverContext(String includingPath, String includeType, int depth) Creates an instance of aResolverContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintdepth()Returns the value of thedepthrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theincludeTyperecord component.Returns the value of theincludingPathrecord component.Creates a nested context for includes within included files.static ResolverContextCreates a root context for top-level includes.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ResolverContext
Creates an instance of aResolverContextrecord class.- Parameters:
includingPath- the value for theincludingPathrecord componentincludeType- the value for theincludeTyperecord componentdepth- the value for thedepthrecord component
-
-
Method Details
-
root
Creates a root context for top-level includes.- Parameters:
includeType- the include type- Returns:
- a new context with null includingPath and depth 0
-
nested
Creates a nested context for includes within included files.- Parameters:
newIncludingPath- the path of the file that contains the nested include- Returns:
- a new context with incremented depth
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
includingPath
Returns the value of theincludingPathrecord component.- Returns:
- the value of the
includingPathrecord component
-
includeType
Returns the value of theincludeTyperecord component.- Returns:
- the value of the
includeTyperecord component
-
depth
-