Package net.officefloor.web.rest.build
Class RestPathContextImpl
java.lang.Object
net.officefloor.web.rest.build.RestPathContextImpl
- All Implemented Interfaces:
RestPathContext
RestPathContext implementation.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConfiguration(RestConfiguration configuration) voidaddRestMethod(RestMethodContextImpl<?> method) buildRestEndpoint(WebArchitect webArchitect, OfficeArchitect officeArchitect, OfficeSourceContext sourceContext) voiddecorateRestMethods(List<RestMethodDecorator<?>> decorators) <T> TgetConfiguration(String itemName, Class<T> type) Obtains additional configuration for the REST path.Obtains the parentRestPathContext.getPath()Obtains the path.getRestPathContext(String path) booleanvoidloadRestEndpoints(Map<String, RestEndpoint> endpoints, WebArchitect webArchitect, OfficeArchitect officeArchitect, OfficeSourceContext sourceContext) protected voidvisitEndpoints(RestPathContextImpl path, Consumer<RestPathContextImpl> visitor)
-
Constructor Details
-
RestPathContextImpl
- Parameters:
path- Path.parentPath- ParentRestPathContext.
-
-
Method Details
-
getRestPathContext
- Parameters:
path- Path.- Returns:
RestPathContextImplfor the path.
-
addConfiguration
- Parameters:
configuration-RestConfiguration.
-
addRestMethod
- Parameters:
method-RestMethodContextImpl.
-
hasRestMethods
public boolean hasRestMethods()- Returns:
- Whether there are REST methods.
-
decorateRestMethods
- Parameters:
decorators-RestMethodDecoratorinstances.
-
loadRestEndpoints
public void loadRestEndpoints(Map<String, RestEndpoint> endpoints, WebArchitect webArchitect, OfficeArchitect officeArchitect, OfficeSourceContext sourceContext) - Parameters:
endpoints- Endpoints map to populate.webArchitect-WebArchitect.officeArchitect-OfficeArchitect.sourceContext-OfficeSourceContext.
-
visitEndpoints
- Parameters:
path- RootRestPathContextImpl.visitor-Consumerto visit each endpoint.
-
buildRestEndpoint
public RestEndpoint buildRestEndpoint(WebArchitect webArchitect, OfficeArchitect officeArchitect, OfficeSourceContext sourceContext) - Parameters:
webArchitect-WebArchitect.officeArchitect-OfficeArchitect.sourceContext-OfficeSourceContext.- Returns:
RestEndpoint.
-
getPath
Description copied from interface:RestPathContextObtains the path.- Specified by:
getPathin interfaceRestPathContext- Returns:
- Path.
-
getParentPath
Description copied from interface:RestPathContextObtains the parentRestPathContext.- Specified by:
getParentPathin interfaceRestPathContext- Returns:
- Parent
RestPathContextornullif root path.
-
getConfiguration
Description copied from interface:RestPathContextObtains additional configuration for the REST path.
This for example is CORS specific configuration for the REST path.
- Specified by:
getConfigurationin interfaceRestPathContext- Type Parameters:
T- Type of configuration.- Parameters:
itemName- Name of configuration item.type- Type of configuration.- Returns:
- Configuration item.
-