Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6847845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:47:41+00:00 2026-05-27T00:47:41+00:00

Since I want to generate Scala code from an annotated Scala class, I need

  • 0

Since I want to generate Scala code from an annotated Scala class, I need to get the values from annotations of the class.

public @interface TestAnnotation {
    public String name();
    public String description();
    public String[] tags() default { "Test" };
}
@TestAnnotation(name = "TestName", description = "TestDescription")
class MyClass

My Problem is, that the Scala presentation compiler doesn’t give me a value for tags. I’m accessing the values with the following code:

import tools.nsc.interactive.Global._    

val ast = ...
val ans = ast.symbol.annotations // which returns me a List of AnnotationInfo
ans.head.assocs // returns: List((name, "TestName"), (description, "TestDescription"))

So how can I get the default value of tags?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T00:47:42+00:00Added an answer on May 27, 2026 at 12:47 am

    The same question was recently asked on the scala-language mailing list. Here‘s the link to the thread.

    Short answer: this is currently not possible. Implementing it requires a major amount of work, unfortunately. The reason is that the Scala compiler would need to have a complete Java parser. Currently, it can only parse declarations in Java source code, it skips all the “righthand sides” (method bodies, field definitions). See the thread.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to get the number of seconds since midnight. Here is my first
For an ecommerce site I want to generate a random coupon code that looks
In short: I want to generate two different source trees from the current one,
I want to use a data class in Lombok. Since it has about a
Hi i want to compile a class at runtime using CodeDom and generate in
I have a TimePickerDialog with is24Hour set to false since I want to present
I know this question isn't directly programming related, but since I want to be
I want to use L2E since it's very convenient to my company's apps, I
I want to run an Apache on my local machine since I can only
i want to use an asp:LinkButton , since it looks like a link, yet

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.