Name
GetMetaData
Synopsis
GetMetaData(object)
GetMetaData(THIS)Returns metadata such as properties, methods, and parameters for the
specified ColdFusion Component (CFC) when used within a CFML page.
When used within a CFC, pass GetMetaData( ) the
THIS scope, and it will return all of the metadata
for the component. Metadata is returned as a structure containing
various key/value pairs depending on the contents of the CFC. Values
in the metadata structure may contain additional nested structure.
The following outlines the minimum keys available for the various
pieces of a CFC:
- Component metadata
Name The name of the component
-
Path Absolute path to the component
-
Extends Structure containing ancestor component metadata
-
Functions Array of structures containing metadata about each function (method) in the component
- Function (method) metadata
Name Name of the function
-
Parameters Array of structures containing metadata about each argument
- Argument metadata
Name Name of the argument
- Property metadata
Name Name of the property
Additional keys may be available depending on how the CFC is coded.
For example, Function metadata may also contain keys for
Hint, ReturnType,
Output, and Access. The best
way to understand what metadata is available for a particular object
is to retrieve the metadata for it and output the results to your
browser with cfdump. Here’s an example that does
just that for the CFC Explorer component that ships with ColdFusion
MX:
<cfscript> myObj = createObject("component", ...