Code style is using aspectj syntax:
aspect Foo {
declare @method: ...
}
It really doesn’t mean .aj - you don’t have to keep your aspects in .aj files,
they can be in .java files. The file suffix choice is entirely independent of
language choice *if using ajc to compile*. It is only if using javac to compile
that you need to put everything in .java files.
Maven can use the aspectj maven plugin to compile the code. Yes I think you can
use that to build your spring projects.
cheers,
Andy
> On Jul 9, 2015, at 10:46 PM, Mohan Radhakrishnan
> <[email protected]> wrote:
>
> Hi Andy,
> What is code style ? Do you mean .aj syntax ? This is a
> maven pom and I can use that syntax in my Spring project ?
>
> Thanks,
> Mohan
>
> On Fri, Jul 10, 2015 at 12:45 AM, Andy Clement <[email protected]
> <mailto:[email protected]>> wrote:
> DeclareAnnotation was added a long time ago as a possible way to support some
> of this but I’m afraid it doesn’t do anything (other than produce that
> warning). It doesn’t matter what you annotate or put in the value string,
> there is no code in AspectJ to weave it. Can you not just use code style to
> do what you need?
>
> cheers,
> Andy
>
>> On Jul 9, 2015, at 12:37 AM, Mohan Radhakrishnan
>> <[email protected] <mailto:[email protected]>> wrote:
>>
>> I don't see the @DeclareAnnotation warning with this pom.xml
>>
>> But now I am debugging this field pointcut expressions. Is this correct ?
>>
>> @Aspect
>> public class InterType {
>>
>> @DeclareAnnotation( "protected String
>> com.hrg.devicemachine.CreditAccount.*" )
>> @NotNull String brand;
>>
>> }
>>
>>
>>
>> <pluginManagement>
>> <plugins>
>> <plugin>
>> <groupId>org.springframework.boot</groupId>
>>
>> <artifactId>spring-boot-maven-plugin</artifactId>
>> </plugin>
>>
>> <plugin>
>> <groupId>org.codehaus.mojo</groupId>
>> <artifactId>aspectj-maven-plugin</artifactId>
>> <configuration>
>> <showWeaveInfo>true</showWeaveInfo>
>> <source>1.7</source>
>> <target>1.7</target>
>> <Xlint>warning</Xlint>
>> <complianceLevel>1.7</complianceLevel>
>> <encoding>UTF-8</encoding>
>> <verbose>true</verbose>
>> <aspectLibraries>
>> <aspectLibrary>
>> <groupId>org.springframework</groupId>
>> <artifactId>spring-aspects</artifactId>
>> </aspectLibrary>
>> </aspectLibraries>
>> </configuration>
>> <executions>
>> <execution>
>> <goals>
>> <goal>compile</goal>
>> </goals>
>> </execution>
>> </executions>
>> <dependencies>
>> <dependency>
>> <groupId>org.aspectj</groupId>
>> <artifactId>aspectjrt</artifactId>
>> <version>1.8.6</version>
>> </dependency>
>> <dependency>
>> <groupId>org.aspectj</groupId>
>> <artifactId>aspectjtools</artifactId>
>> <version>1.8.6</version>
>> </dependency>
>> </dependencies>
>> </plugin>
>> </plugins>
>> </pluginManagement>
>>
>> Thanks,
>> Mohan
>>
>>
>> On Wed, Jul 8, 2015 at 12:16 PM, Mohan Radhakrishnan
>> <[email protected] <mailto:[email protected]>> wrote:
>> 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
>> <[email protected] <mailto:[email protected]>> 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 <[email protected]
>> <mailto:[email protected]>> 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
>> > <[email protected] <mailto:[email protected]>>
>> > 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
>> > [email protected] <mailto:[email protected]>
>> > To change your delivery options, retrieve your password, or unsubscribe
>> > from this list, visit
>> > https://dev.eclipse.org/mailman/listinfo/aspectj-users
>> > <https://dev.eclipse.org/mailman/listinfo/aspectj-users>
>>
>> _______________________________________________
>> aspectj-users mailing list
>> [email protected] <mailto:[email protected]>
>> To change your delivery options, retrieve your password, or unsubscribe from
>> this list, visit
>> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>> <https://dev.eclipse.org/mailman/listinfo/aspectj-users>
>>
>>
>> _______________________________________________
>> aspectj-users mailing list
>> [email protected] <mailto:[email protected]>
>> To change your delivery options, retrieve your password, or unsubscribe from
>> this list, visit
>> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>> <https://dev.eclipse.org/mailman/listinfo/aspectj-users>
>
> _______________________________________________
> aspectj-users mailing list
> [email protected] <mailto:[email protected]>
> To change your delivery options, retrieve your password, or unsubscribe from
> this list, visit
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
> <https://dev.eclipse.org/mailman/listinfo/aspectj-users>
>
> _______________________________________________
> aspectj-users mailing list
> [email protected]
> 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
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from
this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users