Package net.officefloor.web
Class HttpRouteSectionSource
java.lang.Object
net.officefloor.compile.spi.section.source.impl.AbstractSectionSource
net.officefloor.web.HttpRouteSectionSource
- All Implemented Interfaces:
SectionSource
SectionSource to handle HTTP routing.- Author:
- Daniel Sagenschneider
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classObtains the interception details.static classRedirect.static classRoute input information.Nested classes/interfaces inherited from class net.officefloor.compile.spi.section.source.impl.AbstractSectionSource
AbstractSectionSource.SpecificationContext -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName ofSectionInputfor not found resource.static final StringName ofSectionOutputfor unhandledHttpRequest. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddRedirect(boolean isSecure, HttpRouteSectionSource.RouteInput routeInput, Class<?> parameterType) Adds aHttpRouteSectionSource.Redirect.addRoute(boolean isSecure, HttpMethod method, String path) Adds a route.Obtains theHttpRouteSectionSource.Interception.booleanisPathParameters(String path) Indicates if the path contains parameters.protected voidLoads theSectionSourceSpecification.voidsetHttpEscalationHandler(HttpEscalationHandler escalationHandler) Specifies theHttpEscalationHandlervoidsourceSection(SectionDesigner designer, SectionSourceContext context) Sources theOfficeSectionby constructing it via the inputSectionDesigner.Methods inherited from class net.officefloor.compile.spi.section.source.impl.AbstractSectionSource
getSpecification
-
Field Details
-
UNHANDLED_OUTPUT_NAME
Name ofSectionOutputfor unhandledHttpRequest.- See Also:
-
NOT_FOUND_INPUT_NAME
Name ofSectionInputfor not found resource.- See Also:
-
-
Constructor Details
-
HttpRouteSectionSource
Instantiate.- Parameters:
contextPath- Context path. May benull.
-
-
Method Details
-
setHttpEscalationHandler
Specifies theHttpEscalationHandler- Parameters:
escalationHandler-HttpEscalationHandler. May benull.
-
getInterception
Obtains theHttpRouteSectionSource.Interception.- Returns:
HttpRouteSectionSource.Interception.
-
isPathParameters
Indicates if the path contains parameters.- Parameters:
path- Path.- Returns:
trueshould the path contain parameters.
-
addRoute
Adds a route.- Parameters:
isSecure- Indicates if a secure connection is required for the route.method-HttpMethod.path- Route path.- Returns:
HttpRouteSectionSource.RouteInputfor the route.
-
addRedirect
public HttpRouteSectionSource.Redirect addRedirect(boolean isSecure, HttpRouteSectionSource.RouteInput routeInput, Class<?> parameterType) throws Exception Adds aHttpRouteSectionSource.Redirect.- Parameters:
isSecure- Indicates to redirect to a secure port.routeInput-HttpRouteSectionSource.RouteInputto redirect to.parameterType- Type of parameter passed to the redirectManagedFunctionto source values for constructing the path. May benull.- Returns:
HttpRouteSectionSource.Redirect.- Throws:
Exception- If fails to add the redirect.
-
loadSpecification
Description copied from class:AbstractSectionSourceLoads theSectionSourceSpecification.- Specified by:
loadSpecificationin classAbstractSectionSource- Parameters:
context-AbstractSectionSource.SpecificationContext.
-
sourceSection
Description copied from interface:SectionSourceSources theOfficeSectionby constructing it via the inputSectionDesigner.- Parameters:
designer-SectionDesignerto construct the structure of theOfficeSection.context-SectionSourceContextto source details to construct theOfficeSection.- Throws:
Exception- If fails to construct theOfficeSection.
-