lucee.Componentdocbox.strategy.AbstractTemplateStrategy
Abstract base class for general templating strategies
Copyright 2015 Ortus Solutions, Corp www.ortussolutions.com
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
struct
|
functionQueryCache
The function query cache.
|
true
|
false
|
|
struct
|
propertyQueryCache
The property query cache.
|
true
|
false
|
Constructor Summary | |
---|---|
init()
Constructor. |
Method Summary | |
---|---|
query
|
buildFunctionMetaData(struct metadata)
builds a sorted query of function meta. |
struct
|
buildPackageTree(query qMetadata)
builds a data structure that shows the tree structure of the packages. |
query
|
buildPropertyMetaData(struct metadata)
builds a sorted query of property meta. |
private boolean
|
classExists(query qMetadata, string className, string package)
Whether or not the CFC class exists (does not test for primitives). |
private AbstractTemplateStrategy
|
ensureDirectory(string path)
Ensure directory. |
string
|
getFunctionQueryCache()
|
private array
|
getGenericTypes(struct meta, string package)
return an array of generic types associated with this function/argument. |
private query
|
getMetaSubQuery(query query, [string where], [string orderBy])
Query of Queries helper. |
private string
|
getObjectName(any class)
Returns the simple object name from a full class name. |
private string
|
getPackage(any class)
Get a package from an incoming class. |
private struct
|
getPropertyMeta(string name, array properties)
returns the property meta by a given name. |
string
|
getPropertyQueryCache()
|
private boolean
|
isAbstractClass(string class, string package)
is this class annotated as an abstract class?. |
private boolean
|
isPrimitive(string type)
Is the type a privite value. |
private string
|
resolveClassName(string className, string package)
Resolves a class name that may not be full qualified. |
AbstractTemplateStrategy
|
run()
Runs the strategy. |
private any
|
safeFunctionMeta(any func, struct metadata)
Sets default values on function metadata. |
private struct
|
safeParamMeta(struct param)
Sets a default meta type if not found. |
private any
|
safePropertyMeta(any property, struct metadata)
Sets default values on property metadata. |
any
|
setFunctionQueryCache(struct functionQueryCache)
|
any
|
setPropertyQueryCache(struct propertyQueryCache)
|
private boolean
|
typeExists(query qMetadata, string className, string package)
Whether a type exists at all - be it class name, or primitive type. |
private AbstractTemplateStrategy
|
visitPackageTree(struct packageTree, any startCommand, any endCommand, [struct args='[runtime expression]'])
visit each element on the package tree. |
private AbstractTemplateStrategy
|
writeTemplate(string path, string template)
Builds a template. |
Methods inherited from class lucee.Component |
---|
None |
Constructor Detail |
---|
Constructor
Property Detail |
---|
The function query cache
access
- publicrequired
- falsereturntype
- anyserializable
- trueThe property query cache
access
- publicrequired
- falsereturntype
- anyserializable
- trueMethod Detail |
---|
builds a sorted query of function meta
metadata
builds a data structure that shows the tree structure of the packages
qMetadata
builds a sorted query of property meta
metadata
Whether or not the CFC class exists (does not test for primitives)
qMetadata
- The metadata queryclassName
- The name of the classpackage
- The package the class comes fromEnsure directory
path
- The target pathreturn an array of generic types associated with this function/argument
meta
- Either function, or argument metadatapackage
- The package we are currently inQuery of Queries helper
query
- The metadata querywhere
- The where stringorderBy
- The order by stringReturns the simple object name from a full class name
class
- The name of the classGet a package from an incoming class
class
- The name of the classreturns the property meta by a given name
name
- The name of the propertyproperties
- The property metais this class annotated as an abstract class?
class
- The class namepackage
- The package we are currently inIs the type a privite value
type
- The cf typeResolves a class name that may not be full qualified
className
- The name of the classpackage
- The package the class comes fromRuns the strategy
Sets default values on function metadata
func
- The function metadatametadata
- The original metadataSets a default meta type if not found
param
- The struct metaSets default values on property metadata
property
- The property metadatametadata
- The original metadatafunctionQueryCache
propertyQueryCache
Whether a type exists at all - be it class name, or primitive type
qMetadata
- The metadata queryclassName
- The name of the classpackage
- The package the class comes fromvisit each element on the package tree
packageTree
- The package treestartCommand
- the command to call on each visitendCommand
- the command to call on each visitargs
- the extra arguments to get passed on to the visitor command (name, and fullname get passed by default)Builds a template
path
- Where to write the templatetemplate
- The template to write out