Skip to main content



      Home
Home » Archived » Sapphire » @DefaultValue never tells if value is empty!
@DefaultValue never tells if value is empty! [message #1269957] Wed, 12 March 2014 06:55 Go to next message
Eclipse UserFriend
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 07:17 Go to previous messageGo to next message
Eclipse UserFriend
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 10:09 Go to previous messageGo to next message
Eclipse UserFriend
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 04:09 Go to previous message
Eclipse UserFriend
LOL .. That explains a lot Smile

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


Current Time: Mon May 05 14:40:37 EDT 2025

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

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

Back to the top