Package net.officefloor.web.compile
Class CompileWebContextImpl
- java.lang.Object
-
- net.officefloor.web.compile.CompileWebContextImpl
-
- All Implemented Interfaces:
CompileOfficeContext
,CompileWebContext
public class CompileWebContextImpl extends java.lang.Object implements CompileWebContext
CompileWebContext
implementation.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description CompileWebContextImpl(CompileOfficeContext officeContext, WebArchitect webArchitect)
Instantiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OfficeManagedObject
addManagedObject(java.lang.String managedObjectName, java.lang.Class<?> managedObjectClass, ManagedObjectScope scope)
Adds anOfficeManagedObject
forClassManagedObjectSource
.OfficeSection
addSection(java.lang.String sectionName, java.lang.Class<?> sectionClass)
Adds anOfficeSection
forClassSectionSource
.OfficeArchitect
getOfficeArchitect()
Obtains theOfficeArchitect
.OfficeSection
getOfficeSection()
Obtains theOfficeSection
.OfficeSourceContext
getOfficeSourceContext()
Obtains theOfficeSourceContext
.WebArchitect
getWebArchitect()
Obtains theWebArchitect
.HttpUrlContinuation
link(boolean isSecure, java.lang.String applicationPath, java.lang.Class<?> sectionClass)
Convenience method to link a URI to theservice
method of theClass
.HttpInput
link(boolean isSecure, java.lang.String httpMethodName, java.lang.String applicationPath, java.lang.Class<?> sectionClass)
Convenience method to link a URL to theservice
method of theClass
.OfficeSection
overrideSection(java.lang.Class<? extends SectionSource> sectionSourceClass, java.lang.String sectionLocation)
Overrides the defaultOfficeSection
.<T> void
variable(java.lang.String qualifier, java.lang.Class<T> type, java.util.function.Consumer<Var<T>> compileVar)
Listens to a variable.
-
-
-
Constructor Detail
-
CompileWebContextImpl
public CompileWebContextImpl(CompileOfficeContext officeContext, WebArchitect webArchitect)
Instantiate.- Parameters:
officeContext
-CompileOfficeContext
.webArchitect
-WebArchitect
.
-
-
Method Detail
-
getWebArchitect
public WebArchitect getWebArchitect()
Description copied from interface:CompileWebContext
Obtains theWebArchitect
.- Specified by:
getWebArchitect
in interfaceCompileWebContext
- Returns:
WebArchitect
.
-
getOfficeArchitect
public OfficeArchitect getOfficeArchitect()
Description copied from interface:CompileOfficeContext
Obtains theOfficeArchitect
.- Specified by:
getOfficeArchitect
in interfaceCompileOfficeContext
- Returns:
OfficeArchitect
.
-
getOfficeSourceContext
public OfficeSourceContext getOfficeSourceContext()
Description copied from interface:CompileOfficeContext
Obtains theOfficeSourceContext
.- Specified by:
getOfficeSourceContext
in interfaceCompileOfficeContext
- Returns:
OfficeSourceContext
.
-
addManagedObject
public OfficeManagedObject addManagedObject(java.lang.String managedObjectName, java.lang.Class<?> managedObjectClass, ManagedObjectScope scope)
Description copied from interface:CompileOfficeContext
Adds anOfficeManagedObject
forClassManagedObjectSource
.- Specified by:
addManagedObject
in interfaceCompileOfficeContext
- Parameters:
managedObjectName
- Name of theOfficeManagedObject
.managedObjectClass
-Class
for theClassManagedObjectSource
.scope
-ManagedObjectScope
.- Returns:
OfficeManagedObject
.
-
addSection
public OfficeSection addSection(java.lang.String sectionName, java.lang.Class<?> sectionClass)
Description copied from interface:CompileOfficeContext
Adds anOfficeSection
forClassSectionSource
.- Specified by:
addSection
in interfaceCompileOfficeContext
- Parameters:
sectionName
- Name of theOfficeSection
.sectionClass
-Class
for theClassSectionSource
.- Returns:
OfficeSection
.
-
variable
public <T> void variable(java.lang.String qualifier, java.lang.Class<T> type, java.util.function.Consumer<Var<T>> compileVar)
Description copied from interface:CompileOfficeContext
Listens to a variable.- Specified by:
variable
in interfaceCompileOfficeContext
- Type Parameters:
T
- Variable type.- Parameters:
qualifier
- Qualifier for variable. May benull
.type
- Type for variable.compileVar
- TypicalCompileVar
to handle value. May, however, be anyConsumer
for the createdVar
.
-
getOfficeSection
public OfficeSection getOfficeSection()
Description copied from interface:CompileOfficeContext
Obtains theOfficeSection
.- Specified by:
getOfficeSection
in interfaceCompileOfficeContext
- Returns:
OfficeSection
.
-
overrideSection
public OfficeSection overrideSection(java.lang.Class<? extends SectionSource> sectionSourceClass, java.lang.String sectionLocation)
Description copied from interface:CompileOfficeContext
Overrides the defaultOfficeSection
.- Specified by:
overrideSection
in interfaceCompileOfficeContext
- Parameters:
sectionSourceClass
-SectionSource
Class
.sectionLocation
- Location of theOfficeSection
.- Returns:
- Overridden
OfficeSection
.
-
link
public HttpInput link(boolean isSecure, java.lang.String httpMethodName, java.lang.String applicationPath, java.lang.Class<?> sectionClass)
Description copied from interface:CompileWebContext
Convenience method to link a URL to theservice
method of theClass
.- Specified by:
link
in interfaceCompileWebContext
- Parameters:
isSecure
- Indicates if secure.httpMethodName
- Name of theHttpMethod
.applicationPath
- Application path.sectionClass
-Class
containing aservice
method.- Returns:
HttpInput
.
-
link
public HttpUrlContinuation link(boolean isSecure, java.lang.String applicationPath, java.lang.Class<?> sectionClass)
Description copied from interface:CompileWebContext
Convenience method to link a URI to theservice
method of theClass
.- Specified by:
link
in interfaceCompileWebContext
- Parameters:
isSecure
- Indicates if secure.applicationPath
- Application path.sectionClass
-Class
containing aservice
method.- Returns:
HttpUrlContinuation
.
-
-