From ef868243d36ab20062e7aae6828bc17987a018a5 Mon Sep 17 00:00:00 2001 From: acolyer Date: Wed, 9 Mar 2005 11:16:11 +0000 Subject: [PATCH] fixes in annotation docs uncovered through testing --- docs/adk15ProgGuideDB/annotations.xml | 54 +++++++++++++++++++++------ 1 file changed, 43 insertions(+), 11 deletions(-) diff --git a/docs/adk15ProgGuideDB/annotations.xml b/docs/adk15ProgGuideDB/annotations.xml index 2a0d02d54..d7abfe0af 100644 --- a/docs/adk15ProgGuideDB/annotations.xml +++ b/docs/adk15ProgGuideDB/annotations.xml @@ -212,30 +212,40 @@ @AspectAnnotation public abstract aspect ObserverProtocol { + @InterfaceAnnotation + interface Observer {} + @InterfaceAnnotation interface Subject {} @ITDFieldAnnotation - private List Subject.observers; + private List Subject.observers; @ITDMethodAnnotation - public void Subject.addObserver() { ... } + public void Subject.addObserver(Observer o) { + observers.add(o); + } @ITDMethodAnnotation - public void Subject.removeObserver() { ... } + public void Subject.removeObserver(Observer o) { + observers.remove(o); + } @MethodAnnotation - private void notifyObservers(Subject subject) { ... } + private void notifyObservers(Subject subject) { + for(Observer o : subject.observers) + notifyObserver(o,subject); + } /** * Delegate to concrete sub-aspect the actual form of - * notification for a given type of Subject. + * notification for a given type of Observer. */ @MethodAnnotation - protected abstract void notifySubject(Subject s); + protected abstract void notifyObserver(Observer o, Subject s); /* no annotations on pointcuts */ - abstract pointcut observedEvent(Subject subject); + protected abstract pointcut observedEvent(Subject subject); @AdviceAnnotation after(Subject subject) returning : observedEvent(subject) { @@ -255,10 +265,32 @@ will be emitted by the compiler if the pointcut expression associated with an advice statement can be statically determined to not match any join points. The warning can be suppressed for an individual advice statement by using the - @SuppressAjWarnings({"unmatched"}) annotation. This works in + @SuppressAjWarnings({"adviceDidNotMatch"}) annotation. This works in the same way as the Java 5 SuppressWarnings annotation (See JLS 9.6.1.5), but has class file retention. + + + + @@ -298,7 +330,7 @@ @<qualified-name>, for example, @Foo, or @org.xyz.Foo. - @(<type-pattern>), for example, @(org.xzy..*), or + @(<type-pattern>), for example, @(org.xyz..*), or @(Foo || Boo) @@ -660,7 +692,7 @@ - execution(public (@Immutable *) org.xyz..*.*(..) + execution(public (@Immutable *) org.xyz..*.*(..)) The execution of any public method in a package with prefix @@ -790,7 +822,7 @@ pointcut txRequiredMethod(Tx transactionAnnotation) : execution(* *(..)) && @this(transactionAnnotation) - && if(transactionAnnotation.policy == Tx.Policy.REQUIRED); + && if(transactionAnnotation.policy() == TxPolicy.REQUIRED); ]]> -- 2.39.5