Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Sapphire » @DefaultValue never tells if value is empty!
@DefaultValue never tells if value is empty! [message #1269957] Wed, 12 March 2014 10:55 Go to next message
Hazem ELRAFFIEE is currently offline Hazem ELRAFFIEEFriend
Messages: 61
Registered: September 2012
Member
Hello again Very Happy

when I mark a property as
@DefaultValue(text = "Hello")
I can never tell whether it is written explicitly as "Hello" or it doesn't exist and the framework is just passing me the default value!

As I understand, the ".content()" method should give me the written value itself, while ".content(true)" gives the written value, or the default value if the property doesn't exist or has empty value. Is that correct?

I understand the same concept applies to ".text()" and ".text(true)".

The problem is, once a DefaultValue annotation is there, ".content" and ".content(true)" are identical! How can I distinguish between the two cases?
Re: @DefaultValue never tells if value is empty! [message #1269975 is a reply to message #1269957] Wed, 12 March 2014 11:17 Go to previous messageGo to next message
Hazem ELRAFFIEE is currently offline Hazem ELRAFFIEEFriend
Messages: 61
Registered: September 2012
Member
Just upgraded to Sapphire 0.7.1 and found that a new method ".empty()" added Smile

This method returns true if empty or has default value Wink

Sorry for disturbance Very Happy
Re: @DefaultValue never tells if value is empty! [message #1270116 is a reply to message #1269975] Wed, 12 March 2014 14:09 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
The .content() invocation is equivalent to .content( true ). If you don't want the default value to be applied, you use .content( false ).
Re: @DefaultValue never tells if value is empty! [message #1270611 is a reply to message #1270116] Thu, 13 March 2014 08:09 Go to previous message
Hazem ELRAFFIEE is currently offline Hazem ELRAFFIEEFriend
Messages: 61
Registered: September 2012
Member
LOL .. That explains a lot Smile

Thanks for the clarification!
Previous Topic:Property Custom Parser?
Next Topic:Tab Folder
Goto Forum:
  


Current Time: Tue Mar 19 03:45:56 GMT 2024

Powered by FUDForum. Page generated in 0.02165 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top