Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Sapphire » Case Insensitivity for XMLBinding
Case Insensitivity for XMLBinding [message #1715469] Mon, 23 November 2015 21:37 Go to next message
Justin Albright is currently offline Justin AlbrightFriend
Messages: 10
Registered: September 2015
Junior Member
Is it possible to make the XMLBinding case-insensitive meaning I could have

<ComponentSpec></ComponentSpec>


or

<componentspec></componentspec>


and the form be able to handle both cases?
Re: Case Insensitivity for XMLBinding [message #1715471 is a reply to message #1715469] Mon, 23 November 2015 21:50 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
There is currently no declarative way to do this (please open an enhancement request), but you can do this with a custom binding.

1. Extend StandardXmlValueBindingImpl and override read(), write() and getXmlNode() methods
2. Add @CustomXmlValueBinding( impl = YourCustomBinding.class ) to properties that need this behavior

List and element property bindings can be similarly customized.
Re: Case Insensitivity for XMLBinding [message #1715475 is a reply to message #1715471] Mon, 23 November 2015 22:32 Go to previous messageGo to next message
Justin Albright is currently offline Justin AlbrightFriend
Messages: 10
Registered: September 2015
Junior Member
Thank you. Is there something similar for attributes as well?
Re: Case Insensitivity for XMLBinding [message #1715637 is a reply to message #1715475] Tue, 24 November 2015 20:49 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
Yes, the same binding mechanism is used for attributes and elements.

[Updated on: Tue, 24 November 2015 20:50]

Report message to a moderator

Re: Case Insensitivity for XMLBinding [message #1723748 is a reply to message #1715637] Wed, 17 February 2016 15:17 Go to previous messageGo to next message
Justin Albright is currently offline Justin AlbrightFriend
Messages: 10
Registered: September 2015
Junior Member
For the top level interface element, is the use of @CustomXmlValueBinding the same and if so, where does it get placed.

For instance I have an interface named application

public interface Application extends Element {


Currently I have @XmlBinding placed above the class declaration to make it lowercase in the xml, however I need to accept both upper and lower case.

@XmlBinding( path = "application" )

public interface Application extends Element {


When I try to replace @XmlBinding with @CustomXmlValueBinding I get an error. Is there a different tag used at this level and if so what class would I need to overwrite?
Re: Case Insensitivity for XMLBinding [message #1729765 is a reply to message #1723748] Mon, 18 April 2016 17:48 Go to previous message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
Sorry, I see that this follow-up question does not have a reply. In case you haven't figured it out already, for the root element, you need to use @CustomXmlRootBinding and implement a RootElementController.
Previous Topic:Is there a way to configure the font of a label in an sdef file
Next Topic:styling with css
Goto Forum:
  


Current Time: Mon Oct 07 11:45:00 GMT 2024

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

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

Back to the top