Hmm I wasn't yet aware of this hasmember feature. I tried to google around and also checked my copy of Aspectj in Action but could not find much examples.
Are there any usage details on hasfield/hasmethod somewhere? Also, is there a unit test suite which I could check for examples? The AspectJ source download doesn't seem to include any tests.. thanks, K On Wed, May 25, 2011 at 3:16 PM, Matthew Adams <[email protected]> wrote: > For the first one, you might try using "declare error" with a type > pattern that uses hasmember. Not sure what you mean by the second, > but declare error with hasmember might do the trick there, too. > > -matthew > > On Sat, May 21, 2011 at 5:57 PM, Kristof Jozsa <[email protected]> > wrote: >> I'd like to ask for help with two policy enforcement rules: >> - enforce a class having no constructor with arguments (a default or a >> parameterless constructor is fine) >> - enforce an annotated field being of a certain type >> >> For the second one I currently enforce the get() of the field which is not >> too bad, but would be nicer to disallow the field declaration.. if possible. >> >> Can anyone show me an example doing these tricks? >> >> Thanks a lot, >> K >> >> >> >> _______________________________________________ >> aspectj-users mailing list >> [email protected] >> https://dev.eclipse.org/mailman/listinfo/aspectj-users >> >> > > > > -- > @matthewadams12 > mailto:[email protected] > skype:matthewadams12 > yahoo:matthewadams > aol:matthewadams12 > google-talk:[email protected] > msn:[email protected] > http://matthewadams.me > http://www.linkedin.com/in/matthewadams > _______________________________________________ > aspectj-users mailing list > [email protected] > https://dev.eclipse.org/mailman/listinfo/aspectj-users > _______________________________________________ aspectj-users mailing list [email protected] https://dev.eclipse.org/mailman/listinfo/aspectj-users
