Package spark
Class FilterImpl
- java.lang.Object
-
- spark.FilterImpl
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringacceptType(package private) static java.lang.StringDEFAULT_ACCEPT_TYPEprivate Filterdelegateprivate java.lang.Stringpath
-
Constructor Summary
Constructors Modifier Constructor Description protectedFilterImpl(java.lang.String path, java.lang.String acceptType)protectedFilterImpl(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 FilterImplcreate(java.lang.String path, java.lang.String acceptType, Filter filter)Wraps the filter in FilterImpl(package private) static FilterImplcreate(java.lang.String path, Filter filter)Wraps the filter in FilterImpljava.lang.Objectdelegate()java.lang.StringgetAcceptType()java.lang.StringgetPath()Returns this route's pathabstract voidhandle(Request request, Response response)Invoked when a request is made on this filter's corresponding path e.g.FilterImplwithPrefix(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
-
-