Including modifiers in factory class/field creation

I'm currently using the PsiElementFactory factory methods to create fields/classes.
(for example, factory.createField(String,PsiType) )
Is there a way to include modifiers (public, static) in the creation of these?
It sets everything to 'private' by default, even if there was no modifier to begin with.

Thanks for any replies.

1 comment
Comment actions Permalink

The easiest way is to create a class from text which has the method/field with the desired text inside, and then retrieve that member from the class using getFields()[0] or getMethods[0].

0

Please sign in to leave a comment.