java.lang.SecurityManager.getClassContext()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(162)

本文整理了Java中java.lang.SecurityManager.getClassContext()方法的一些代码示例,展示了SecurityManager.getClassContext()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SecurityManager.getClassContext()方法的具体详情如下:
包路径:java.lang.SecurityManager
类名称:SecurityManager
方法名:getClassContext

SecurityManager.getClassContext介绍

[英]Returns the current execution stack as an array of classes.

The length of the array is the number of methods on the execution stack. The element at index 0 is the class of the currently executing method, the element at index 1 is the class of that method's caller, and so on.
[中]以类数组的形式返回当前执行堆栈。
数组的长度是执行堆栈上的方法数。索引0处的元素是当前正在执行的方法的类,索引1处的元素是该方法的调用方的类,依此类推。

代码示例

代码示例来源:origin: redisson/redisson

protected Class<?>[] getClassContext() {
    return super.getClassContext();
  }
}

代码示例来源:origin: bytedeco/javacpp

@Override public Class[] getClassContext() {
    return super.getClassContext();
  }
}.getClassContext();

代码示例来源:origin: org.apache.logging.log4j/log4j-api

@Override
protected Class<?>[] getClassContext() {
  return super.getClassContext();
}

代码示例来源:origin: wildfly/wildfly

protected Class<?>[] getClassContext() {
    return super.getClassContext();
  }
}

代码示例来源:origin: wildfly/wildfly

protected Class[] getClassContext() {
    return super.getClassContext();
  }
}

代码示例来源:origin: org.codehaus.groovy/groovy

@Override
  public Class[] getClassContext() {
    return super.getClassContext();
  }
}

代码示例来源:origin: oracle/helidon

/**
   * Get class context (class stack).
   *
   * @return classes on the stack
   */
  public Class<?>[] getClassContext0() {
    return super.getClassContext();
  }
}

代码示例来源:origin: stackoverflow.com

return getClassContext()[callStackDepth].getName();

代码示例来源:origin: net.java.dev.jna/jna

@Override
  public Class<?>[] getClassContext() {
    return super.getClassContext();
  }
}.getClassContext();

代码示例来源:origin: linkedin/indextank-engine

@Override
  public Class<?>[] getClassContext() {
    return super.getClassContext();
  }
}

代码示例来源:origin: stackoverflow.com

public static class CurrentClassGetter extends SecurityManager {
  public String getClassName() {
    return getClassContext()[1].getName(); 
  }
}

代码示例来源:origin: stackoverflow.com

System.getSecurityManager().getClassContext()[0].getName();

代码示例来源:origin: apache/felix

public Class[] getClassContext()
  {
    Class[] result = super.getClassContext();
    return result != null ? result : EMPTY_CLASSES;
  }
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

@Override
  public Class<?>[] getClassContext() {
    return super.getClassContext();
  }
}

代码示例来源:origin: org.knopflerfish/framework

@Override
 public Class<?>[] getClassContext() {
  return super.getClassContext();
 }
}

代码示例来源:origin: org.apache.aries/org.apache.aries.util-r42

@Override
 public Class<?>[] getClassContext()
 {
  return super.getClassContext();
 }
}

代码示例来源:origin: io.github.lukehutch/fast-classpath-scanner

@Override
  protected Class<?>[] getClassContext() {
    return super.getClassContext();
  }
}

代码示例来源:origin: org.ops4j.pax.logging/pax-logging-service

public Class[] getClassContext()
  {
    return super.getClassContext();
  }
}

代码示例来源:origin: org.ops4j.pax.logging/pax-logging-service

public Class[] getClassContext()
  {
    return super.getClassContext();
  }
}

代码示例来源:origin: stackoverflow.com

Class thisClass = new SecurityManager() {
   public Class getCurrentClass() {
     return getClassContext()[1];
   }
 }.getCurrentClass();

相关文章