Package com.spec.web.expresso.middleware
Class MiddlewareMetaData
java.lang.Object
com.spec.web.expresso.middleware.MiddlewareMetaData
- Direct Known Subclasses:
StaticFileServer,StaticResourceServer
Represents the metadata for a middleware.
-
Constructor Summary
ConstructorsConstructorDescriptionMiddlewareMetaData(Middleware middleware, String method) Instantaiats the classMiddlewareMetaData(Middleware middleware, String path, String method) Instantaiats the class -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPrefixPath(String prefixPath) Prepends a path to the current pathvoidappendPath(String path) Sets a path for the current middlewarevoidcalcPath()Sets the path that has been calculated by the string buildercopy()Creates a copy of the current MiddewareMetaData instanceReturns the method on which the middleware is registerd on.Returns the middleware which is registerd on it.getPath()Returns the path on which the middleware metadata is registered on.voidSets the method on which the middleware should executevoidSets the pathtoString()
-
Constructor Details
-
MiddlewareMetaData
Instantaiats the class- Parameters:
middleware- The middleware on which the metadata should be created.method- The method on which the middleware should be registered.
-
MiddlewareMetaData
Instantaiats the class- Parameters:
middleware- The middleware on which the metadata should be created.path- The path on which the middleware should be registered.method- The method on which the middleware should be registered.
-
-
Method Details
-
getMethod
Returns the method on which the middleware is registerd on.- Returns:
- Method name
-
getMiddleware
Returns the middleware which is registerd on it.- Returns:
- Instance of middleware.
-
appendPath
Sets a path for the current middleware- Parameters:
path- the path which should be appended to the current path.
-
addPrefixPath
Prepends a path to the current path- Parameters:
prefixPath- the path which should be prepended.
-
setMethod
Sets the method on which the middleware should execute- Parameters:
method- the HTTP method on which the metadata should be registered.
-
calcPath
public void calcPath()Sets the path that has been calculated by the string builder -
copy
Creates a copy of the current MiddewareMetaData instance- Returns:
- the copy of the current class
-
toString
-
setPath
Sets the path- Parameters:
pathString- The string containing the path.
-
getPath
Returns the path on which the middleware metadata is registered on.- Returns:
- path.
-