ColdDoc 1.0

colddoc.strategy
Class AbstractTemplateStrategy

WEB-INF.cftags.component
        extended by colddoc.strategy.AbstractTemplateStrategy
Direct Known Subclasses:
HTMLAPIStrategy , XMIStrategy

public abstract class AbstractTemplateStrategy
extends WEB-INF.cftags.component

Abstract base class for general templating strategies


Constructor Summary
private init()
          Constructor
 
Method Summary
 any _dump([any s], [any abort='true'])
 any _trace([any s])
 query buildFunctionMetaData(struct metadata)
          builds a sorted query of function meta
 struct<string,struct> buildPackageTree(query qMetadata)
          builds a data structure that shows the tree structure of the packages
private boolean classExists(query qMetaData, string className, string package)
          Whether or not the CFC class exists (does not test for primitives)
private void ensureDirectory(string path)
          if a directory doesn't exist, create it
private struct<string,struct> getFunctionQueryCache()
private array<string> 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])
          returns a query on the meta query
private string getObjectName(string class)
          returns the simple object name from a full class name
 any getPackage([any class])
private struct getPropertyMeta(string name, array properties)
          returns the property meta by a given name
private boolean isAbstractClass(string class, string package)
          is this class annotated as an abstract class?
private boolean isPrimitive(string type)
          is the type a primitive value?
private void recursiveCopy(string fromDir, string toDir)
          does a recursive copy from one dir to another
private string resolveClassName(string className, string package)
          resolves a class name that may not be full qualified
 void run(query qMetadata)
          Run this strategy
private any safeFunctionMeta(any func, struct metadata)
          sets default values
private any safeParamMeta(any param)
          sets default values
private void setFunctionQueryCache(struct<string,query> functionQueryCache)
private boolean typeExists(query qMetaData, string className, string package)
          whether a type exists at all - be it class name, or primitive type
private void visitPackageTree(struct<string,struct> packageTree, any startCommand, any endCommand, [struct<string,any> args='[runtime expression]'])
          visit each element on the package tree
private void writeTemplate(string path, string template)
          builds a template
 
Methods inherited from class WEB-INF.cftags.component
 

Constructor Detail

init

private init()
Constructor

Method Detail

_dump

public any _dump([any s], [any abort='true'])

Parameters:
s
abort

_trace

public any _trace([any s])

Parameters:
s

buildFunctionMetaData

public query buildFunctionMetaData(struct metadata)
builds a sorted query of function meta

Parameters:
metadata -

buildPackageTree

public struct<string,struct> buildPackageTree(query qMetadata)
builds a data structure that shows the tree structure of the packages

Parameters:
qMetadata - the meta data query

classExists

private boolean classExists(query qMetaData, string className, string package)
Whether or not the CFC class exists (does not test for primitives)

Parameters:
qMetaData - the meta data query
className - the name of the class to check for
package - the package the class comes from

ensureDirectory

private void ensureDirectory(string path)
if a directory doesn't exist, create it

Parameters:
path -

getFunctionQueryCache

private struct<string,struct> getFunctionQueryCache()


getGenericTypes

private array<string> getGenericTypes(struct meta, string package)
return an array of generic types associated with this function/argument

Parameters:
meta - either function, or argument metadata struct
package - what package are we currently in?

getMetaSubQuery

private query getMetaSubQuery(query query, [string where], [string orderby])
returns a query on the meta query

Parameters:
query - the meta data query
where - the where string
orderby - the order by string

getObjectName

private string getObjectName(string class)
returns the simple object name from a full class name

Parameters:
class - the class name

getPackage

public any getPackage([any class])

Parameters:
class

getPropertyMeta

private struct getPropertyMeta(string name, array properties)
returns the property meta by a given name

Parameters:
name - the name of the property
properties - the property meta

isAbstractClass

private boolean isAbstractClass(string class, string package)
is this class annotated as an abstract class?

Parameters:
class - the class name
package - the package the class comes from

isPrimitive

private boolean isPrimitive(string type)
is the type a primitive value?

Parameters:
type - the cf type

recursiveCopy

private void recursiveCopy(string fromDir, string toDir)
does a recursive copy from one dir to another

Parameters:
fromDir - the input directory
toDir - the output directory

resolveClassName

private string resolveClassName(string className, string package)
resolves a class name that may not be full qualified

Parameters:
className - the name of the class
package - the package the class comes from

run

public void run(query qMetadata)
Run this strategy

Parameters:
qMetadata - the meta data query

safeFunctionMeta

private any safeFunctionMeta(any func, struct metadata)
sets default values

Parameters:
func - the function meta
metadata - the original meta data

safeParamMeta

private any safeParamMeta(any param)
sets default values

Parameters:
param - the param meta

setFunctionQueryCache

private void setFunctionQueryCache(struct<string,query> functionQueryCache)

Parameters:
functionQueryCache

typeExists

private boolean typeExists(query qMetaData, string className, string package)
whether a type exists at all - be it class name, or primitive type

Parameters:
qMetaData - the meta data query
className - the name of the class to check for
package - the package the class comes from

visitPackageTree

private void visitPackageTree(struct<string,struct> packageTree, any startCommand, any endCommand, [struct<string,any> args='[runtime expression]'])
visit each element on the package tree

Parameters:
packageTree - the package tree
startCommand - the command to call on each visit
endCommand - the command to call on each visit
args - the extra arguments to get passed on to the visitor command (name, and fullname get passed by default)

writeTemplate

private void writeTemplate(string path, string template)
builds a template

Parameters:
path - where to write the template
template - the tempalte to write out

ColdDoc 1.0