Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enum constant arg with class #86

Closed
robertomorati opened this issue Dec 8, 2020 · 3 comments
Closed

Enum constant arg with class #86

robertomorati opened this issue Dec 8, 2020 · 3 comments
Assignees
Labels

Comments

@robertomorati
Copy link

robertomorati commented Dec 8, 2020

Hi @phax

I faced with an "unusual" situation, where I need to pass a Class as a parameter in a constant enum. In other words, something like that:

ERRO_SQL("900","System Error", MonitoringKeySQL.class)

I have defined JDefinedClass monitoringKeySQL= createJDefinedClass("package.MonitoringKeySQL");

enums.arg(<class here???>);

Please, could help me with this situation?

All the best,

@phax phax self-assigned this Dec 8, 2020
@phax phax added the question label Dec 8, 2020
@phax
Copy link
Owner

phax commented Dec 8, 2020

Try cm.ref("package.MonitoringKeySQL").dotClass()

phax added a commit that referenced this issue Dec 8, 2020
@phax
Copy link
Owner

phax commented Dec 8, 2020

What version are you using?
With the latest version this my output for the test case:

package issue86;

public class Issue86Test {

    public enum MyEnum {
        A(String.class),
        C(null);
    }
}

@robertomorati
Copy link
Author

Hi @pahx.

That's worked.
Really sorry, was my mistake, because I migrated from old jcodemodel (org.glassfish.jaxb).
I tried to delete my message, but it wasn't fast enough XD

I really appreciate your attention and great job!!
All the est!!

@phax phax closed this as completed Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants