143 *
144 * The above code fragment will map to the following schema:
145 *
146 * <pre>
147 * <xs:complexType name="Foo">
148 * <xs:sequence>
149 * <xs:element name="hashmap" type="myHashMapType"
150 * </xs:sequence>
151 * </xs:complexType>
152 * </pre>
153 *
154 * @param <BoundType>
155 * The type that JAXB doesn't know how to handle. An adapter is written
156 * to allow this type to be used as an in-memory representation through
157 * the <tt>ValueType</tt>.
158 * @param <ValueType>
159 * The type that JAXB knows how to handle out of the box.
160 *
161 * @author <ul><li>Sekhar Vajjhala, Sun Microsystems Inc.</li> <li> Kohsuke Kawaguchi, Sun Microsystems Inc.</li></ul>
162 * @see XmlJavaTypeAdapter
163 * @since JAXB 2.0
164 */
165 public abstract class XmlAdapter<ValueType,BoundType> {
166
167 /**
168 * Do-nothing constructor for the derived classes.
169 */
170 protected XmlAdapter() {}
171
172 /**
173 * Convert a value type to a bound type.
174 *
175 * @param v
176 * The value to be converted. Can be null.
177 * @throws Exception
178 * if there's an error during the conversion. The caller is responsible for
179 * reporting the error to the user through {@link javax.xml.bind.ValidationEventHandler}.
180 */
181 public abstract BoundType unmarshal(ValueType v) throws Exception;
182
183 /**
|
143 *
144 * The above code fragment will map to the following schema:
145 *
146 * <pre>
147 * <xs:complexType name="Foo">
148 * <xs:sequence>
149 * <xs:element name="hashmap" type="myHashMapType"
150 * </xs:sequence>
151 * </xs:complexType>
152 * </pre>
153 *
154 * @param <BoundType>
155 * The type that JAXB doesn't know how to handle. An adapter is written
156 * to allow this type to be used as an in-memory representation through
157 * the <tt>ValueType</tt>.
158 * @param <ValueType>
159 * The type that JAXB knows how to handle out of the box.
160 *
161 * @author <ul><li>Sekhar Vajjhala, Sun Microsystems Inc.</li> <li> Kohsuke Kawaguchi, Sun Microsystems Inc.</li></ul>
162 * @see XmlJavaTypeAdapter
163 * @since 1.6, JAXB 2.0
164 */
165 public abstract class XmlAdapter<ValueType,BoundType> {
166
167 /**
168 * Do-nothing constructor for the derived classes.
169 */
170 protected XmlAdapter() {}
171
172 /**
173 * Convert a value type to a bound type.
174 *
175 * @param v
176 * The value to be converted. Can be null.
177 * @throws Exception
178 * if there's an error during the conversion. The caller is responsible for
179 * reporting the error to the user through {@link javax.xml.bind.ValidationEventHandler}.
180 */
181 public abstract BoundType unmarshal(ValueType v) throws Exception;
182
183 /**
|