Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

How to set @Configurable in a conditional context
 Post subject: How to set @Configurable in a conditional context Post rating: 0   New post Posted: Fri 11 Mar, 2011, 15:45 
User avatar

User rating: 21
Joined: Thu 19 May, 2011, 20:50
Posts: 413
Location: Germany, Munich
I want to create a super class which defines all possible @Configurable I need.
1. How can I switch them off in inherited classes?
2. Maybe I am wrong, but can I set @Configurable somehow in an if(showThisConfig) { @Configurable ... } , so I can switch it on or off when I need it?

I appreciate your help.


 
 Post subject: Re: How to set @Configurable in a conditional context Post rating: 0   New post Posted: Fri 10 Jun, 2011, 11:06 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Quote:
1. How can I switch them off in inherited classes?
Only by commenting the annotation line.
Quote:
2. Maybe I am wrong, but can I set @Configurable somehow in an if(showThisConfig) { @Configurable ... } , so I can switch it on or off when I need it?
Unfortunately annotations don't work that way.
You might consider saving your base class' parameters into a property file:
https://www2.dukascopy.com/swiss/english ... =7&t=30090
Or reading base class' parameters from inherited classes by using reflection:
viewtopic.php?f=61&t=35239&p=45495&hilit=annotation#p45495


 

Jump to:  

  © 1998-2026 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com