Created
May 3, 2018 20:42
-
-
Save trycf/3537521a10aee44677eae1de18237365 to your computer and use it in GitHub Desktop.
TryCF Gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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