Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Annotation ITD

Hi,

 I see this warning when I use this code.

@Aspect
public class InterType {
@DeclareAnnotation( "protected String com.hrg.devicemachine.CreditAccount.*" )
@NotNull String brand;

}


[WARNING] Found @DeclareAnnotation while current release does not support it (se
e 'com.hrg.logger.aspect.InterType')

The AspectJ dependency is this

   <dependencies>
       <dependency>
           <groupId>org.aspectj</groupId>
           <artifactId>aspectjrt</artifactId>
           <version>1.8.5</version>
       </dependency>
       <dependency>
           <groupId>org.aspectj</groupId>
           <artifactId>aspectjtools</artifactId>
           <version>1.8.5</version>
       </dependency>
   </dependencies>

Thanks,
Mohan


On Wed, Jul 8, 2015 at 11:27 AM, Mohan Radhakrishnan <radhakrishnan.mohan@xxxxxxxxx> wrote:
@DeclareAnnotation( "public * org.xyz.banking.BankAccount+.*(..)" )
@NotNull String brand;

I think this is it. Is this how I can add an annotation to a field ?

The field is like this.

    @XmlAttribute(name = "brand")
    protected String brand;

Thanks,
Mohan

On Tue, Jul 7, 2015 at 9:51 PM, Andy Clement <andrew.clement@xxxxxxxxx> wrote:
Not quite sure which bit of syntax you are after, but if you are trying to find the annotation style equivalent of "declare @method", I’m afraid there isn’t one. It hasn’t been implemented yet.

cheers,
Andy

> On Jul 7, 2015, at 5:14 AM, Mohan Radhakrishnan <radhakrishnan.mohan@xxxxxxxxx> wrote:
>
> Hi,
>          I am introducing JSR 303/349 annotations to JAXB generated code to leverage the validations mechanism.
>
> @DeclareMethod( "* AccountService.*(..): @Transactional(Propagation.Required)" );
>
> Is this how it is done ?
>
> Thanks,
> Mohan
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://dev.eclipse.org/mailman/listinfo/aspectj-users

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users



Back to the top