< prev index next >

src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/MapPropertyInfo.java

Print this page




  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.sun.xml.internal.bind.v2.model.core;
  27 
  28 import java.util.Map;
  29 
  30 import javax.xml.namespace.QName;
  31 
  32 /**
  33  * Property that maps to the following schema fragment.
  34  *
  35  * <pre><xmp>
  36  * <xs:complexType>
  37  *   <xs:sequence>
  38  *     <xs:element name="entry" minOccurs="0" maxOccurs="unbounded">
  39  *       <xs:complexType>
  40  *         <xs:sequence>
  41  *           <xs:element name="key"   type="XXXX"/>
  42  *           <xs:element name="value" type="YYYY"/>
  43  *         </xs:sequence>
  44  *       </xs:complexType>
  45  *     </xs:element>
  46  *   </xs:sequence>
  47  * </xs:complexType>
  48  * </xmp></pre>
  49  *
  50  * <p>
  51  * This property is used to represent a default binding of a {@link Map} property.
  52  * ({@link Map} properties with adapters will be represented by {@link ElementPropertyInfo}.)
  53  *
  54  *
  55  * <h2>Design Thinking Led to This</h2>
  56  * <p>
  57  * I didn't like the idea of adding such a special-purpose {@link PropertyInfo} to a model.
  58  * The alternative was to implicitly assume an adapter, and have internal representation of
  59  * the Entry class ready.
  60  * But the fact that the key type and the value type changes with the parameterization makes
  61  * it very difficult to have such a class (especially inside Annotation Processing, where we can't even generate
  62  * classes.)
  63  *
  64  * @author Kohsuke Kawaguchi
  65  */
  66 public interface MapPropertyInfo<T,C> extends PropertyInfo<T,C> {
  67     /**
  68      * Gets the wrapper element name.




  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.sun.xml.internal.bind.v2.model.core;
  27 
  28 import java.util.Map;
  29 
  30 import javax.xml.namespace.QName;
  31 
  32 /**
  33  * Property that maps to the following schema fragment.
  34  *
  35  * <pre>{@code
  36  * <xs:complexType>
  37  *   <xs:sequence>
  38  *     <xs:element name="entry" minOccurs="0" maxOccurs="unbounded">
  39  *       <xs:complexType>
  40  *         <xs:sequence>
  41  *           <xs:element name="key"   type="XXXX"/>
  42  *           <xs:element name="value" type="YYYY"/>
  43  *         </xs:sequence>
  44  *       </xs:complexType>
  45  *     </xs:element>
  46  *   </xs:sequence>
  47  * </xs:complexType>
  48  * }</pre>
  49  *
  50  * <p>
  51  * This property is used to represent a default binding of a {@link Map} property.
  52  * ({@link Map} properties with adapters will be represented by {@link ElementPropertyInfo}.)
  53  *
  54  *
  55  * <h2>Design Thinking Led to This</h2>
  56  * <p>
  57  * I didn't like the idea of adding such a special-purpose {@link PropertyInfo} to a model.
  58  * The alternative was to implicitly assume an adapter, and have internal representation of
  59  * the Entry class ready.
  60  * But the fact that the key type and the value type changes with the parameterization makes
  61  * it very difficult to have such a class (especially inside Annotation Processing, where we can't even generate
  62  * classes.)
  63  *
  64  * @author Kohsuke Kawaguchi
  65  */
  66 public interface MapPropertyInfo<T,C> extends PropertyInfo<T,C> {
  67     /**
  68      * Gets the wrapper element name.


< prev index next >