Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trycf/3537521a10aee44677eae1de18237365 to your computer and use it in GitHub Desktop.
Save trycf/3537521a10aee44677eae1de18237365 to your computer and use it in GitHub Desktop.
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