[forge-dev] Creating Qualifier with Forge

Lincoln Baxter, III lincolnbaxter at gmail.com
Fri Dec 16 16:20:05 EST 2011


Hmm, good catch. I think that this was a typo!

Fixing it right now.

:)
~Lincoln

On Thu, Dec 15, 2011 at 4:42 PM, Daniel Sachse
<sachsedaniel at googlemail.com>wrote:

> Hey,
>
> I noticed the following:
> The JavaParserImpl did this:
>
> if (JavaAnnotation.class.isAssignableFrom(type))
>          return (T) parse("public @annotation JavaAnnotation { }");
>
> I changed it to this and now it works:
> if (JavaAnnotation.class.isAssignableFrom(type))
>          return (T) parse("public @interface JavaAnnotation { }");
>
> Is everybody in with me?
>
> Cheers,
>
> Daniel
>
> Am 15.12.2011 um 22:04 schrieb Daniel Sachse:
>
> Hey guys,
>
> atm I am working on FORGE-372 and I need to create a Qualifier into the
> target project.
> I made a method on my own which looks the following:
>
>    private JavaAnnotation createQualifier(String packageName, String
> interfaceName) {
>        JavaAnnotation javaAnnotation = JavaParser.create(JavaAnnotation.
> class).setName(interfaceName).setPackage(packageName);
>
>        javaAnnotation.addImport(Qualifier.class);
>        javaAnnotation.addImport(Target.class);
>        javaAnnotation.addImport(Retention.class);
>        javaAnnotation.addImport(Documented.class);
>
>        javaAnnotation.addAnnotation(Qualifier.class);
>        javaAnnotation.addAnnotation(Target.class).setEnumValue(TYPE
> ).setEnumValue(METHOD).setEnumValue(PARAMETER).setEnumValue(FIELD);
>        javaAnnotation.addAnnotation(Retention.class).setEnumValue(RUNTIME
> );
>        javaAnnotation.addAnnotation(Documented.class);
>
>        return javaAnnotation;
>    }
>
> As soon as I try to save it with
> "javaSourceFacet.saveJavaSource(createQualifier(packageName, "Forge"));",
> Forge throws the following error: "seam-persistence
> install-managed-persistence-context] Unknown JavaSource type."
>
> Anyone any idea?
>
> BTW:
> If this createQualifier annotation doesn't exist already somewhere else, I
> would suggest to move into the core somewhere, as soon as it is finished
> and tested. Unfortunately I can't see the output atm.
>
> Regards,
>
> Daniel
>
>
>
> _______________________________________________
> forge-dev mailing list
> forge-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/forge-dev
>
>


-- 
Lincoln Baxter, III
http://ocpsoft.com
http://scrumshark.com
"Keep it Simple"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/forge-dev/attachments/20111216/ca18e3d5/attachment.html 


More information about the forge-dev mailing list