OutputFolderNode
The standard "outputFolderNode" that is passed to all generators is an OutputFolderNode object with the following properties and methods. Use this object to build out your output tree.
Read-only Properties
- type: returns a NodeType constant
- path: returns the path to this resource (relative to the root folder the generator is working with)
- childNodes: returns an array of OutputFolderNodes and OutputFileNodes that comprise this node's children
Methods
addFile(fileNode, conflictPolicy)
Returns the OutputFileNode that is added to the tree for the corresponding InputFileNode fileNode. The path to the file (and the file's name) will be the same as in the input tree.
conflictPolicy is optional and should be a ConflictPolicy constant; defaults to CancelOnConflict
.
addFileAtPath(fileNode, path, conflictPolicy)
Returns the OutputFileNode that is added to the tree for the corresponding InputFileNode fileNode.
If any segments of path do not exist, they will be created. Note that the final entry in the path string must be the desired filename (including file extension).
conflictPolicy is optional and should be a ConflictPolicy constant; defaults to CancelOnConflict
.
addFolder(folderNode, conflictPolicy)
Returns the OutputFolderNode that is added to the tree for the corresponding InputFolderNode folderNode. The path to the folder (and the folder's name) will be the same as in the input tree.
conflictPolicy is optional and should be a ConflictPolicy constant; defaults to CancelOnConflict
.
addFolderAtPath(folderNode, path, conflictPolicy)
Returns the OutputFolderNode that is added to the tree for the corresponding InputFolderNode folderNode.
If any segments of path do not exist, they will be created. The final segment should be the name you want to use for the folderNode you are copying from the input tree.
conflictPolicy is optional and should be a ConflictPolicy constant; defaults to CancelOnConflict
.
excludeNode(node)
Returns true
or false
; whether the InputFileNode or InputFolderNode was successfully excluded or not.
fileForPath(path)
Returns an OutputFileNode representing the file at path (relative to the current OutputFolderNode). If no such path exists, returns null
.
folderForPath(path)
Returns an OutputFolderNode representing the folder at path. If no such path exists, returns null
.