xsd生成的java对象里的list成员变量没有set函数

例如:


        
            
        

生成的java对象里只有get函数:

/**
     * Gets the value of the networks property.
     * 
     * 

* This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a set method for the networks property. * *

* For example, to add a new item, do as follows: *

     *    getNetworks().add(newItem);
     * 
* * *

* Objects of the following type(s) are allowed in the list * {@link Network } * * */ public List getNetworks() { if (networks == null) { networks = new ArrayList(); } return this.networks; }


没有set函数,但是正如get函数的注释所示,使用方法是通过
getNetworks().add(newItem);

你可能感兴趣的:(Java)