Thursday 30 January 2014

Underlying Java methods of CFML objects

G'day:
A week or so ago, I wrote an article 'Using "undocumented" methods'. This got mention on CFHour last week: "Show #206 - Mucho Happy Box", and one observation I think Scott made was that it'd be useful to know what methods were available, even if one might not necessarily want to use 'em (see the earlier article and its comments as to why one might not want to use 'em).

Anyway, ages ago I came across a handy Java class, ClassViewer, which enables one to inspect the underlying methods of CFML objects using Java reflection. I wrote an article about it "ClassViewer.java", and posted the source code. I hasten to add it is not my own work, but it is jolly handy code. I also knocked together a CFML version of it: "ClassViewer.cfc" (Gist). I've gone through a pumped a bunch of CFML objects through this, and saved the output on my CFMLDeveloper account. Here's links to 'em all:


Application
ColdFusion
Railo
OpenBD
Arguments
ColdFusion
Railo
OpenBD
Array
ColdFusion
Railo
OpenBD
Date
ColdFusion
Railo
OpenBD
DateTime
ColdFusion
Railo
OpenBD
Exception
ColdFusion
Railo
OpenBD
File
ColdFusion
Railo
OpenBD
Float
ColdFusion
Railo
OpenBD
FTP
ColdFusion
Railo
OpenBD
Image
ColdFusion
Railo
OpenBD
Integer
ColdFusion
Railo
OpenBD
Metadata
ColdFusion
Railo
OpenBD
OdbcDate
ColdFusion
Railo
OpenBD
OdbcDateTime
ColdFusion
Railo
OpenBD
PageContext
ColdFusion
Railo
OpenBD
Query
ColdFusion
Railo
OpenBD
QueryColumn
ColdFusion
Railo
OpenBD
Request
ColdFusion
Railo
OpenBD
Session
ColdFusion
Railo
OpenBD
Spreadsheet
ColdFusion
Railo
OpenBD
String
ColdFusion
Railo
OpenBD
Struct
ColdFusion
Railo
OpenBD
Variables
ColdFusion
Railo
OpenBD
XML
ColdFusion
Railo
OpenBD
(where there are no links it's because I couldn't get either Railo or OpenBD to play nice, so I didn't generate the file).

That's just the raw API output. I've got some examples of using some of these functions lying about the place, and I'll dig them out and Gist them and cross-link them. Or something.

Anyway, this is a slightly content-lite article, but I just wanted to get this stuff up and available to people. Job done.

Righto.

--
Adam