For the complete experience, please enable JavaScript in your browser. Thank you!

  • Creative Cloud
  • Photoshop
  • Illustrator
  • InDesign
  • Premiere Pro
  • After Effects
  • Lightroom
  • See all
  • See plans for: businesses photographers students
  • Document Cloud
  • Acrobat DC
  • eSign
  • Stock
  • Elements
  • Marketing Cloud
  • Analytics
  • Audience Manager
  • Campaign
  • Experience Manager
  • Media Optimizer
  • Target
  • See all
  • Acrobat Reader DC
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player
  • All products
  • Creative Cloud
  • Individuals
  • Photographers
  • Students and Teachers
  • Business
  • Schools and Universities
  • Marketing Cloud
  • Document Cloud
  • Stock
  • Elements
  • All products
  • Get Support
    Find answers quickly. Contact us if you need to.
    Start now >
  • Learn the apps
    Get started or learn new ways to work.
    Learn now >
  • Ask the community
    Post questions and get answers from experts.
    Start now >
    • About Us
    • Careers At Adobe
    • Investor Relations
    • Privacy  |  Security
    • Corporate Responsibility
    • Customer Showcase
    • Events
    • Contact Us
News
    • 3/22/2016
      Adobe Summit 2016: Are You An Experience Business?
    • 3/22/2016
      Adobe Announces Cross-Device Co-op to Enable People-Based Marketing
    • 3/22/2016
      Adobe and comScore Advance Digital TV and Ad Measurement
    • 3/22/2016
      Adobe Marketing Cloud Redefines TV Experience
CFML Reference / 

GetMetaData

Adobe Community Help


Contact support

 
By clicking Submit, you accept the Adobe Terms of Use.
 

Description

Gets metadata (such as the methods, properties, and parameters of a component) associated with an object that is deployed on the ColdFusion server.

Returns

Structured metadata information: for ColdFusion components (CFCs) and user-defined functions (UDFs), a structure; for query objects, an array of structures.

Category

System functions

Function syntax

GetMetaData(object)

See also

CreateObject, GetComponentMetaData, QueryAddColumn, QueryNew

History

ColdFusion MX 7: Added support for getting query object metadata.
ColdFusion MX: Added this function.

Parameters

Parameter

Description

object

A ColdFusion component, user-defined function, or query object. Within a CFC, the parameter can also specify the This scope.

Usage

This function provides information about application data, and lets applications dynamically determine the structure of an object and how to use it. This function is useful for CFCs and query objects. The metadata for a CFC includes information on the component and its functions, arguments, and properties. The getMetaData function also returns metadata for user-defined functions that are not part of CFCs. Use the GetComponentMetaData function to get information about ColdFusion interfaces, or about CFC definitions that you have not instantiated.The following table lists the data returned by the function for supported object types:

Object

Field

Description

Component

A structure containing the following fields:

displayname

Value of the cfcomponent tag displayname attribute, if any.

extends

Metadata for the component’s ancestor component. Components that do not explicitly extend another component extend the WEB-INF.cftags.component.

 

fullname

The dot delimited path from the cf_webroot of the component.

 

functions

Array of metadata structures for the component’s functions.

 

hint

Value of the cfcomponent tag displayname attribute, if any.

 

implements

A structure containing the metadata of the interfaces that the component implements. The key of the structure is the interface name, and the value is a structure containing the interface metadata.

 

name

Component name, including the period-delimited path from a component search root such as the web root or a directory specified in the administrator Custom Tag Paths page.

 

output

Value of the cfcomponent tag output attribute, if any

 

path

Absolute path to the component.

 

properties

Array of structures containing metadata specified by the component’s cfproperty tags, if any.

 

type

Always, component.

 

userMetadata

User-specified attributes in the cfcomponent tag

 

function

A structure containing the following fields.

access

Value of the cffunction tag access attribute, if any.

displayname

Value of the cffunction tag displayname attribute, if any.

 

hint

Value of the cffunction tag hint attribute, if any.

 

name

Function name.

 

output

Value of the cffunction tag output attribute, if any.

 

parameters

Array of structures containing metadata for the function parameters.

 

returnformat

The format in which to return values to a remote caller. This attribute has no effect on values returned to a local caller.

 

returntype

Value of the cffunction tag returntype attribute, if any.

 

roles

Value of the cffunction tag output attribute, if any.

 

userMetadata

User-specified attributes in the cffunction tag.

 

Parameter or Property

A structure containing the following fields:

default

Value of the cfargument or cfproperty tag default attribute, if any.

displayname

Value of the cfargument or cfproperty tag displayname attribute, if any.

 

hint

Value of the cfargument or cfproperty tag hint attribute, if any.

 

name

Function parameter or CFC property name.

 

required

Value of the cfargument or cfproperty tag required attribute, if any.

 

type

Value of the cfargument or cfproperty tag type attribute, if any.

 

userMetadata

User-specified attributes in the argument tag.

 

Query

An array of structures containing the following elements:

IsCaseSensitive

Boolean value indicating whether character data must be case correct.

name

The column name.

 

TypeName

The SQL data type (Omitted if the query object is created with QueryNew without specifying types.)

 

 

Note: Use the This scope to access component metadata inside the CFC. The This scope is available at runtime in the component body and in the CFC methods. It is used to read and write variables that are present during the life of the component.

For more information, see Using introspection to get information about components in the Developing ColdFusion Applications.

Example

The following example uses the cfdump tag to display metadata for the utilities CFC that is used by the ColdFusion component browser. It also displays the names and data types of the fields in the cfdocexamples database Employees table.

<!--- Create an instance of the Component Explorer utilities CFC.
and get its metadata --->
<cfscript>
componentutils = createObject("component", "cfide.componentutils.utils");
utilmetadata = getMetaData(componentutils);
</cfscript>

<h4>Metadata for the CFC component utilities</h4>
<cfdump var="#utilmetadata#">

<!--- use GetMetadata to get the names and data types of the fields in the
cfdocexamples Employees table --->
<cfquery name="getemployees" datasource="cfdocexamples">
SELECT *
FROM Employees
</cfquery>
<cfset employeemeta=getMetaData(getemployees)>

<h4>The Employees table has the following columns</h4>
<cfloop index="i" from="1" to="#arrayLen(employeemeta)#">
<cfoutput>
#employeemeta[i].name# #employeemeta[i].TypeName# #employeemeta[i].isCaseSensitive#<br>
</cfoutput>
</cfloop>

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy

Choose your region United States (Change)   Products   Downloads   Learn & Support   Company
Choose your region Close

Americas

Europe, Middle East and Africa

Asia Pacific

  • Brasil
  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Cyprus - English
  • Česká republika
  • Danmark
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Greece - English
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • Malta - English
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • Southeast Asia (Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam) - English
  • 台灣

Commonwealth of Independent States

  • Includes Armenia, Azerbaijan, Belarus, Georgia, Moldova, Kazakhstan, Kyrgyzstan, Tajikistan, Turkmenistan, Ukraine, Uzbekistan

Copyright © 2016 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy | Cookies

AdChoices