[ 
http://jira.codehaus.org/browse/JIBX-142?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dennis Sosnoski resolved JIBX-142.
----------------------------------

       Resolution: Fixed
    Fix Version/s: JiBX 1.1.3

No further feedback, so problem assumed to be corrected.

> Optional collection component requires a test-method , but it is ignored if 
> specified
> -------------------------------------------------------------------------------------
>
>                 Key: JIBX-142
>                 URL: http://jira.codehaus.org/browse/JIBX-142
>             Project: JiBX
>          Issue Type: Bug
>          Components: core
>    Affects Versions: JiBX 1.1
>         Environment: WinXP
>            Reporter: Marek
>         Assigned To: Dennis Sosnoski
>             Fix For: JiBX 1.1.3
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <binding forwards="false" value-style="attribute">
>   <mapping class="PropertyInteger" name="property-integer">
>     <value style="attribute" name="name" field="m_name" usage="required"/>
>     <value style="attribute" name="value" field="m_value" 
> type="java.lang.Integer" usage="required"/>
>     <value style="attribute" name="default-value" field="m_defaultValue" 
> type="java.lang.Integer" usage="required"/>               
>     <value style="element" name="comment" field="m_comment" usage="optional"/>
>     <structure name="range" field="m_range" type="RangeInteger" 
> usage="required"> 
>       <collection field="m_values" item-type="RangeItemInteger">   
>               <structure name="range-item" type="RangeItemInteger"  
> usage="optional">
>                       <value style="attribute" name="min" field="m_minValue" 
> type="java.lang.Integer" usage="optional"/>              
>                       <value style="attribute" name="max" field="m_maxValue" 
> type="java.lang.Integer" usage="optional"/>                              
>             </structure>      
>               <structure name="item" type="RangeItemInteger" 
> post-set="jibx_postSetMax2Min" test-method="isMinEqualToMax" usage="optional">
>                       <value style="attribute" name="val" field="m_minValue" 
> type="java.lang.Integer" usage="optional"/>              
>             </structure>                                     
>       </collection>   
>               </structure> 
>   </mapping>
> </binding>
>    
> JiBX binding output :
> ----------------------------
> Using bindings:
>  binding.xml
> Running binding compiler version jibx_1_1
> Warning: Property access attributes (field, get-method, set-method, 
> test-method) ignored for collection item; on structure element
>  at (line 14, col 132, in binding.xml)
> Error: Collection component must specify a test-method to distinguish from 
> next component of compatible type for marshalling; on s
> tructure element at (line 14, col 132, in binding.xml)
> Error running binding compiler
> org.jibx.runtime.JiBXException: Binding binding.xml is unusable because of 
> validation errors
>         at org.jibx.binding.Utility.loadBinding(Utility.java:346)
>         at org.jibx.binding.Utility.loadFileBinding(Utility.java:413)
>         at org.jibx.binding.Compile.compile(Compile.java:296)
>         at org.jibx.binding.Compile.main(Compile.java:385)
> Purpose is to have a collection of generic RangeItemInteger instances with 
> two fields m_minValue and m_maxValue and at the same time to be able to 
> specify a XML shortcut for the case when the range is just a single value, 
> i.e. m_minValue equals m_maxValue, instead of having to specify both 
> m_minValue and m_maxValue, e.g. :
> ...
>           <range>
>                       <range-item min="0" max="511"/>
>                       <range-item min="1000" max="1500"/>       
>                       <range-item max="1500"/>                                
>                       <range-item min="1777"/>                
>                       <range-item min="1778" max="1778"/>
>                       <item val="1779"/>      
>           </range> 
> ...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
jibx-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-devs

Reply via email to