staticInitializer 프로브 단편

staticInitializer 프로브 단편 유형을 사용하여 모든 프로브된 클래스의 클래스 초기화 프로그램에 새 코드를 삽입할 수 있습니다. 클래스에 클래스 초기화 프로그램이 없는 경우 초기화 프로그램을 작성합니다.

staticInitializer 단편 코드는 프로브된 클래스의 클래스 초기화 프로그램 내에서 모든 원본 코드보다 먼저 실행됩니다. 프로브가 staticField 오브젝트를 사용할 경우, staticInitializer 단편 코드가 실행되기 전에 새 정적 필드가 기본적으로 생성됩니다.

staticInitializer 단편에 다음 데이터 항목이 사용 가능합니다.
  • className
  • staticField
  • classSourceFile
  • methodNames
  • methodLineTables

예제
<fragment type="staticInitializer">
  <data type="className" name="cn"/>
  <code>
    System.out.println("[Class " + cn + " is being loaded.]");
  </code>
</fragment>

상위 주제: Probekit 참조

관련 참조
단편 프로브 오브젝트
데이터 프로브 오브젝트
StaticField 프로브 오브젝트

관련 정보
staticField 및 staticInitializer 예제

Copyright IBM Corporation and others 2000, 2004.