Package spark
Class FilterImpl
- java.lang.Object
-
- spark.FilterImpl
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
acceptType
(package private) static java.lang.String
DEFAULT_ACCEPT_TYPE
private Filter
delegate
private java.lang.String
path
-
Constructor Summary
Constructors Modifier Constructor Description protected
FilterImpl(java.lang.String path, java.lang.String acceptType)
protected
FilterImpl(java.lang.String path, java.lang.String acceptType, Filter filter)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) static FilterImpl
create(java.lang.String path, java.lang.String acceptType, Filter filter)
Wraps the filter in FilterImpl(package private) static FilterImpl
create(java.lang.String path, Filter filter)
Wraps the filter in FilterImpljava.lang.Object
delegate()
java.lang.String
getAcceptType()
java.lang.String
getPath()
Returns this route's pathabstract void
handle(Request request, Response response)
Invoked when a request is made on this filter's corresponding path e.g.FilterImpl
withPrefix(java.lang.String prefix)
Prefix the path (used forService.path(java.lang.String, spark.RouteGroup)
)
-
-
-
Field Detail
-
DEFAULT_ACCEPT_TYPE
static final java.lang.String DEFAULT_ACCEPT_TYPE
- See Also:
- Constant Field Values
-
path
private java.lang.String path
-
acceptType
private java.lang.String acceptType
-
delegate
private Filter delegate
-
-
Constructor Detail
-
FilterImpl
protected FilterImpl(java.lang.String path, java.lang.String acceptType)
-
FilterImpl
protected FilterImpl(java.lang.String path, java.lang.String acceptType, Filter filter)
-
-
Method Detail
-
withPrefix
public FilterImpl withPrefix(java.lang.String prefix)
Prefix the path (used forService.path(java.lang.String, spark.RouteGroup)
)- Parameters:
prefix
- the prefix- Returns:
- itself for easy chaining
-
create
static FilterImpl create(java.lang.String path, Filter filter)
Wraps the filter in FilterImpl- Parameters:
path
- the pathfilter
- the filter- Returns:
- the wrapped route
-
create
static FilterImpl create(java.lang.String path, java.lang.String acceptType, Filter filter)
Wraps the filter in FilterImpl- Parameters:
path
- the pathacceptType
- the accept typefilter
- the filter- Returns:
- the wrapped route
-
handle
public abstract void handle(Request request, Response response) throws java.lang.Exception
Invoked when a request is made on this filter's corresponding path e.g. '/hello'
-
getAcceptType
public java.lang.String getAcceptType()
-
getPath
public java.lang.String getPath()
Returns this route's path
-
-