Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
TryCF Gist
<cfscript>
/**
* returns an array with the class hierarchy of the object
*/
function getClassHierarchy(object){
var hierarchy = [];
var class = object.getClass();
while (!isNull(class)){
hierarchy.append(class.getName());
class = class.getSuperClass();
}
return hierarchy;
}
hierarchy = getClassHierarchy(getPageContext());
numClasses = hierarchy.len();
for (i=numClasses; i>0; i--){
class = hierarchy[i];
writeOutput('<div style="padding-left: #numClasses - i#em; #class == 'javax.servlet.jsp.PageContext' ? 'font-weight: bold;' : ''#">#class#</div>');
}
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment