XMLBinding to an element with an attribute with a fixed value [message #1037381] |
Tue, 09 April 2013 09:34  |
Eclipse User |
|
|
|
Hello,
i want to bind ValueProperty to an element which has an attribute with a fixed value.
Example XML
<xml>
<value type="int">10</value>
<value type="string">some text</value>
</xml>
Now i would like to do something like this, which always throws an
exception during element creation:
...
@Type( base = Integer.class )
@InitialValue( text = "0" )
@XmlBinding( path = "value[ @type='int' ]" )
ValueProperty PROP_NUMBER = new ValueProperty( TYPE,"Number" );
Value<Integer> getNumber();
void setNumber( String value );
void setNumber( Integer value );
@Type( base = String.class )
@InitialValue( text = "" )
@XmlBinding( path = "value[ @type='string' ]" )
ValueProperty PROP_Text = new ValueProperty( TYPE,"Text" );
Value<String> getText();
void setText( String value );
...
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03438 seconds