Package net.officefloor.web
Class HttpInputPathImpl
- java.lang.Object
-
- net.officefloor.web.HttpInputPathImpl
-
- All Implemented Interfaces:
HttpInputPath
public class HttpInputPathImpl extends java.lang.Object implements HttpInputPath
HttpInputPath
implementation.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description HttpInputPathImpl(java.lang.String routePath, HttpInputPathSegment segmentHead, int parameterCount)
Instantiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> HttpPathFactory<T>
createHttpPathFactory(java.lang.Class<T> valuesType)
Creates theHttpPathFactory
.boolean
isMatchPath(java.lang.String path, int endingPathParameterTerminatingCharacter)
Indicates if the path matches theHttpInput
path.boolean
isPathParameters()
================ HttpInputPath =======================
-
-
-
Constructor Detail
-
HttpInputPathImpl
public HttpInputPathImpl(java.lang.String routePath, HttpInputPathSegment segmentHead, int parameterCount)
Instantiate.- Parameters:
routePath
- Route path.segmentHead
- HeadHttpInputPathSegment
of linked list ofHttpInputPathSegment
instances.parameterCount
- Number of path parameters for sorting routes.
-
-
Method Detail
-
isPathParameters
public boolean isPathParameters()
================ HttpInputPath =======================- Specified by:
isPathParameters
in interfaceHttpInputPath
- Returns:
true
if the path contains parameters.
-
isMatchPath
public boolean isMatchPath(java.lang.String path, int endingPathParameterTerminatingCharacter)
Description copied from interface:HttpInputPath
Indicates if the path matches theHttpInput
path.- Specified by:
isMatchPath
in interfaceHttpInputPath
- Parameters:
path
- Path.endingPathParameterTerminatingCharacter
-Character
value for theCharacter
that terminates the ending path parameter. This is ignored if the last part of the path is static (i.e. only applies for last parameter to know when it terminates the path, e.g./path/{last}
). Should the last parameter consume the remainder of the path, provide-1
to indicate no terminatingCharacter
.- Returns:
true
if the path matches theHttpInput
path.
-
createHttpPathFactory
public <T> HttpPathFactory<T> createHttpPathFactory(java.lang.Class<T> valuesType) throws HttpException
Description copied from interface:HttpInputPath
Creates theHttpPathFactory
.- Specified by:
createHttpPathFactory
in interfaceHttpInputPath
- Type Parameters:
T
- Value type.- Parameters:
valuesType
- Type to use for obtaining values to construct the path. Should the path not contain parameters, it may benull
.- Returns:
HttpPathFactory
.- Throws:
HttpException
- If required path parameters are not available on the values type.
-
-