[forge-users] Checking if a class is final from JavaClassSource

Lincoln Baxter, III lincolnbaxter at gmail.com
Wed Feb 11 17:33:01 EST 2015


George,

That method does not appear to exist. It looks like we are missing a
feature.

In the mean time, Ludo, you can call .toString() on the JavaClassSource
object and check for the final modifier before the first instance of the
type name:

if(source.toString().matches("^.*final(?<!" + source.getName() + ")"))

Something like that should work.

~Lincoln

On Wed, Feb 11, 2015 at 12:26 PM, George Gastaldi <ggastald at redhat.com>
wrote:

> Tried JavaClassSource.setFinal(false)?
>
>
>
> > Em 11/02/2015, às 15:24, forge-users at lists.jboss.org escreveu:
> >
> > Hi,
> >
> > maybe a dummy question, but I didn't find the way to check is a class is
> final, using JavaClassSource object ?
> >
> > I need to check if, and remove final modifier if found.
> >
> > Thanx for your help
> > Ludo
> >
> > Posted by forums
> > Original post: https://developer.jboss.org/message/918504#918504
> > _______________________________________________
> > forge-users mailing list
> > forge-users at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/forge-users
>
> _______________________________________________
> forge-users mailing list
> forge-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/forge-users
>



-- 
Lincoln Baxter, III
http://ocpsoft.org
"Simpler is better."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/forge-users/attachments/20150211/fb2275fa/attachment.html 


More information about the forge-users mailing list