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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:16:41+00:00 2026-06-07T09:16:41+00:00

Previously Id asked this question Putting a simple expression language into java about allowing

  • 0

Previously Id asked this question Putting a simple expression language into java about allowing the user to enter a formatting mask with support for if statements, substrings and the like.

The answer to use Script Engine with javascript worked , however the javascript syntax is not very easy for users

(albumartist.length>0  ? albumartist +'-' :(artist.length>0 ? artist + '-' : ' ')) + (album.length>0 ? album + '-' :'') + (trackno.length>0 ? trackno + '-' :'')  + title

could give output

U2-Boy-Twilight-02

but an easier syntax would be something like

if(%albumartist%,%artist%)-if(%album%,%album%-)if(%trackno%,%trackno-)%title

The main difference being is we don’t have to explicity concatenate strings with ‘+’ or quote string literals with ‘ ‘

which is similar to the Foobar title formatting reference detailed at http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Title_Formatting_Reference#.24if2.28a.2Celse.29 but there is not a physical implemention of this I could parse in Java.

Any ideas ?

  • 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-06-07T09:16:43+00:00Added an answer on June 7, 2026 at 9:16 am
    • AFAIK, only javascript (ECMAScript) is supported in the standard JDK. You can check what engines are available with the code below.
    • Other engines are available in the scripting project, but I don’t believe that the language you mention is part of them.
    • If you feel like it (and have a lot of spare time), you can create your own scripting engine.

    You can read more about engines here, there and there.

    Finally you could “simply” parse the FooBar2000 syntax in Java.

    To summarise, what you are trying to do does not sound like an easy task – good luck! 😉

    public static void main(String[] args) {
        ScriptEngineManager mgr = new ScriptEngineManager();
        List<ScriptEngineFactory> factories =
                mgr.getEngineFactories();
        for (ScriptEngineFactory factory : factories) {
            String engName = factory.getEngineName();
            String engVersion = factory.getEngineVersion();
            String langName = factory.getLanguageName();
            String langVersion = factory.getLanguageVersion();
            System.out.printf("Script Engine: %s (%s)\n", engName, engVersion);
            System.out.printf("\tLanguage: %s (%s)\n", langName, langVersion);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I previously asked this question here: Stop user from using enter to pass a
I previously asked this question about how to make versioned serializaion using boost::serialization::access I
I previously asked a question over on Pro Webmasters about putting Javascript at the
This question is about the same program I previously asked about . To recap,
This question was previously asked in scala-user mailing-list without a confirmed answer. scala> val
I know this question was asked previously and the reply was to override onPrepareContextMenu()/onCreateContextMenu().
This is an extension of a question I previously asked here . Long story
This is related to a question I've asked previously: Calling Javascript function after loading
This stems from a previous question I asked - about a write conflict with
This is a follow up question to a previous question I asked about calculating

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.