Package net.officefloor.woof.template
Class WoofTemplateExtensionLoaderUtil
- java.lang.Object
-
- net.officefloor.woof.template.WoofTemplateExtensionLoaderUtil
-
public class WoofTemplateExtensionLoaderUtil extends java.lang.Object
Utility functions for testing aWoofTemplateExtensionSource
implementation.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SourceProperties
createSourceProperties(java.lang.String... propertyNameValues)
Creates theSourceProperties
.static <S extends WoofTemplateExtensionSource>
voidextendTemplate(java.lang.Class<S> extensionSourceClass, java.lang.String templatePath, WebTemplate template, OfficeArchitect officeArchitect, WebArchitect webArchitect, java.lang.ClassLoader classLoader, ResourceSource[] resourceSources, java.lang.String... propertyNameValues)
Undertakes the extending of theWebTemplate
by theWoofTemplateExtensionSource
.static <S extends WoofTemplateExtensionSource>
voidextendTemplate(java.lang.Class<S> extensionSourceClass, java.lang.String applicationPath, WebTemplate template, OfficeArchitect officeArchitect, WebArchitect webArchitect, java.lang.String... propertyNameValues)
Undertakes the extending of theWebTemplate
by theWoofTemplateExtensionSource
.static WoofChangeIssues
getWoofChangeIssues()
Obtains theWoofChangeIssues
.static <S extends WoofTemplateExtensionSource>
Change<?>refactorTemplateExtension(java.lang.Class<S> woofTemplateExtensionSourceClass, java.lang.String oldUri, SourceProperties oldProperties, java.lang.String newUri, SourceProperties newProperties)
Creates theChange
for refactoring.static <S extends WoofTemplateExtensionSource>
Change<?>refactorTemplateExtension(java.lang.Class<S> woofTemplateExtensionSourceClass, java.lang.String oldUri, SourceProperties oldProperties, java.lang.String newUri, SourceProperties newProperties, ConfigurationContext configurationContext, java.lang.ClassLoader classLoader, ResourceSource... resourceSources)
Creates theChange
for refactoring.static void
validateConfigurationItem(ConfigurationContext context, java.lang.String location, java.io.Reader content)
Convenience method to validate theConfigurationItem
.static void
validateConfigurationItem(ConfigurationContext context, java.lang.String location, java.lang.String content)
Convenience method to validate theConfigurationItem
.static <S extends WoofTemplateExtensionSource>
PropertyListvalidateSpecification(java.lang.Class<S> woofTemplateExtensionSourceClass, java.lang.ClassLoader classLoader, java.lang.String... propertyNameLabels)
Validates theWoofTemplateExtensionSourceSpecification
for theWoofTemplateExtensionSource
.static <S extends WoofTemplateExtensionSource>
PropertyListvalidateSpecification(java.lang.Class<S> woofTemplateExtensionSourceClass, java.lang.String... propertyNameLabels)
Validates theWoofTemplateExtensionSourceSpecification
for theWoofTemplateExtensionSource
.
-
-
-
Method Detail
-
validateSpecification
public static <S extends WoofTemplateExtensionSource> PropertyList validateSpecification(java.lang.Class<S> woofTemplateExtensionSourceClass, java.lang.String... propertyNameLabels)
Validates theWoofTemplateExtensionSourceSpecification
for theWoofTemplateExtensionSource
.- Type Parameters:
S
-WoofTemplateExtensionSource
type.- Parameters:
woofTemplateExtensionSourceClass
-WoofTemplateExtensionSource
class.propertyNameLabels
- Listing of name/label pairs for theProperty
instances.- Returns:
- Loaded
PropertyList
.
-
validateSpecification
public static <S extends WoofTemplateExtensionSource> PropertyList validateSpecification(java.lang.Class<S> woofTemplateExtensionSourceClass, java.lang.ClassLoader classLoader, java.lang.String... propertyNameLabels)
Validates theWoofTemplateExtensionSourceSpecification
for theWoofTemplateExtensionSource
.- Type Parameters:
S
-WoofTemplateExtensionSource
type.- Parameters:
woofTemplateExtensionSourceClass
-WoofTemplateExtensionSource
class.classLoader
-ClassLoader
. May benull
.propertyNameLabels
- Listing of name/label pairs for theProperty
instances.- Returns:
- Loaded
PropertyList
.
-
createSourceProperties
public static SourceProperties createSourceProperties(java.lang.String... propertyNameValues)
Creates theSourceProperties
.- Parameters:
propertyNameValues
- Property name/value pairs.- Returns:
SourceProperties
.
-
getWoofChangeIssues
public static WoofChangeIssues getWoofChangeIssues()
Obtains theWoofChangeIssues
.- Returns:
WoofChangeIssues
.
-
refactorTemplateExtension
public static <S extends WoofTemplateExtensionSource> Change<?> refactorTemplateExtension(java.lang.Class<S> woofTemplateExtensionSourceClass, java.lang.String oldUri, SourceProperties oldProperties, java.lang.String newUri, SourceProperties newProperties)
Creates theChange
for refactoring.- Type Parameters:
S
-WoofTemplateExtensionSource
type.- Parameters:
woofTemplateExtensionSourceClass
-WoofTemplateExtensionSource
class.oldUri
- Old URI.oldProperties
- OldSourceProperties
.newUri
- New URI.newProperties
- NewSourceProperties
.- Returns:
Change
for refactoring. May benull
.
-
refactorTemplateExtension
public static <S extends WoofTemplateExtensionSource> Change<?> refactorTemplateExtension(java.lang.Class<S> woofTemplateExtensionSourceClass, java.lang.String oldUri, SourceProperties oldProperties, java.lang.String newUri, SourceProperties newProperties, ConfigurationContext configurationContext, java.lang.ClassLoader classLoader, ResourceSource... resourceSources)
Creates theChange
for refactoring.- Type Parameters:
S
-WoofTemplateExtensionSource
type.- Parameters:
woofTemplateExtensionSourceClass
-WoofTemplateExtensionSource
class.oldUri
- Old URI.oldProperties
- OldSourceProperties
.newUri
- New URI.newProperties
- NewSourceProperties
.configurationContext
-ConfigurationContext
. May benull
.classLoader
-ClassLoader
.resourceSources
-ResourceSource
instances.- Returns:
Change
for refactoring. May benull
.
-
validateConfigurationItem
public static void validateConfigurationItem(ConfigurationContext context, java.lang.String location, java.lang.String content) throws java.lang.Exception
Convenience method to validate theConfigurationItem
.- Parameters:
context
-ConfigurationContext
.location
- Location of theConfigurationItem
.content
- Expected content of theConfigurationItem
. May benull
to indicate no expectingConfigurationItem
.- Throws:
java.lang.Exception
- If failure in accessingConfigurationItem
.
-
validateConfigurationItem
public static void validateConfigurationItem(ConfigurationContext context, java.lang.String location, java.io.Reader content) throws java.lang.Exception
Convenience method to validate theConfigurationItem
.- Parameters:
context
-ConfigurationContext
.location
- Location of theConfigurationItem
.content
- Expected content of theConfigurationItem
. May benull
to indicate no expectingConfigurationItem
.- Throws:
java.lang.Exception
- If fails accessing theConfigurationItem
.
-
extendTemplate
public static <S extends WoofTemplateExtensionSource> void extendTemplate(java.lang.Class<S> extensionSourceClass, java.lang.String applicationPath, WebTemplate template, OfficeArchitect officeArchitect, WebArchitect webArchitect, java.lang.String... propertyNameValues) throws java.lang.Exception
Undertakes the extending of theWebTemplate
by theWoofTemplateExtensionSource
.- Type Parameters:
S
-WoofTemplateExtensionSource
type.- Parameters:
extensionSourceClass
-WoofTemplateExtensionSource
class.applicationPath
- Application path to theWebTemplate
.template
-WebTemplate
.officeArchitect
-OfficeArchitect
.webArchitect
-WebArchitect
.propertyNameValues
-Property
name/value pairs.- Throws:
java.lang.Exception
- If fails to extendWebTemplate
.
-
extendTemplate
public static <S extends WoofTemplateExtensionSource> void extendTemplate(java.lang.Class<S> extensionSourceClass, java.lang.String templatePath, WebTemplate template, OfficeArchitect officeArchitect, WebArchitect webArchitect, java.lang.ClassLoader classLoader, ResourceSource[] resourceSources, java.lang.String... propertyNameValues) throws java.lang.Exception
Undertakes the extending of theWebTemplate
by theWoofTemplateExtensionSource
.- Type Parameters:
S
-WoofTemplateExtensionSource
type.- Parameters:
extensionSourceClass
-WoofTemplateExtensionSource
class.templatePath
- URL path to theWebTemplate
.template
-WebTemplate
.officeArchitect
-OfficeArchitect
.webArchitect
-WebArchitect
.classLoader
-ClassLoader
. May benull
.resourceSources
-ResourceSource
instances. May benull
.propertyNameValues
-Property
name/value pairs.- Throws:
java.lang.Exception
- If fails to extendWebTemplate
.
-
-