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

  • Home
  • SEARCH
  • 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 6887103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:50:36+00:00 2026-05-27T05:50:36+00:00

how to change/set a binding by a property/string given in a property/text file? in

  • 0

how to change/set a binding by a property/string given in a property/text file? in my case i want to implement a kind of “demo mode”.
In normal mode a property gives an url to an external service but if url is “demo” the binding of the according interface should be changed like this:

normal:

bind(SasDatenProvider.class).to(SasDataProviderHttpImpl.class);

demo

bind(SasDataProvider.class).to(SasDataProviderFileImpl.class);

how to achieve that?
thx in advance

  • 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-27T05:50:37+00:00Added an answer on May 27, 2026 at 5:50 am

    You can use a method annotated with @Provides in your module. Then you can do something like this:

    public class MyModule extends AbstractModule {
    
        @Provides
        SasDatenProvider provideSas(SasDataProviderHttpImpl http, 
            SasDataProviderFileImpl file){
    
            boolean isDemo = false; /* do you property lookup logic here */
    
            return isDemo ? file : http;
        }
    }
    

    You can read more about @Provides-methods in the guice docs:
    http://code.google.com/p/google-guice/wiki/ProvidesMethods

    If your don’t want this kind of logic in you module, you can consider creating your own provider:
    http://code.google.com/p/google-guice/wiki/ProviderBindings

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

Sidebar

Related Questions

If a file is set to read only mode, how do I change it
Given the Following Code how Would i Change/Set my Silverlight WCF Service URI in
I'd like to set a connection string programmatically, with absolutely no change to any
Trying to bind a String to a RichTextBox.Text property so that when the String
I tried using aegis -change_attributes to change the brief_description of my current change set
By using Intertrac we are able to link the change set to a ticket
I need to change the capitalization of a set of files in a subversion
If I change an element of an std::set, for example, through an iterator, I
In the following code I set up a change handler on a select box
I have a set of integers that I would like to change to a

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.