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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:55:01+00:00 2026-05-17T23:55:01+00:00

Sometimes I just need to define a lot of settings for some class, it’s

  • 0

Sometimes I just need to define a lot of settings for some class, it’s just hard to define 5 or more properties in constructor, because you don’t really know what property you are setting. In JavaScript you can use name for settings with JSON style. Is something similar possible in Java? Or are there any suggestion how I should define large amount of details inside code (and I mean only inside code needed attributes, so xml is not possible here).

$.plugin.defaults = {
    css: {
        padding:    0,
        margin:     0,
        textAlign:  'center',
        color:      '#000',
        border:     '0px none'
    }
}
  • 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-17T23:55:01+00:00Added an answer on May 17, 2026 at 11:55 pm

    Try the builder pattern. This blog also has some nice insight. And of course, there are several other questions on SO that have “try the builder pattern” as the answer, so a little searching here would go along way.

    Also…well, just use one of the several JSON-to-Java libraries. Just started with GSON myself, seems to work nicely.

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

Sidebar

Related Questions

Sometimes I need to find some strings inside DB usually it is just host-name
Grails is great. Yet, sometimes, we just need a quick, lightweight web framework. Is
I need just a solution to retrieve a path for storing desktop application settings
I need to define a shared variable in my Main class's main() method. I
sometimes, i just feel dumb... i have a simple class: public class myClass {
I run a query sometimes and it just hangs. I go look at processes
I just basically want to add about 20 and sometimes 80 Proximity Alerts with
Sometimes I want to build Python or GCC from scratch just for fun, but
I just started with backbone.js, and one thing that I noticed is that sometimes
Just started learning algorithms. So the exercise is to find if statement is always/sometimes

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.