You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jaxme-dev@ws.apache.org by jo...@apache.org on 2007/01/09 22:07:21 UTC

svn commit: r494575 [3/5] - in /webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api: ./ src/main/ src/main/java/ src/main/java/javax/ src/main/java/javax/xml/ src/main/java/javax/xml/bind/ src/main/java/javax/xml/bind/annotation/ src/main/java/javax/xml/bi...

Added: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/UnmarshalException.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/UnmarshalException.java?view=auto&rev=494575
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/UnmarshalException.java (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/UnmarshalException.java Tue Jan  9 13:07:17 2007
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.xml.bind;
+
+/** <p>The <code>MarshalException</code> is a subclass of the
+ * {@link javax.xml.bind.JAXBException} being thrown if the
+ * unmarshalling of a JAXB object failed.</p>
+ *
+ * @author JSR-31
+ * @since JAXB1.0
+ */
+@SuppressWarnings("serial") // Not provided by RI
+public class UnmarshalException extends JAXBException {
+  /** <p>Creates a new <code>UnmarshalException</code> with the specified
+   * detail message.</p>
+   * @param pMessage The detail message.
+   */
+  public UnmarshalException(String pMessage) {
+    super(pMessage);
+  }
+
+  /** <p>Creates a new <code>UnmarshalException</code> with the specified
+   * detail message and vendor specific error code.</p>
+   * @param pMessage The detail message.
+   * @param pErrorCode The error code.
+   */
+  public UnmarshalException(String pMessage, String pErrorCode) {
+    super(pMessage, pErrorCode);
+  }
+
+  /** <p>Creates a new <code>UnmarshalException</code> with the specified
+   * linked exception.</p>
+   * @param pLinkedException The linked exception.
+   */
+  public UnmarshalException(Throwable pLinkedException) {
+    super(pLinkedException);
+  }
+
+  /** <p>Creates a new <code>UnmarshalException</code> with the specified
+   * detail message and linked exception.</p>
+   * @param pMessage The detail message.
+   * @param pLinkedException The linked exception.
+   */
+  public UnmarshalException(String pMessage, Throwable pLinkedException) {
+    super(pMessage, pLinkedException);
+  }
+
+  /** <p>Creates a new <code>UnmarshalException</code> with the specified
+   * detail message, error code, and linked exception.</p>
+   * @param pMessage The detail message.
+   * @param pErrorCode The vendor specific error code.
+   * @param pLinkedException The linked exception.
+   */
+  public UnmarshalException(String pMessage, String pErrorCode,
+                           Throwable pLinkedException) {
+    super(pMessage, pErrorCode, pLinkedException);
+  }
+}

Added: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/Unmarshaller.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/Unmarshaller.java?view=auto&rev=494575
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/Unmarshaller.java (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/Unmarshaller.java Tue Jan  9 13:07:17 2007
@@ -0,0 +1,489 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.xml.bind;
+
+import java.io.File;
+import java.io.InputStream;
+import java.io.Reader;
+import java.net.URL;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+import javax.xml.bind.attachment.AttachmentUnmarshaller;
+import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.transform.Source;
+import javax.xml.validation.Schema;
+
+import org.w3c.dom.Node;
+import org.xml.sax.InputSource;
+
+/** <p>A <code>Unmarshaller</code> is the opposite of the {@link Marshaller}:
+ * It takes as input XML in either of several representations (byte or
+ * character stream, DOM node, or a series of SAX events) and returns
+ * a JAXB object with the same contents.</p>
+ * <p>If the JAXB user demands, the <code>Unmarshaller</code> may also
+ * validate the content tree that it sees.</p>
+ *
+ * @author JSR-31
+ * @since JAXB1.0
+ * @see JAXBContext
+ * @see Marshaller
+ * @see Validator
+ */
+public interface Unmarshaller {
+    /**
+     * An instance of this class may be registered as
+     * an event listener on the {@link Marshaller}.
+     * @since JAXB 2.0
+     */
+    public static abstract class Listener {
+        /**
+         * This method is invoked before unmarshalling the JAXB object
+         * {@code pTarget}.
+         * @param pTarget A JAXB object, which has just been created.
+         *   No attributes have been set or child elements have been
+         *   added.
+         * @param pParent The parent object of {@code pTarget}, to
+         *   which {@link pTarget} is being added as a child.
+         */
+        public void beforeUnmarshal(
+                @SuppressWarnings("unused") Object pTarget,
+                @SuppressWarnings("unused") Object pParent) {
+            // Does nothing.
+        }
+
+        /**
+         * This method is invoked after unmarshalling the JAXB object
+         * {@code pTarget}.
+         * @param pTarget A JAXB object with its attributes set (the
+         *   exception being IDREF attributes) and its child elements
+         *   added.
+         * @param pParent The parent object of {@code pTarget}, to
+         *   which {@link pTarget} is being added as a child. (It
+         *   hasn't been added yet.)
+         */
+        public void afterUnmarshal(
+                @SuppressWarnings("unused") Object pTarget,
+                @SuppressWarnings("unused") Object parent) {
+            // Does nothing.
+        }
+    }
+
+    /** <p>This method takes opens the given file <code>pFile</code>
+     * for input. The Unmarshaller reads the byte stream contained in
+     * the file and converts it into an equivalent JAXB object.</p>
+     * @param pFile The file being read.
+     * @return The JAXB object read from the file.
+     * @throws JAXBException An unexpected problem (for example an
+     *   IOException) occurred.
+     * @throws UnmarshalException The JAXB object is invalid or could
+     *   not be read from the byte stream for similar reasons.
+     * @throws IllegalArgumentException The parameter was null.
+     */
+    Object unmarshal(File pFile) throws JAXBException;
+
+    /**
+     * <p>The Unmarshaller reads the given byte stream
+     * and converts it into an equivalent JAXB object.</p>
+     * @param pStream The stream being read.
+     * @return The JAXB object read from the byte stream.
+     * @throws JAXBException An unexpected problem (for example an
+     *   IOException) occurred.
+     * @throws UnmarshalException The JAXB object is invalid or could
+     *   not be read from the byte stream for similar reasons.
+     * @throws IllegalArgumentException The parameter was null.
+     */
+    Object unmarshal(InputStream pStream) throws JAXBException;
+
+    /**
+     * <p>The Unmarshaller reads the given character stream
+     * and converts it into an equivalent JAXB object.</p>
+     * @param pReader The stream being read.
+     * @return The JAXB object read from the character stream.
+     * @throws JAXBException An unexpected problem (for example an
+     *   IOException) occurred.
+     * @throws UnmarshalException The JAXB object is invalid or could
+     *   not be read from the byte stream for similar reasons.
+     * @throws IllegalArgumentException The parameter was null.
+     */
+    Object unmarshal(Reader pReader) throws JAXBException;
+
+    /** <p>This method takes connects to the given <code>pURL</code>
+     * and opens a byte stream for input. The Unmarshaller reads the
+     * byte stream and converts it into an equivalent JAXB object.</p>
+     * @param pURL The URL being read.
+     * @return The JAXB object read from the URL.
+     * @throws JAXBException An unexpected problem (for example an
+     *   IOException) occurred.
+     * @throws UnmarshalException The JAXB object is invalid or could
+     *   not be read from the byte stream for similar reasons.
+     * @throws IllegalArgumentException The parameter was null.
+     */
+    Object unmarshal(URL pURL) throws JAXBException;
+
+    /** <p>The Unmarshaller reads the byte stream or character
+     * stream referred by the {@link org.xml.sax.InputSource}
+     * and converts it into an equivalent JAXB object.</p>
+     * @param pSource The {@link InputSource} referring to a byte or
+     *   character stream. It is recommended, that the system ID is
+     *   set. This may be required, if the XML in the stream refers
+     *   to external entities.
+     * @return The JAXB object read from the byte or character stream.
+     * @throws JAXBException An unexpected problem (for example an
+     *   IOException) occurred.
+     * @throws UnmarshalException The JAXB object is invalid or could
+     *   not be read from the byte stream for similar reasons.
+     * @throws IllegalArgumentException The parameter was null.
+     */
+    Object unmarshal(InputSource pSource) throws JAXBException;
+
+    /**
+     * <p>The Unmarshaller converts the given node into an equivalent
+     * JAXB object.</p>
+     * @param pNode The node to convert. The JAXB provider must support
+     *   documents and elements. Other node types may not work
+     *   (document fragments) or cannot work (attributes, text nodes,
+     *   and so on).
+     * @return The JAXB object read from the DOM node.
+     * @throws JAXBException An unexpected problem occurred.
+     * @throws UnmarshalException The JAXB object is invalid or could
+     *   not be read for similar reasons.
+     * @throws IllegalArgumentException The parameter was null.
+     */
+    Object unmarshal(Node pNode) throws JAXBException;
+
+    /**
+     * <p>The Unmarshaller converts the given node into an equivalent
+     * JAXB object.</p>
+     * @param pNode The node to convert. The JAXB provider must support
+     *   documents and elements. Other node types may not work
+     *   (document fragments) or cannot work (attributes, text nodes,
+     *   and so on).
+     * @param pType The result objects type.
+     * @return The JAXB object read from the DOM node.
+     * @throws JAXBException An unexpected problem occurred.
+     * @throws UnmarshalException The JAXB object is invalid or could
+     *   not be read for similar reasons.
+     * @throws IllegalArgumentException The parameter was null.
+     * @since JAXB 2.0
+     */
+    <T> JAXBElement<T> unmarshal(Node pNode, Class<T> pType) throws JAXBException;
+
+    /** <p>The Unmarshaller reads the XML representation from the given
+     * {@link Source} and converts it into an equivalent JAXB object.</p>
+     * <p>The JAXB provider must support at least
+     * {@link javax.xml.transform.sax.SAXSource},
+     * {@link javax.xml.transform.dom.DOMSource}, and
+     * {@link javax.xml.transform.stream.StreamSource}. A possible
+     * implementation could validate whether the argument is actually
+     * an instance of these subinterfaces. If so, it might simply
+     * act like
+     * {@link #getUnmarshallerHandler()},
+     * {@link #unmarshal(org.w3c.dom.Node)},
+     * {@link #unmarshal(java.io.InputStream)}, or
+     * {@link #unmarshal(org.xml.sax.InputSource)}, respectively.</p>
+     * <p><em>Note</em>: If you are not using the standard JAXP
+     * mechanism for obtaining an {@link org.xml.sax.XMLReader},
+     * then you might create your own SAX parser and invoke the
+     * <code>pSource</code> arguments
+     * {@link javax.xml.transform.sax.SAXSource#setXMLReader(org.xml.sax.XMLReader)}.
+     * The JAXB provider will detect and use your SAX parser.</p>
+     *
+     * @return The JAXB object read from the DOM node.
+     * @param pSource The {@link Source} being read.
+     * @throws JAXBException An unexpected problem occurred.
+     * @throws UnmarshalException The JAXB object is invalid or could
+     *   not be read for similar reasons.
+     * @throws IllegalArgumentException The parameter was null.
+     */
+    Object unmarshal(Source pSource) throws JAXBException;
+
+    /**
+     * <p>The Unmarshaller reads the XML representation from the given
+     * {@link Source} and converts it into an equivalent JAXB object.</p>
+     * <p>The JAXB provider must support at least
+     * {@link javax.xml.transform.sax.SAXSource},
+     * {@link javax.xml.transform.dom.DOMSource}, and
+     * {@link javax.xml.transform.stream.StreamSource}. A possible
+     * implementation could validate whether the argument is actually
+     * an instance of these subinterfaces. If so, it might simply
+     * act like
+     * {@link #getUnmarshallerHandler()},
+     * {@link #unmarshal(org.w3c.dom.Node)},
+     * {@link #unmarshal(java.io.InputStream)}, or
+     * {@link #unmarshal(org.xml.sax.InputSource)}, respectively.</p>
+     * <p><em>Note</em>: If you are not using the standard JAXP
+     * mechanism for obtaining an {@link org.xml.sax.XMLReader},
+     * then you might create your own SAX parser and invoke the
+     * <code>pSource</code> arguments
+     * {@link javax.xml.transform.sax.SAXSource#setXMLReader(org.xml.sax.XMLReader)}.
+     * The JAXB provider will detect and use your SAX parser.</p>
+     *
+     * @return The JAXB object read from the DOM node.
+     * @param pSource The {@link Source} being read.
+     * @param pType The actual result objects type.
+     * @throws JAXBException An unexpected problem occurred.
+     * @throws UnmarshalException The JAXB object is invalid or could
+     *   not be read for similar reasons.
+     * @throws IllegalArgumentException The parameter was null.
+     * @since JAXB 2.0
+     */
+    <T> JAXBElement<T> unmarshal(Source pSource, Class<T> pType) throws JAXBException;
+
+    /**
+     * <p>The Unmarshaller reads an XML element from the given
+     * {@link XMLStreamReader}.</p>
+     * @param pReader The event stream to read.
+     * @return The JAXB object read from the event stream.
+     * @throws JAXBException An unexpected problem occurred.
+     * @throws UnmarshalException The JAXB object is invalid or could
+     *   not be read for similar reasons.
+     * @throws IllegalArgumentException The parameter was null.
+     * @throws IllegalStateException The readers current event
+     *   isn't {@link XMLStreamConstants#START_DOCUMENT}, or
+     *   {@link XMLStreamConstants#START_ELEMENT}.
+     * @since JAXB 2.0
+     */
+    Object unmarshal(XMLStreamReader pReader) throws JAXBException;
+
+    /**
+     * <p>The Unmarshaller reads an XML element from the given
+     * {@link XMLStreamReader}.</p>
+     * @param pReader The event stream to read.
+     * @param pType The actual result objects type.
+     * @return The JAXB object read from the event stream.
+     * @throws JAXBException An unexpected problem occurred.
+     * @throws UnmarshalException The JAXB object is invalid or could
+     *   not be read for similar reasons.
+     * @throws IllegalArgumentException The parameter was null.
+     * @throws IllegalStateException The readers current event
+     *   isn't {@link XMLStreamConstants#START_DOCUMENT}, or
+     *   {@link XMLStreamConstants#START_ELEMENT}.
+     * @since JAXB 2.0
+     */
+    <T> JAXBElement<T> unmarshal(XMLStreamReader pReader, Class<T> pType) throws JAXBException;
+
+    /**
+     * <p>The Unmarshaller reads an XML element from the given
+     * {@link XMLEventReader}.</p>
+     * @param pReader The event stream to read.
+     * @return The JAXB object read from the event stream.
+     * @throws JAXBException An unexpected problem occurred.
+     * @throws UnmarshalException The JAXB object is invalid or could
+     *   not be read for similar reasons.
+     * @throws IllegalArgumentException The parameter was null.
+     * @throws IllegalStateException The readers current event
+     *   isn't {@link XMLStreamConstants#START_DOCUMENT}, or
+     *   {@link XMLStreamConstants#START_ELEMENT}.
+     * @since JAXB 2.0
+     */
+    Object unmarshal(XMLEventReader pReader) throws JAXBException;
+
+    /**
+     * <p>The Unmarshaller reads an XML element from the given
+     * {@link XMLEventReader}.</p>
+     * @param pReader The event stream to read.
+     * @param pType The actual result objects type.
+     * @return The JAXB object read from the event stream.
+     * @throws JAXBException An unexpected problem occurred.
+     * @throws UnmarshalException The JAXB object is invalid or could
+     *   not be read for similar reasons.
+     * @throws IllegalArgumentException The parameter was null.
+     * @throws IllegalStateException The readers current event
+     *   isn't {@link XMLStreamConstants#START_DOCUMENT}, or
+     *   {@link XMLStreamConstants#START_ELEMENT}.
+     * @since JAXB 2.0
+     */
+    <T> JAXBElement<T> unmarshal(XMLEventReader pReader, Class<T> pType) throws JAXBException;
+
+    /** <p>Returns a SAX 2 {@link org.xml.sax.ContentHandler}, which is
+     * able to parse a SAX event stream and convert it into a JAXB
+     * object. This is particularly useful in a stack of SAX
+     * handlers. (Think of Apache Cocoon.)</p>
+     * <p><em>Note</em>: The JAXB provider may choose to return the
+     * same handler again, if the method is invoked more than once.
+     * In other words, if you need to have multiple handlers (for
+     * example, because you have multiple threads), then you should
+     * create multiple <code>Unmarshallers</code>.</p>
+     */
+    UnmarshallerHandler getUnmarshallerHandler() throws JAXBException;
+
+    /** <p>Sets whether the <code>Unmarshaller</code> is validating
+     * the objects that it reads. The default is false.</p>
+     * <p><em>Note</em>: A validating unmarshaller will rarely use
+     * a validating SAX parser by default! It does so, because the
+     * SAX parsers validation and the Unmarshallers builtin
+     * validation would most probably validate the same things,
+     * resulting in no additional safety at the cost of wasting
+     * performance. Second, a SAX parser is not always in use.
+     * For example, you do not need a parser when
+     * converting a DOM Node. If you insist in a validating XML
+     * parser, then you should create your own
+     * {@link org.xml.sax.XMLReader} and use the method
+     * {@link #unmarshal(javax.xml.transform.Source)}.</p>
+     * @param pValidating Whether the <code>Unmarshaller</code> should validate
+     *   or not.
+     * @throws JAXBException Setting the property failed.
+     * @deprecated Since JAXB 2.0, it is recommended to use the
+     *   JAXP 1.3 validation framework. See {@link #setSchema(Schema)}
+     *   for registering or {@link #getSchema()} for reading a schema
+     *   object.
+     */
+    void setValidating(boolean pValidating) throws JAXBException;
+
+    /** <p>Sets whether the <code>Unmarshaller</code> is validating
+     * the objects that it reads. The default is false.</p>
+     * @see #setValidating(boolean)
+     * @return True, if the <code>Unmarshaller</code> is validating the objects
+     *   that it reads, false otherwise.
+     * @throws JAXBException Fetching the property value failed.
+     * @deprecated Since JAXB 2.0, it is recommended to use the
+     *   JAXP 1.3 validation framework. See {@link #setSchema(Schema)}
+     *   for registering or {@link #getSchema()} for reading a schema
+     *   object.
+     */
+    boolean isValidating() throws JAXBException;
+
+    /** <p>An application may customize the Unmarshallers behaviour
+     * in case of validation problems by supplying a custom handler
+     * for validation events. The default handler will trigger an
+     * exception in case of errors and fatal errors.</p>
+     * @param pHandler The custom event handler or null to restore
+     *   the default event handler.
+     * @throws JAXBException Setting the handler failed.
+     */
+    void setEventHandler(ValidationEventHandler pHandler) throws JAXBException;
+
+    /** <p>If the JAXB application has registered a custom handler
+     * for validation events, returns that handler. Otherwise returns
+     * the default handler, which is triggering an exception in case
+     * of errors and fatal errors.</p>
+     */
+    ValidationEventHandler getEventHandler() throws JAXBException;
+
+    /** <p>Sets the unmarshaller property <code>pName</code> to the value
+     * <code>pValue</code>. Note, that the value type depends on the
+     * property being set.</p>
+     * @param pName The property name.
+     * @throws PropertyException An error occurred while processing the property.
+     * @throws IllegalArgumentException The name parameter was null.
+     */
+    void setProperty(String pName, Object pValue) throws PropertyException;
+
+    /** <p>Returnss the unmarshaller property <code>pName</code> to the value
+     * <code>pValue</code>. Note, that the value type depends on the
+     * property being set.</p>
+     * @param pName The property name.
+     * @throws PropertyException An error occurred while processing the property.
+     * @throws IllegalArgumentException The name parameter was null.
+     */
+    Object getProperty(String pName) throws PropertyException;
+    /**
+     * Sets an adapter for conversion of Java/XML types.
+     * Shortcut for
+     * <pre>setAdapter(adapter.getClass(),adapter)</pre>
+     *
+     * @see #setAdapter(Class,XmlAdapter)
+     * @throws IllegalArgumentException The parameter is null.
+     * @throws UnsupportedOperationException The marshaller
+     *   doesn't support adapters.
+     * @since JAXB 2.0
+     */
+    void setAdapter(XmlAdapter<?,?> adapter );
+
+    /**
+     * Sets an adapter for conversion of Java/XML types.
+     * @param pType The adapter type, as referenced by
+     *   {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter#value()}.
+     * @param pAdapter The adapter instance or null to remove the adapter
+     *   for {@code pType}.
+     * @throws IllegalArgumentException The type parameter is null.
+     * @throws UnsupportedOperationException The marshaller
+     *   doesn't support adapters.
+     * @since JAXB 2.0
+     */
+    public <A extends XmlAdapter<?,?>> void setAdapter(Class<A> pType, A pAdapter);
+
+    /**
+     * Returns the adapter, which is currently registered for the
+     * given type.
+     * @param pType The adapter type, as referenced by
+     *   {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter#value()}.
+     * @return Currently registered adapter, if any, or null.
+     *
+     * @throws IllegalArgumentException The type parameter is null.
+     * @throws UnsupportedOperationException The marshaller
+     *   doesn't support adapters.
+     * @since JAXB 2.0
+     */
+    public <A extends XmlAdapter<?,?>> A getAdapter(Class<A> pType);
+
+    /**
+     * Sets an attachment handler, which allows to unmarshal parts
+     * of the XML document as binary attachments.
+     * @throws IllegalStateException The unmarshaller is currently in use.
+     */
+    void setAttachmentUnmarshaller(AttachmentUnmarshaller au);
+
+    /**
+     * Returns an attachment handler, which allows to unmarshal parts
+     * of the XML document as binary attachments.
+     */
+    AttachmentUnmarshaller getAttachmentUnmarshaller();
+
+    /**
+     * Sets a schema object, which is being used for validating
+     * the source of an unmarshal operation.
+     * @param pSchema A non-null schema object for enabling validation
+     *   or null to disable validation.
+     * @throws UnsupportedOperationException The {@link Unmarshaller}
+     *   doesn't support JAXP 1.3 validation.
+     * @since JAXB 2.0
+     */
+    void setSchema(Schema pSchema);
+
+    /**
+     * Returns a schema object, which is being used for validating
+     * the source of an unmarshal operation.
+     * @return A non-null schema object, if validation is enabled,
+     *   or null, if validation is disabled.
+     * @throws UnsupportedOperationException The {@link Unmarshaller}
+     *   doesn't support JAXP 1.3 validation.
+     * @since JAXB 2.0
+     */
+    Schema getSchema();
+
+    /**
+     * Registers an event listener, which is being invoked before
+     * and after unmarshalling JAXB objects. If there already is
+     * a listener registered, the current one will be replaced.
+     * @param pListener The listener to register or null to disable
+     *   unmarshalling events.
+     * @since JAXB 2.0
+     */
+    void setListener(Listener pListener);
+
+    /**
+     * Returns the currently registered event listener, if any,
+     * or null. This event listener is invoked before and after
+     * unmarshalling JAXB objects.
+     * @return The currently registered event listener, if any, or null.
+     * @since JAXB 2.0
+     */
+    public Listener getListener();
+}

Added: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/UnmarshallerHandler.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/UnmarshallerHandler.java?view=auto&rev=494575
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/UnmarshallerHandler.java (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/UnmarshallerHandler.java Tue Jan  9 13:07:17 2007
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.xml.bind;
+
+import org.xml.sax.ContentHandler;
+
+
+/** <p>This interface is the SAX {@link org.xml.sax.ContentHandler}
+ * representation of an {@link javax.xml.bind.Unmarshaller}, as
+ * returned by
+ * {@link javax.xml.bind.Unmarshaller#getUnmarshallerHandler()}.
+ * It can be embedded into a stack of SAX handlers, for example
+ * within Apache Cocoon.</p>
+ * <p>The <code>UnmarshallerHandler</code> is reusable: The
+ * <code>startDocument()</code> method is expected to perform
+ * a reinitialization. Like most other SAX handlers, the
+ * <code>UnmarshallerHandler</code> is never thread safe.</p>
+ *
+ * @author JSR-31
+ * @since JAXB1.0
+ */
+public interface UnmarshallerHandler extends ContentHandler {
+  /** <p>Returns the unmarshalled object. This method may be invoked
+   * after an <code>endDocument()</code> event only. An
+   * {@link IllegalStateException} is thrown otherwise.
+   * @return The unmarshalled object, never null. (An
+   *   {@link IllegalStateException} is thrown, if no data is
+   *   available.
+   * @throws JAXBException An error occurred. Note, that the
+   *   {@link UnmarshallerHandler} throws a
+   *   {@link org.xml.sax.SAXException} if an error occurs while
+   *   unmarshalling the object. In such cases the
+   *   {@link JAXBException} is typically nested within the
+   *   {@link org.xml.sax.SAXException}.
+   * @throws IllegalStateException An <code>endDocument()</code>
+   *   event has not yet been seen and no data is available.
+   */
+  public Object getResult() throws JAXBException, IllegalStateException;
+}

Added: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/ValidationEvent.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/ValidationEvent.java?view=auto&rev=494575
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/ValidationEvent.java (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/ValidationEvent.java Tue Jan  9 13:07:17 2007
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.xml.bind;
+
+/** <p>An instance of <code>ValidationEvent</code> indicates some
+ * error condition, which occurred when validating a JAXB object.
+ * The purpose of the {@link ValidationEventHandler} is to
+ * customize the reply on instances of <code>ValidationEvent</code>.
+ * The default event handler will throw an exception in case of
+ * events, but application specific validation event handlers need
+ * not do the same.</p>
+ * 
+ * @see Validator
+ * @see ValidationEventHandler
+ * @since JAXB1.0
+ * @author JSR-31
+ */
+public interface ValidationEvent {
+  /** <p>In contrast to errors or fatal errors, this indicates an
+   * event which can possibly be ignored. This constant has the
+   * value 0. See section 1.2 of the W3C XML 1.0 Recommendation for
+   * details.</p>
+   * @see #ERROR
+   * @see #FATAL_ERROR
+   * @see #getSeverity()
+   */
+  public static final int WARNING = 0;
+
+  /** <p>This value indicates an "error", as specified by section
+   * 1.2 of the W3C XML 1.0 Recommendation. The constant value is
+   * 1.</p>
+   * @see #WARNING
+   * @see #FATAL_ERROR
+   * @see #getSeverity()
+   */
+  public static final int ERROR = 1;
+
+  /** <p>This value indicates a "fatal error", as specified by section
+   * 1.2 of the W3C XML 1.0 Recommendation. The constant value is
+   * 2.</p>
+   * @see #WARNING
+   * @see #ERROR
+   * @see #getSeverity()
+   */
+  public static final int FATAL_ERROR = 2;
+
+  /** <p>Returns the events severity: Either of
+   * {@link #WARNING}, {@link #ERROR}, or {@link #FATAL_ERROR}.</p>
+   * @return Returns the events severity.
+   */
+  public int getSeverity();
+
+  /** <p>Returns a textual description of the event.</p>
+   */
+  public java.lang.String getMessage();
+
+  /** <p>Returns a {@link Throwable} related to the event. In most cases
+   * an exception causing the event.</p>
+   */
+  public java.lang.Throwable getLinkedException();
+
+  /** <p>Returns a description of the location, where the event
+   * occurred.</p>
+   */
+  public ValidationEventLocator getLocator();
+}

Added: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/ValidationEventHandler.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/ValidationEventHandler.java?view=auto&rev=494575
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/ValidationEventHandler.java (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/ValidationEventHandler.java Tue Jan  9 13:07:17 2007
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.xml.bind;
+
+/** <p>An instance of <code>ValidationEventHandler</code> allows
+ * to customize the reply to instances of
+ * {@link javax.xml.bind.ValidationEvent}. By default, there is
+ * a standard <code>ValidationEventHandler</code>, converting
+ * errors and fatal errors in Exceptions.</p>
+ * <p>The JAXB user creates instances of <code>ValidationEventHandler</code>
+ * and registers them with the {@link Marshaller}, {@link Unmarshaller},
+ * or {@link Validator}. The JAXB provider is required not to throw
+ * exceptions directly, but to convert all detected problems into events,
+ * which are fired on the <code>ValidationEventHandler</code>.</p>
+ *
+ * @since JAXB1.0
+ * @author JSR-31
+ * @see Marshaller
+ * @see Unmarshaller
+ * @see javax.xml.bind.ValidationEvent
+ */
+public interface ValidationEventHandler {
+   /** <p>The <code>handleEvent</code> method is invoked by the
+    * JAXB provider, if a problem was found. The events
+    * {@link javax.xml.bind.ValidationEventLocator} may be
+    * used to locate the source of the problem.</p>
+    *
+    * @param pEvent The event being reported to the JAXB user.
+    * @return True as an indicator that the JAXB provider should
+    *   attempt to continue its current operation. (Marshalling,
+    *   Unmarshalling, Validating) This will not always work.
+    *   In particular, you cannot expect that the operation
+    *   continues, if a fatal error was reported. False to
+    *   indicate that the JAXB provider should terminate the
+    *   operation and through an appropriate exception.
+    * @throws IllegalArgumentException The parameter is null.
+    */
+   public boolean handleEvent(ValidationEvent pEvent);
+}

Added: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/ValidationEventLocator.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/ValidationEventLocator.java?view=auto&rev=494575
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/ValidationEventLocator.java (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/ValidationEventLocator.java Tue Jan  9 13:07:17 2007
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.xml.bind;
+
+import org.w3c.dom.Node;
+
+/** <p>The <code>ValidationEventLocator</code> is an abstract
+ * description of the place where a {@link javax.xml.bind.ValidationEvent}
+ * occurred.</p>
+ * <p>Depending on the source or target media (Unmarshalling, or Unmarshalling)
+ * or the object being validated, you will most probably find that different
+ * fields of the <code>ValidationEventHandler</code> are set. For example,
+ * if you are using a {@link org.xml.sax.ContentHandler}, you will most
+ * probably find that those fields are set, which are common to a
+ * {@link org.xml.sax.Locator}.</p>
+ *
+ * @see javax.xml.bind.ValidationEvent
+ * @since JAXB1.0
+ * @author JSR-31
+ */
+public interface ValidationEventLocator {
+  /** <p>Returns a URL related to the validation event, if available.
+   * For example, when parsing an {@link org.xml.sax.InputSource}, this
+   * might be the URL given by {@link org.xml.sax.InputSource#getSystemId()}.</p>
+   * @return The validation event URL, if available, or null.
+   */
+  public java.net.URL getURL();
+
+  /** <p>Returns a byte offset related to the validation event, if
+   * available. For example, when parsing an {@link java.io.InputStream},
+   * this might be the position where the event occurred.</p>
+   * @return Byte offset, if available, or -1.
+   */
+  public int getOffset();
+
+  /** <p>Returns a line number related to the validation event, if
+   * available. For example, when parsing an {@link java.io.InputStream},
+   * this might be the line, in which the event occurred.</p>
+   * @return Line number, if available, or -1.
+   */
+  public int getLineNumber();
+
+  /** <p>Returns a column number related to the validation event, if
+   * available. For example, when parsing an {@link java.io.InputStream},
+   * this might be the column, in which the event occurred.</p>
+   * @return Column number, if available, or -1.
+   */
+  public int getColumnNumber();
+
+  /** <p>Returns an object in the JAXB objects content tree related
+   * to the validation event. Usually this is the invalid object or
+   * child object.</p>
+   * @return Part of a JAXB object tree, if available, or null.
+   */
+  public java.lang.Object getObject();
+
+  /** <p>Returns a DOM node related to the validation event. For
+   * example, this might be an element node with a missing attribute.
+   * It might as well be an attribute node with an invalid value.</p>
+   * @return Invalid node, if available, or null.
+   */
+   public Node getNode();
+}

Added: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/ValidationException.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/ValidationException.java?view=auto&rev=494575
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/ValidationException.java (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/ValidationException.java Tue Jan  9 13:07:17 2007
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.xml.bind;
+
+/** <p>The <code>MarshalException</code> is a subclass of the
+ * {@link javax.xml.bind.JAXBException} being thrown if the
+ * validation of a JAXB object failed.</p>
+ *
+ * @author JSR-31
+ * @since JAXB1.0
+ */
+@SuppressWarnings("serial") // Not provided by RI
+public class ValidationException extends JAXBException {
+  /** <p>Creates a new <code>ValidationException</code> with the specified
+   * detail message.</p>
+   * @param pMessage The detail message.
+   */
+  public ValidationException(String pMessage) {
+    super(pMessage);
+  }
+
+  /** <p>Creates a new <code>ValidationException</code> with the specified
+   * detail message and vendor specific error code.</p>
+   * @param pMessage The detail message.
+   * @param pErrorCode The error code.
+   */
+  public ValidationException(String pMessage, String pErrorCode) {
+    super(pMessage, pErrorCode);
+  }
+
+  /** <p>Creates a new <code>ValidationException</code> with the specified
+   * linked exception.</p>
+   * @param pLinkedException The linked exception.
+   */
+  public ValidationException(Throwable pLinkedException) {
+    super(pLinkedException);
+  }
+
+  /** <p>Creates a new <code>ValidationException</code> with the specified
+   * detail message and linked exception.</p>
+   * @param pMessage The detail message.
+   * @param pLinkedException The linked exception.
+   */
+  public ValidationException(String pMessage, Throwable pLinkedException) {
+    super(pMessage, pLinkedException);
+  }
+
+  /** <p>Creates a new <code>ValidationException</code> with the specified
+   * detail message, error code, and linked exception.</p>
+   * @param pMessage The detail message.
+   * @param pErrorCode The vendor specific error code.
+   * @param pLinkedException The linked exception.
+   */
+  public ValidationException(String pMessage, String pErrorCode,
+                           Throwable pLinkedException) {
+    super(pMessage, pErrorCode, pLinkedException);
+  }
+}

Added: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/Validator.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/Validator.java?view=auto&rev=494575
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/Validator.java (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/Validator.java Tue Jan  9 13:07:17 2007
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.xml.bind;
+
+
+/**
+ * <p>As of JAXB 2.0, this class is deprecated and optional.</p>
+ * <p>A <code>Validator</code> may be used to decide, whether
+ * a JAXB object is valid or not. If it is not, the JAXB user
+ * may decide to trigger an exception or not (via the
+ * {@link javax.xml.bind.ValidationEventHandler} and he may
+ * receive information on the problems location (via the
+ * event handlers {@link javax.xml.bind.ValidationEventLocator}.</p>
+ * <p>A Validator may be present implicitly, invoked by the
+ * Unmarshaller. See {@link javax.xml.bind.Unmarshaller#setValidating(boolean)} for
+ * more information on that.</p>
+ * @since JAXB1.0
+ * @author JSR-31
+ * @see ValidationEventHandler
+ * @see ValidationEvent
+ * @deprecated In JAXB 2.0 the validator has been deprecated.
+ *   It is now recommended to use the JAXP 1.3 validator framework.
+ */
+public interface Validator {
+    /** <p>Registers an event handler that shall be invoked for
+     * notifications on problems detected by the <code>Validator</code>.
+     * If this method is not invoked, there is a default event handler.
+     * The default event handler will trigger an exception for
+     * errors and fatal errors.</p>
+     *
+     * @param pHandler The event handler being notified or null
+     *   to restore the default event handler.
+     * @throws JAXBException Setting the event handler failed.
+     * @deprecated since JAXB 2.0
+     */
+    public void setEventHandler(ValidationEventHandler pHandler) throws JAXBException;
+
+    /** <p>Returns an event handler that shall be invoked for
+     * notifications on problems detected by the <code>Validator</code>.
+     * If no specific event handler was set, returns the default
+     * event handler. The default event handler will trigger an
+     * exception for errors and fatal errors.</p>
+     *
+     * @throws JAXBException Getting the event handler failed.
+     * @return The event handler previously set or the default
+     *   handler.
+     * @deprecated since JAXB 2.0
+     */
+    public ValidationEventHandler getEventHandler() throws JAXBException;
+
+    /** <p>Validates the given JAXB object, invoking its error handler
+     * for any problems it detects. Detected problems may cause exceptions,
+     * for example, if the event handlers
+     * {@link ValidationEventHandler#handleEvent(ValidationEvent)}
+     * method returns false.</p>
+     *
+     * @param pObject The JAXB object being validated.
+     * @throws JAXBException An unexpected problem occurred during
+     *   validation
+     * @throws ValidationException It was detected, that the
+     *   object is invalid.
+     * @throws IllegalArgumentException The parameter was null.
+     * @see #validateRoot(Object)
+     * @deprecated since JAXB 2.0
+     */
+    public boolean validate(Object pObject) throws JAXBException;
+
+    /** <p>Validates the given JAXB object, but not its child
+     * elements.</p>
+     *
+     * @param pObject The JAXB object being validated.
+     * @throws JAXBException An unexpected problem occurred during
+     *   validation
+     * @throws ValidationException It was detected, that the
+     *   object is invalid.
+     * @throws IllegalArgumentException The parameter was null.
+     * @see #validate(Object)
+     * @deprecated since JAXB 2.0
+     */ 
+    public boolean validateRoot(Object pObject) throws JAXBException;
+
+    /** <p>Sets the <code>Validator</code> property <code>pName</code>
+     * to <code>pValue</code>.</p>
+     * <p><em>Note</em>: The values type depends on the property name.</p>
+     *
+     * @param pName The property name.
+     * @param pValue The property value.
+     * @throws PropertyException Setting the property failed.
+     * @throws IllegalArgumentException The <code>pName</code> parameter was null.
+     * @deprecated since JAXB 2.0
+     */
+    public void setProperty(String pName, Object pValue) throws PropertyException;
+
+    /** <p>Returns the marshallers property <code>pName</code>.</p>
+     * <p><em>Note</em>: The values type depends on the property name.</p>
+     *
+     * @param pName The property name.
+     * @return The property value.
+     * @throws PropertyException Fetching the property failed.
+     * @throws IllegalArgumentException The parameter was null.
+     * @deprecated since JAXB 2.0
+     */
+    public java.lang.Object getProperty(String pName) throws PropertyException;
+}

Added: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/DomHandler.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/DomHandler.java?view=auto&rev=494575
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/DomHandler.java (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/DomHandler.java Tue Jan  9 13:07:17 2007
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.xml.bind.annotation;
+
+import javax.xml.bind.ValidationEventHandler;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.dom.DOMSource;
+
+/**
+ * Objects implementing this interface are used to
+ * implement the {@link XmlAnyElement} annotation.
+ * Basically, the {@link DomHandler} is a factory for objects
+ * like {@link DOMResult} or {@link DOMSource}. Using the
+ * factory allows to be independent of the DOM API.
+ * @since JAXB2.0
+ */
+public interface DomHandler<ElementT,ResultT extends Result> {
+    /**
+     * Called by the JAXB provider, if he wants to convert
+     * a part of the document into a DOM representation.
+     * The created object will receive this part. Finally,
+     * the JAXB provider will invoke {@link #getElement(Result)}
+     * on the created object in order to receive the
+     * DOM element.
+     * @param errorHandler The DOM implementation is responsible
+     *   for calling the given error handler. The error handler
+     *   must not be null.
+     * @return The created result object or null, if an error has
+     *   occurred. If so, the error must have been reported to the
+     *   error handler.
+     */
+    ResultT createUnmarshaller( ValidationEventHandler errorHandler );
+
+    /**
+     * Calling this method finishs use of the result object,
+     * which has been created by {@link #createUnmarshaller(ValidationEventHandler)}.
+     * @param rt The result object, which has been created by
+     *     {@link #createUnmarshaller(ValidationEventHandler)}.
+     * @return The created XML element or null, if an error has occurred.
+     *     If so, then the error must have been reported to the
+     *     error handler.
+     */
+    ElementT getElement(ResultT rt);
+
+    /**
+     * Called by the JAXB provider, if he wants to marshal
+     * the DOM representation of an element into an XML document.
+     * @param errorHandler Called if any errors occur during the
+     *   marshalling process.
+     * @return A valid {@link Source} object, which may be embedded
+     *   into a larger XML document or null, if an error has occurred.
+     *   If so, the error must have been reported to the error handler.
+     */
+    Source marshal( ElementT n, ValidationEventHandler errorHandler );
+}

Added: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/W3CDomHandler.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/W3CDomHandler.java?view=auto&rev=494575
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/W3CDomHandler.java (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/W3CDomHandler.java Tue Jan  9 13:07:17 2007
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.xml.bind.annotation;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import javax.xml.bind.ValidationEventHandler;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.dom.DOMSource;
+
+/**
+ * Default implementation of {@link DomHandler} for {@link Node W3C DOM}.
+ * @since JAXB 2.0
+ */
+public class W3CDomHandler implements DomHandler<Element,DOMResult> {
+    private DocumentBuilder builder;
+
+    /**
+     * Default constructor; uses the {@link DocumentBuilder}
+     * choosen by the JAXB provider.
+     */
+    public W3CDomHandler() {
+        // Do nothing
+    }
+
+    /**
+     * Constructor using the {@link DocumentBuilder}
+     * choosen by the caller.
+     * @param builder Non-null {@link DocumentBuilder}
+     * @throws IllegalArgumentException The parameter was null.
+     */
+    public W3CDomHandler(DocumentBuilder pBuilder) {
+        if (pBuilder==null)
+            throw new IllegalArgumentException();
+        builder = pBuilder;
+    }
+
+    /**
+     * Returns the {@link DocumentBuilder}, which is being
+     * used for parsing or creating documents.
+     */
+    public DocumentBuilder getBuilder() {
+        return builder;
+    }
+
+    /**
+     * Sets the {@link DocumentBuilder}, which is being
+     * used for parsing or creating documents.
+     */
+    public void setBuilder(DocumentBuilder pBuilder) {
+        builder = pBuilder;
+    }
+
+    public DOMResult createUnmarshaller(ValidationEventHandler errorHandler) {
+        if (builder==null) {
+            return new DOMResult();
+        }
+        return new DOMResult(builder.newDocument());
+    }
+
+    public Element getElement(DOMResult r) {
+        Node n = r.getNode();
+        switch (n.getNodeType()) {
+            case Node.DOCUMENT_NODE:
+                return ((Document) n).getDocumentElement();
+            case Node.ELEMENT_NODE:
+                return (Element) n;
+            case Node.DOCUMENT_FRAGMENT_NODE:
+                return (Element) ((DocumentFragment) n).getFirstChild();
+            default:
+                throw new IllegalStateException("Unexpected node type: " + n);
+        }
+    }
+
+    public Source marshal(Element element, ValidationEventHandler errorHandler) {
+        return new DOMSource(element);
+    }
+}

Added: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessOrder.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessOrder.java?view=auto&rev=494575
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessOrder.java (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessOrder.java Tue Jan  9 13:07:17 2007
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.xml.bind.annotation;
+
+
+/**
+ * Used by the {@link XmlAccessorOrder} annotation. Controls the
+ * order of child elements.
+ * @since JAXB 2.0
+ * @see XmlAccessorOrder
+ */
+public enum XmlAccessOrder { 
+    /**
+     * The order of child elements is undefined.
+     */
+    UNDEFINED,
+    /**
+     * The order of child elements is alphabetical.
+     */
+    ALPHABETICAL
+}
+

Added: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessType.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessType.java?view=auto&rev=494575
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessType.java (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessType.java Tue Jan  9 13:07:17 2007
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.xml.bind.annotation;
+
+
+
+/**
+ * Used by XmlAccessorType to control serialization of fields or
+ * properties. 
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since JAXB2.0
+ * @version $Revision: 1.1 $
+ * @see XmlAccessorType
+ */
+
+public enum XmlAccessType {
+    /**
+     * Properties are mapped to XML, unless annotated by {@link XmlTransient}.
+     * Fields are only mapped to XML, if specifically requested
+     * by JAXB annotations.
+     */
+    PROPERTY,
+    /**
+     * All fields (with the exception of static and transient fields)
+     * will be mapped to XML, unless annotated by {@link XmlTransient}.
+     * Properties are only mapped to XML, if specifically requested
+     * by JAXB annotations.
+     */
+    FIELD,
+    /**
+     * Public fields or properties are mapped to XML, unless
+     * annotated by {@link XmlTransient}.
+     * Other fields or properties are only mapped to XML, if
+     * specifically requested by JAXB annotations.
+     */
+    PUBLIC_MEMBER,
+    /**
+     * A field or property is only mapped to XML, if specifically
+     * requested by JAXB annotations.
+     */
+    NONE
+}
+

Added: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessorOrder.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessorOrder.java?view=auto&rev=494575
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessorOrder.java (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessorOrder.java Tue Jan  9 13:07:17 2007
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.xml.bind.annotation;
+
+import static java.lang.annotation.ElementType.PACKAGE;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+
+/**
+ * Controls the order of child elements.
+ * @since JAXB 2.0
+ * @see XmlAccessOrder
+ */
+@Inherited
+@Retention(RUNTIME)
+@Target({PACKAGE, TYPE})
+public @interface XmlAccessorOrder {
+    /**
+     * Specifies the annotated objects access order.
+     * Defaults to {@link XmlAccessOrder#UNDEFINED}.
+     */
+    XmlAccessOrder value() default XmlAccessOrder.UNDEFINED;
+}

Added: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java?view=auto&rev=494575
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java Tue Jan  9 13:07:17 2007
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.xml.bind.annotation;
+
+import static java.lang.annotation.ElementType.PACKAGE;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Controls, which fields or properties are mapped to XML.
+ * @since JAXB 2.0
+ * @see XmlAccessType
+ */
+@Inherited
+@Retention(RUNTIME)
+@Target({PACKAGE, TYPE})
+public @interface XmlAccessorType {
+    /**
+     * Specifies, which fields or properties are mapped to XML.
+     * Defaults to {@link XmlAccessType#PUBLIC_MEMBER}.
+     * @see XmlAccessType
+     */
+    XmlAccessType value() default XmlAccessType.PUBLIC_MEMBER;
+}

Added: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java?view=auto&rev=494575
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java Tue Jan  9 13:07:17 2007
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.xml.bind.annotation;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import java.util.Map;
+
+/**
+ * Maps a field or property to a wildcard attribute map.
+ * The annotated object must have a type implementing
+ * {@link Map}. No more than one field or property may
+ * have this annotation.
+ * @since JAXB 2.0
+ */
+@Retention(RUNTIME)
+@Target({FIELD,METHOD})
+public @interface XmlAnyAttribute {
+    // No attributes
+}

Added: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java?view=auto&rev=494575
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java Tue Jan  9 13:07:17 2007
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+/**
+ * Maps a field or property to a wildcard element. For example,
+ * all XML elements, which do not match an &#64;XmlElement or
+ * &#64;XmlElementRef annotation, are mapped to the wildcard
+ * element.
+ * @since JAXB 2.0
+ */
+@Retention(RUNTIME)
+@Target({FIELD,METHOD})
+public @interface XmlAnyElement {
+    /**
+     * If this property is set to true, then the unmarshaller
+     * will attempt to return known elements (for example,
+     * globally declared elements) as JAXB objects. If so,
+     * the wildcard element will probably be returned as a
+     * list of DOM nodes and JAXB objects. Otherwise, all
+     * elements are mapped to DOM nodes. Defaults to false.
+     */
+    boolean lax() default false;
+
+    /**
+     * Specifies the {@link DomHandler} which is responsible for actually
+     * converting XML from/to a DOM-like data structure.
+     */
+    Class<? extends DomHandler<?,?>> value() default W3CDomHandler.class;
+}

Added: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java?view=auto&rev=494575
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java Tue Jan  9 13:07:17 2007
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.xml.bind.annotation;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Indicates, that a field or property is being transmitted
+ * as an attachment, if possible. This means, that the
+ * XML representation will typically contain a reference
+ * to the actual content.
+ * @since JAXB2.0
+ */
+@Retention(RUNTIME)
+@Target({FIELD,METHOD,PARAMETER})
+public @interface XmlAttachmentRef {
+    // No properties
+}

Added: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAttribute.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAttribute.java?view=auto&rev=494575
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAttribute.java (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAttribute.java Tue Jan  9 13:07:17 2007
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * Indicates, that a field or property is being mapped as an
+ * XML attribute.
+ * @since JAXB 2.0
+ */
+@Retention(RUNTIME)
+@Target({FIELD, METHOD})
+public @interface XmlAttribute {
+    /**
+     * Name of the attribute. The default value
+     * is "##default" and indicates, that the schemas target namespace
+     * is used, depending on the schema settings. The value
+     * "" indicates the default namespace.
+     */
+    String name() default "##default";
+ 
+    /**
+     * Indicates, whether the attribute is required. Defaults
+     * to false.
+     */
+     boolean required() default false;
+
+    /**
+     * Specifies the attributes namespace, if any.
+     * The default value is "##default" and indicates, that
+     * no namespace is being used.
+     */
+    String namespace() default "##default" ;
+}

Added: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElement.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElement.java?view=auto&rev=494575
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElement.java (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElement.java Tue Jan  9 13:07:17 2007
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.xml.bind.annotation;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Indicates, that a field or property is being mapped to
+ * an XML element.
+ * @since JAXB 2.0
+ */
+@Retention(RUNTIME)
+@Target({FIELD, METHOD})
+public @interface XmlElement {
+    /**
+     * Name of the child element. The default value is
+     * "##default" and indicates, that the element name
+     * is derived from the field or property name.
+     */
+    String name() default "##default";
+ 
+    /**
+     * Indicates, that the element is nillable.
+     */
+    boolean nillable() default false;
+
+    /**
+     * Indicates, that the element is required. This is used
+     * to derive the {@code minOccurs} value, which is either
+     * "0" or "1". The {@code maxOccurs} value depends on the
+     * field or property type: It is "1" for a single valued
+     * field or property, otherwise "unbounded".
+     */
+    boolean required() default false;
+
+    /**
+     * Indicates the elements target namespace. The default value
+     * is "##default" and indicates, that the schemas target namespace
+     * is used, depending on the schema settings. The value
+     * "" indicates the default namespace.
+     */
+    String namespace() default "##default";
+
+    /**
+     * Indicates the elements default value. The special value
+     * '\u0000' is used for null or "no default value".
+     */
+    String defaultValue() default "\u0000";
+
+    /**
+     * Indicates the mapped elements type. By default, the
+     * element type is derived from the field or property
+     * type.
+     */
+    Class<?> type() default DEFAULT.class;
+
+    /**
+     * Default value for use in {@link #type()}, which
+     * indicates that the element type is derived from the
+     * field or property type.
+     */
+    static final class DEFAULT {
+        // No fields or methods.
+    }
+}
+
+

Added: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java?view=auto&rev=494575
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java Tue Jan  9 13:07:17 2007
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.METHOD;
+
+/**
+ * Indicates, that the annotated method is being used as a
+ * factory method for an XML element. This is valid only,
+ * if the containing class is annotated with the {@link
+ * XmlRegistry &#64;XmlRegistry} annotation.
+ * @see XmlRegistry
+ * @since JAXB 2.0
+ */
+@Retention(RUNTIME)
+@Target({METHOD})
+public @interface XmlElementDecl {
+    /**
+     * Indicates, that the factory method is restricted for
+     * use within the given parent element class. Defaults
+     * to {@link XmlElementDecl.GLOBAL}.
+     */
+    Class<?> scope() default GLOBAL.class;
+
+    /**
+     * Namespace of the XML element, which is being created.
+     * The default value is "##default" and indicates, that the
+     * namespace is the packages namespace.
+     * @see #name()
+     */
+    String namespace() default "##default";
+
+    /**
+     * local name of the XML element.
+     * @see #namespace()
+     */
+    String name();
+
+    /**
+     * Namespace name of a substitution group's head XML element.
+     * @see #substitutionHeadName()
+     */
+    String substitutionHeadNamespace() default "##default";
+
+    /**
+     * Local name of a substitution group's head XML element.
+     * @see #substitutionHeadNamespace()
+     */
+    String substitutionHeadName() default "";
+
+    /**
+     * Default value of this element. The default value '\u0000'
+     * indicates the value null or "no default value".
+     */
+    String defaultValue() default "\u0000";
+    
+    /**
+     * Used in {@link XmlElementDecl#scope()} to
+     * signal that the declaration is in the global scope.
+     */
+    public final class GLOBAL {
+        // No fields or methods.
+    }
+}

Added: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElementRef.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElementRef.java?view=auto&rev=494575
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElementRef.java (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElementRef.java Tue Jan  9 13:07:17 2007
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.xml.bind.annotation;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Indicates, that a field or property is mapped to an XML element
+ * reference.
+ * @see XmlElementRefs
+ * @since JAXB 2.0
+ */
+@Retention(RUNTIME)
+@Target({FIELD,METHOD})
+public @interface XmlElementRef {
+    /**
+     * The referenced Java type. The default value indicates,
+     * that the referenced Java type is derived from the fields
+     * or properties type.
+     */
+    Class<?> type() default DEFAULT.class;
+
+    /**
+     * Used together with {@link #name()} to indicate the
+     * referenced XML element. The default value is "".
+     */
+    String namespace() default "";
+    /**
+     * Used together with {@link #namespace()} to indicate the
+     * referenced XML element. The default value is "##default".
+     */
+    String name() default "##default";
+
+    /**
+     * Used in {@link #type()} as a default value.
+     */
+    static final class DEFAULT {
+        // No additional fields or methods.
+    }
+}

Added: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElementRefs.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElementRefs.java?view=auto&rev=494575
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElementRefs.java (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElementRefs.java Tue Jan  9 13:07:17 2007
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Marks a property that refers to classes with {@link XmlElement}
+ * or JAXBElement.
+ * @see XmlElementWrapper
+ * @see XmlElementRef
+ * @since JAXB 2.0
+ */
+@Retention(RUNTIME)
+@Target({FIELD,METHOD})
+public @interface XmlElementRefs {
+    XmlElementRef[] value();
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org