?? monitorfilereads.aj
字號:
package designpatterns.decorator.aspectjwrap;import java.io.InputStream;import javax.swing.JComponent;import javax.swing.ProgressMonitorInputStream;public aspect MonitorFileReads { pointcut constructionOfInputStream(JComponent component): execution(InputStream designpatterns.decorator.java.*.*()) && cflow(execution(* javax.swing.JComponent+.*(..)) && this(component)); InputStream around(JComponent component) : constructionOfInputStream(component){ InputStream is = proceed(component); // a real system would need to add a more sophisticated // check to prevent double-wrapping if(! (is instanceof ProgressMonitorInputStream) ){ is = new ProgressMonitorInputStream(component, "PM: AJ Wrap", is); } return is; } }
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -