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 59735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:03:07+00:00 2026-05-10T18:03:07+00:00

I have a rather big number of source files that I need parse and

  • 0

I have a rather big number of source files that I need parse and extract all string literals and put them in a file as play old java constant.
For exemple:

Label l = new Label('Cat'); 

Would become:

Label l = new Label(Constants.CAT); 

And in Constants.java I would have:

public final static String CAT = 'Cat'; 

I do not want the strings to be externalized in a property text file.
One reason is for consistency and code readability.
The other is that our client code uses GWT, which does not support Java property text file mechanism.

I could write some sort of parser (using ant replace task maybe)?
But I wondered if an IDE already does this sort of thing automatically.

  • 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. 2026-05-10T18:03:07+00:00Added an answer on May 10, 2026 at 6:03 pm

    To complete Peter Kelley answer, you might consider for eclipse IDE the AST solution.

    You might then write an AST program which parse your source code and does what you want.

    A full example is available in this eclipse corner article, also more details in the eclipse help.
    And you can find some examples in Listing 5 of the section ‘Implementation of in-place translation’ of Automating the embedding of Domain Specific Languages in Eclipse JDT, alongside multiple examples in GitHub projects.

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

Sidebar

Ask A Question

Stats

  • Questions 69k
  • Answers 69k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer I'm not sure what the extra function() is doing, maybe… May 11, 2026 at 12:41 pm
  • added an answer DayPilot is a pretty good general purpose calendaring/schedule control. The… May 11, 2026 at 12:41 pm
  • added an answer I used to use PC-Lint a while ago. Personally I… May 11, 2026 at 12:41 pm

Related Questions

I have a rather large file (150 million lines of 10 chars). I need
I have a rather classic UI situation - two ListBoxes named SelectedItems and AvailableItems
I have a rather weak understanding of any of oracle's more advanced functionality but
I have a rather complex decorator written by someone else. What I want to
I'm developing an operating system and rather than programming the kernel, I'm designing the
There's a lot of literature on collision detection, and I've read at least a
Dev-cpp comes with an example program Jackpot, which has a GetResults function in it:
Scenario: I load some data into a local MySQL database each day, about 2

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.