用于在方法上实现与注释的接口的方法的Aspect表达式

时间:2017-05-27 13:52:51

标签: java spring aop spring-aop

我有

    function ope() {
        document.getElementById("mySidenav").style.width = "100%";
    }

    function clo() {
        document.getElementById("mySidenav").style.width = "0";
    }

并且有一些类实现了这个接口。

我想编写一个方面(使用Spring AOP),该方面将运行此接口的所有实现的 body { font-family: "Lato", sans-serif; } .sidenav { height: 100%; width: 0; position: fixed; z-index: 1; top: 0; left: 0; background-color: #111; overflow-x: hidden; transition: 0.5s; padding-top: 60px; text-align:center; } .sidenav a { padding: 8px 8px 8px 32px; text-decoration: none; font-size: 25px; color: #818181; display: block; transition: 0.3s; } .sidenav a:hover{ color: #f1f1f1; } .sidenav .closebtn { position: absolute; top: 0; right: 25px; font-size: 36px; margin-left: 50px; } @media screen and (max-height: 450px) { .sidenav {padding-top: 15px;} .sidenav a {font-size: 18px;} }方法。

通常,我希望能够使用 <!DOCTYPE html> <html> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"> <body> <div id="mySidenav" class="sidenav"> <a href="javascript:void(0)" class="closebtn" onclick="clo()">&times;</a> <iframe width="420" height="345" src="https://www.youtube.com/embed/Uks8psEpmB4"> </iframe> </div> <div class="w3-container"> <div class="w3-card-4 w3-dark-grey" style="width:50%"> <div class="w3-container w3-center"> <span style="cursor:pointer" onclick="ope()"> <h3>Friend Request</h3> <img src="img_avatar3.png" alt="Avatar" style="width:80%"> <h5>John Doe</h5> </span> </div> </div> </div> <div id="mySidenav" class="sidenav"> <a href="javascript:void(0)" class="closebtn" onclick="clo()">&times;</a> <iframe width="420" height="345" src="https://www.youtube.com/embed/1PPDoAKbaNA"> </iframe> </div> <div class="w3-container"> <div class="w3-card-4 w3-dark-grey" style="width:50%"> <div class="w3-container w3-center"> <span style="cursor:pointer" onclick="ope()"> <h3>Friend Request</h3> <img src="img_avatar3.png" alt="Avatar" style="width:80%"> <h5>John Doe</h5> </span> </div> </div> </div> </body> </html> 标记任何抽象或接口方法,并将其实现包含在Around方面。

简单public interface MyInterface { @DoProfile void some(); } 不起作用。它仅在我将some()置于具体实现上时才有效。但是我想把@DoProfile放到接口/抽象方法中。

怎么做?

0 个答案:

没有答案