zoukankan      html  css  js  c++  java
  • StackTraceElement 源码阅读

    StackTraceElement

    • 属性说明
    /**
     *  每个 StackTraceElement 对象代表一个独立的栈帧,所有栈帧的顶部是一个方法调用
     * @since  1.4
     * @author Josh Bloch
     */
    public final class StackTraceElement implements java.io.Serializable {
        /**
         *  For Throwables and StackWalker, the VM initially sets this field to a
         *  reference to the declaring Class.  The Class reference is used to
         *  construct the 'format' bitmap, and then is cleared.
         *  For STEs constructed using the public constructors, this field is not used.
         */
        private transient Class<?> declaringClassObject;
    
        // 通常由 JVM 初始化
        /**
         *  类加载器的名称
         */
        private String classLoaderName;
        /**
         *  模块名称
         */
        private String moduleName;
        /**
         *  模块版本
         */
        private String moduleVersion;
        /**
         *  方法声明的类
         */
        private String declaringClass;
        /**
         *  方法名称
         */
        private String methodName;
        /**
         *  文件名称
         */
        private String fileName;
        /**
         *  行号
         */
        private int    lineNumber;
        private byte   format = 0; // Default to show all
    
    • 常用方法
        /**
         *  获取目标类的全限定类名
         */
        public String getClassName() {
            return declaringClass;
        }
    
        /**
         *  获取目标方法名称
         */
        public String getMethodName() {
            return methodName;
        }
    
        /**
         *  获取源文件的执行行号
         */
        public int getLineNumber() {
            return lineNumber;
        }
    
  • 相关阅读:
    2016/07/05 配置虚拟域名 三部曲
    sublime下Docblocker插件自定义配置
    掌握Thinkphp3.2.0----标签库
    掌握Thinkphp3.2.0----内置标签
    掌握Thinkphp3.2.0----模版基础
    掌握Thinkphp3.2.0----视图
    掌握Thinkphp3.2.0----自动完成
    掌握Thinkphp3.2.0----自动验证
    掌握Thinkphp3.2.0----CURD
    掌握Thinkphp3.2.0----连贯操作
  • 原文地址:https://www.cnblogs.com/zhuxudong/p/10502181.html
Copyright © 2011-2022 走看看