The Artima Developer Community
Sponsored Link

Java Buzz Forum
AspectJ 5 supports Java 5

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
dion

Posts: 5028
Nickname: dion
Registered: Feb, 2003

Dion Almaer is the Editor-in-Chief for TheServerSide.com, and is an enterprise Java evangelist
AspectJ 5 supports Java 5 Posted: Jan 17, 2005 4:30 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by dion.
Original Post: AspectJ 5 supports Java 5
Feed Title: techno.blog(Dion)
Feed URL: http://feeds.feedburner.com/dion
Feed Description: blogging about life the universe and everything tech
Latest Java Buzz Posts
Latest Java Buzz Posts by dion
Latest Posts From techno.blog(Dion)

Advertisement
Adrian has been talking about getting Java 5 support into AspectJ. I can imagine how much work that has been, and I am impressed to hear that AspectJ 5 now supports full source compilation of Java 5 programs. AJDT also has integrated in to Eclipse 3.1 M4 with full Java 5 support, eager parsing, and early error indications all working happily (not officially released). Check out a SimpleAspect. Java 5 style: import java.util.List; @MyAnnotation public aspect SimpleAspect { int x; static List myStringList; public static void main(String[] args) { for(String s:args) { System.out.println(s); myStringList.add(s); } C c = new C(); c.whatCsDoBest(); c.somethingElse(); c.myInt(5); c.somethingElse(new Object(), new Object()); c.whoAmI(); D d = new D(); d.whoAmI(); } pointcut annotatedExecution() : execution(@MyAnnotation * *(..)); before() : annotatedExecution() { System.out.println(thisJoinPoint + " has an annotation."); } before() : call(* myInt(..)) && args(int) { System.out.println("Autoboxing match"); } before(Object[] objects) : call(* somethingElse(Object...)) && args(objects) { System.out.print("Varargs match: "); for (Object o:objects) { System.out.print(o + " "); } System.out.println(); } before() : execution(C whoAmI()) { System.out.println("Covariant match on execution(C whoAmI())"); } before() : execution(D whoAmI()) { System.out.println("Covariant match on execution(D whoAmI())"); } } class C { @MyAnnotation public void whatCsDoBest() { } public void somethingElse(Object... objects) { } public C whoAmI() { return this; } Progress getAspectJ5Progress() { return Progress.EXCELLENT; } public int myInt(Integer i) { return i; } } class D extends C { public D whoAmI() { return this; } } @interface MyAnnotation {} enum Progress { OK, GOOD, VERYGOOD, EXCELLENT }

Read: AspectJ 5 supports Java 5

Topic: I wont program Java on Mac mini, but... Previous Topic   Next Topic Topic: java.exe

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use