Package dev.relism.flash.extension
Record Class RouteEvent
java.lang.Object
java.lang.Record
dev.relism.flash.extension.RouteEvent
- Record Components:
method- HTTP method for this routepath- full path as declared (including namespace prefix for scoped routes)namespace- namespace prefix of the router that owns this route ("/"for root)routerType- simple class name of the owning router implementationhandlerClass- concrete handler class, ornullfor anonymous lambda handlersmiddlewareChain- ordered middleware classes, outermost first
public record RouteEvent(HttpMethod method, String path, String namespace, String routerType, Class<?> handlerClass, List<Class<? extends Middleware>> middlewareChain)
extends Record
Immutable snapshot of a route captured at registration time.
Emitted by FlashApp and FlashScope to every registered
RouteListener before the route is compiled into the routing engine.
All information is derived automatically — no annotations or declarations
are required from the developer.
Middleware chain
middlewareChain lists the Middleware classes outermost-first:
- Router-level middlewares (set on the router constructor)
- Annotation-injected middlewares (e.g. from
@Authenticated) - Handler-level explicit middlewares (passed inline:
app.get(path, h, mw...))
Handler abstraction chain
WalkhandlerClass upward via Class.getSuperclass() to reconstruct
the full inheritance chain (e.g. EditPostPageHandler → HtmlHandler → RequestHandler).
Read Class.getAnnotations() on each level to discover declared pointcuts
(@Authenticated, @RolesAllowed, @Route/@GET, etc.).-
Constructor Summary
ConstructorsConstructorDescriptionRouteEvent(HttpMethod method, String path, String namespace, String routerType, Class<?> handlerClass, List<Class<? extends Middleware>> middlewareChain) Creates an instance of aRouteEventrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Class<?> Returns the value of thehandlerClassrecord component.final inthashCode()Returns a hash code value for this object.method()Returns the value of themethodrecord component.List<Class<? extends Middleware>> Returns the value of themiddlewareChainrecord component.Returns the value of thenamespacerecord component.path()Returns the value of thepathrecord component.Returns the value of therouterTyperecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RouteEvent
public RouteEvent(HttpMethod method, String path, String namespace, String routerType, Class<?> handlerClass, List<Class<? extends Middleware>> middlewareChain) Creates an instance of aRouteEventrecord class.- Parameters:
method- the value for themethodrecord componentpath- the value for thepathrecord componentnamespace- the value for thenamespacerecord componentrouterType- the value for therouterTyperecord componenthandlerClass- the value for thehandlerClassrecord componentmiddlewareChain- the value for themiddlewareChainrecord 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
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). -
method
Returns the value of themethodrecord component.- Returns:
- the value of the
methodrecord component
-
path
Returns the value of thepathrecord component.- Returns:
- the value of the
pathrecord component
-
namespace
Returns the value of thenamespacerecord component.- Returns:
- the value of the
namespacerecord component
-
routerType
Returns the value of therouterTyperecord component.- Returns:
- the value of the
routerTyperecord component
-
handlerClass
Returns the value of thehandlerClassrecord component.- Returns:
- the value of the
handlerClassrecord component
-
middlewareChain
Returns the value of themiddlewareChainrecord component.- Returns:
- the value of the
middlewareChainrecord component
-