net.officefloor.plugin.web.http.template.section
Class HttpTemplateSectionSource

java.lang.Object
  extended by net.officefloor.compile.spi.section.source.impl.AbstractSectionSource
      extended by net.officefloor.plugin.section.clazz.ClassSectionSource
          extended by net.officefloor.plugin.web.http.template.section.HttpTemplateSectionSource
All Implemented Interfaces:
SectionSourceService<ClassSectionSource>, SectionSource

public class HttpTemplateSectionSource
extends ClassSectionSource

SectionSource for the HTTP template.

Author:
Daniel Sagenschneider

Nested Class Summary
static class HttpTemplateSectionSource.NoLogicClass
           Class to use if no class specified.
 
Nested classes/interfaces inherited from class net.officefloor.compile.spi.section.source.impl.AbstractSectionSource
AbstractSectionSource.SpecificationContext
 
Field Summary
static String ON_COMPLETION_OUTPUT_NAME
          Name of the SectionOutput for flow after completion of rending the HttpTemplate.
static String OVERRIDE_SECTION_PREFIX
          Prefix on a HttpTemplateSection name to indicate it is an override section.
static String PROPERTY_CLASS_NAME
          Property name for the HttpTemplateSectionSource.NoLogicClass providing the backing logic to the template.
static String PROPERTY_INHERITED_TEMPLATES
          Property name for the comma separated list of inherited templates.
static String PROPERTY_TEMPLATE_URI
          Property name for the HttpTemplate URI path.
static String RENDER_TEMPLATE_INPUT_NAME
          Name of the SectionInput for rendering this HttpTemplate.
 
Fields inherited from class net.officefloor.plugin.section.clazz.ClassSectionSource
CLASS_OBJECT_NAME
 
Constructor Summary
HttpTemplateSectionSource()
           
 
Method Summary
protected  SectionManagedObject createClassManagedObject(String objectName, Class<?> sectionClass)
          Creates the SectionManagedObject for providing the section object.
protected  void enrichTask(SectionTask task, TaskType<?,?,?> taskType, Method method, Class<?> parameterType)
          Enriches the Task.
protected  DependencyMetaData[] extractClassManagedObjectDependencies(String objectName, Class<?> sectionClass)
          Extracts the DependencyMetaData instances for the section object.
static HttpTemplateSection[] filterCommentHttpTemplateSections(HttpTemplateSection[] sections)
          Removes the comment HttpTemplateSection instances.
protected  Class<?> getSectionClass(String sectionClassName)
          Obtains the section class.
protected  String getSectionClassName()
          Obtains the name of the class for the section.
static HttpTemplateSection[] inheritHttpTemplateSections(HttpTemplateSection[] parentSections, HttpTemplateSection[] childSections, SectionDesigner designer)
          Returns the result of inheriting the parent HttpTemplateSection instances with the child HttpTemplateSection overrides.
protected  void linkTaskFlow(TaskFlow taskFlow, TaskType<?,?,?> taskType, Class<?> flowInterfaceType, Method flowMethod, Class<?> flowArgumentType)
          Links the TaskFlow.
protected  void loadSpecification(AbstractSectionSource.SpecificationContext context)
          Loads the SectionSourceSpecification.
static String reconstructHttpTemplateContent(HttpTemplateSection[] sections)
          Reconstructs the HttpTemplate raw content from the HttpTemplateSection instances.
 void sourceSection(SectionDesigner designer, SectionSourceContext context)
          Sources the OfficeSection by constructing it via the input SectionDesigner.
 
Methods inherited from class net.officefloor.plugin.section.clazz.ClassSectionSource
getContext, getDesigner, getManagedObject, getOrCreateObject, getOrCreateOutput, getOrCreateSubSection, getSectionSourceAlias, getSectionSourceClass, getTaskByName, getTaskByTypeName, getTaskName, linkNextTask, linkTaskEscalation, linkTaskFlow, linkTaskObject, registerTaskByTypeName
 
Methods inherited from class net.officefloor.compile.spi.section.source.impl.AbstractSectionSource
getSpecification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_TEMPLATE_URI

public static final String PROPERTY_TEMPLATE_URI
Property name for the HttpTemplate URI path.

See Also:
Constant Field Values

PROPERTY_CLASS_NAME

public static final String PROPERTY_CLASS_NAME
Property name for the HttpTemplateSectionSource.NoLogicClass providing the backing logic to the template.

See Also:
Constant Field Values

PROPERTY_INHERITED_TEMPLATES

public static final String PROPERTY_INHERITED_TEMPLATES
Property name for the comma separated list of inherited templates. The order of templates listed is the order of inheritance.

See Also:
Constant Field Values

OVERRIDE_SECTION_PREFIX

public static final String OVERRIDE_SECTION_PREFIX
Prefix on a HttpTemplateSection name to indicate it is an override section.

See Also:
Constant Field Values

RENDER_TEMPLATE_INPUT_NAME

public static final String RENDER_TEMPLATE_INPUT_NAME
Name of the SectionInput for rendering this HttpTemplate.

See Also:
Constant Field Values

ON_COMPLETION_OUTPUT_NAME

public static final String ON_COMPLETION_OUTPUT_NAME
Name of the SectionOutput for flow after completion of rending the HttpTemplate.

See Also:
Constant Field Values
Constructor Detail

HttpTemplateSectionSource

public HttpTemplateSectionSource()
Method Detail

filterCommentHttpTemplateSections

public static HttpTemplateSection[] filterCommentHttpTemplateSections(HttpTemplateSection[] sections)
Removes the comment HttpTemplateSection instances.

Parameters:
sections - Listing of HttpTemplateSection instances.
Returns:
Filtered listing of HttpTemplateSection instances.

inheritHttpTemplateSections

public static HttpTemplateSection[] inheritHttpTemplateSections(HttpTemplateSection[] parentSections,
                                                                HttpTemplateSection[] childSections,
                                                                SectionDesigner designer)
Returns the result of inheriting the parent HttpTemplateSection instances with the child HttpTemplateSection overrides.

Parameters:
parentSections - Parent HttpTemplateSection instances to inherit.
childSections - Child HttpTemplateSection instances to override.
designer - SectionDesigner.
Returns:
HttpTemplateSection instances from result of inheritance.

reconstructHttpTemplateContent

public static String reconstructHttpTemplateContent(HttpTemplateSection[] sections)
Reconstructs the HttpTemplate raw content from the HttpTemplateSection instances.

Parameters:
sections - HttpTemplateSection instances.
Returns:
Raw HttpTemplate content from reconstruction from the HttpTemplateSection instances.

loadSpecification

protected void loadSpecification(AbstractSectionSource.SpecificationContext context)
Description copied from class: AbstractSectionSource
Loads the SectionSourceSpecification.

Overrides:
loadSpecification in class ClassSectionSource
Parameters:
context - AbstractSectionSource.SpecificationContext.

sourceSection

public void sourceSection(SectionDesigner designer,
                          SectionSourceContext context)
                   throws Exception
Description copied from interface: SectionSource
Sources the OfficeSection by constructing it via the input SectionDesigner.

Specified by:
sourceSection in interface SectionSource
Overrides:
sourceSection in class ClassSectionSource
Parameters:
designer - SectionDesigner to construct the structure of the OfficeSection.
context - SectionSourceContext to source details to construct the OfficeSection.
Throws:
Exception - If fails to construct the OfficeSection.

getSectionClassName

protected String getSectionClassName()
Description copied from class: ClassSectionSource
Obtains the name of the class for the section.

Overrides:
getSectionClassName in class ClassSectionSource
Returns:
Class name for the backing class of the section.

getSectionClass

protected Class<?> getSectionClass(String sectionClassName)
                            throws Exception
Description copied from class: ClassSectionSource
Obtains the section class.

Overrides:
getSectionClass in class ClassSectionSource
Parameters:
sectionClassName - Name of the section class.
Returns:
Section class.
Throws:
Exception - If fails to obtain the section class.

createClassManagedObject

protected SectionManagedObject createClassManagedObject(String objectName,
                                                        Class<?> sectionClass)
Description copied from class: ClassSectionSource
Creates the SectionManagedObject for providing the section object.

Overrides:
createClassManagedObject in class ClassSectionSource
Parameters:
objectName - Name of the object within the section.
sectionClass - Section object class.
Returns:
SectionManagedObject.

extractClassManagedObjectDependencies

protected DependencyMetaData[] extractClassManagedObjectDependencies(String objectName,
                                                                     Class<?> sectionClass)
                                                              throws Exception
Description copied from class: ClassSectionSource
Extracts the DependencyMetaData instances for the section object.

Overrides:
extractClassManagedObjectDependencies in class ClassSectionSource
Parameters:
objectName - Name of the object within the section.
sectionClass - Section object class.
Returns:
Extracted DependencyMetaData instances for the section object.
Throws:
Exception - If fails to extract the DependencyMetaData instances.

enrichTask

protected void enrichTask(SectionTask task,
                          TaskType<?,?,?> taskType,
                          Method method,
                          Class<?> parameterType)
Description copied from class: ClassSectionSource
Enriches the Task.

Overrides:
enrichTask in class ClassSectionSource
Parameters:
task - SectionTask.
taskType - TaskType for the SectionTask.
method - Method for the SectionTask.
parameterType - Parameter type for the SectionTask. May be null if no parameter.

linkTaskFlow

protected void linkTaskFlow(TaskFlow taskFlow,
                            TaskType<?,?,?> taskType,
                            Class<?> flowInterfaceType,
                            Method flowMethod,
                            Class<?> flowArgumentType)
Description copied from class: ClassSectionSource
Links the TaskFlow.

Overrides:
linkTaskFlow in class ClassSectionSource
Parameters:
taskFlow - TaskFlow.
taskType - TaskType.
flowInterfaceType - Interface type specifying the flows.
flowMethod - Method on the interface for the flow to be linked.
flowArgumentType - TaskFlow argument type. May be null if no argument.


Copyright © 2005-2013. All Rights Reserved.