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 [1/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...
Author: jochen
Date: Tue Jan 9 13:07:17 2007
New Revision: 494575
URL: http://svn.apache.org/viewvc?view=rev&rev=494575
Log:
Initial import.
Added:
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/Binder.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/ContextCreator.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/DataBindingException.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/DatatypeConverter.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/DatatypeConverterInterface.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/Element.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/JAXB.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/JAXBContext.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/JAXBElement.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/JAXBException.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/JAXBIntrospector.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/MarshalException.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/Marshaller.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/NotIdentifiableEvent.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/ParseConversionEvent.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/PrintConversionEvent.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/PropertyException.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/SchemaOutputResolver.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/TypeConstraintException.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/UnmarshalException.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/Unmarshaller.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/UnmarshallerHandler.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/ValidationEvent.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/ValidationEventHandler.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/ValidationEventLocator.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/ValidationException.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/Validator.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/DomHandler.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/W3CDomHandler.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessOrder.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessType.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessorOrder.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlAttribute.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElement.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElementRef.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElementRefs.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElementWrapper.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlElements.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlEnum.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlID.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlIDREF.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlInlineBinaryData.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlList.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlMimeType.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlMixed.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlNs.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlNsForm.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlRegistry.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlRootElement.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlSchema.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlSchemaTypes.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlSeeAlso.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlTransient.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlType.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/XmlValue.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/adapters/
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/adapters/XmlAdapter.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/attachment/
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/attachment/AttachmentMarshaller.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/attachment/AttachmentUnmarshaller.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/helpers/
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/helpers/AbstractMarshallerImpl.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/helpers/DefaultValidationEventHandler.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/helpers/NotIdentifiableEventImpl.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/helpers/ParseConversionEventImpl.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/helpers/PrintConversionEventImpl.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/helpers/ValidationEventImpl.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/helpers/ValidationEventLocatorImpl.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/helpers/package.html
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/package.html
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/util/
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/util/JAXBResult.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/util/JAXBSource.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/util/ValidationEventCollector.java
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/util/package.html
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/test/
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/test/java/
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/test/java/javax/
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/test/java/javax/xml/
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/test/java/javax/xml/bind/
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/test/java/javax/xml/bind/annotation/
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/test/java/javax/xml/bind/annotation/adapters/
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/test/java/javax/xml/bind/annotation/adapters/AdapterTest.java
Modified:
webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/ (props changed)
Propchange: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Jan 9 13:07:17 2007
@@ -0,0 +1 @@
+target
Added: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/Binder.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/Binder.java?view=auto&rev=494575
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/Binder.java (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/Binder.java Tue Jan 9 13:07:17 2007
@@ -0,0 +1,228 @@
+/*
+ * 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;
+
+import javax.xml.validation.Schema;
+
+/**
+ * <p>A binder is an object, which allows synchronization between
+ * different representations of a single XML document.</p>
+ * @since JAXB 2.0
+ */
+public abstract class Binder<XmlNode> {
+ /**
+ * <p>Unmarshals the given <code>pXmlNode</code> into a
+ * JAXB object. This object may later be synchronized
+ * forth or back by invoking {@link #updateXML(Object, Object)}
+ * or {@link #updateJAXB(Object)}.</p>
+ * <p>
+ * If {@link #getSchema()} is non-null, <code>pXmlNode</code>
+ * and its descendants is validated during this operation.</p>
+ * @param pXmlNode A representation of the XML node, which
+ * is being unmarshalled.
+ * @return The unmarshalled JAXB object.
+ * @throws JAXBException An unexpected error occurred while
+ * unmarshalling the XML node.
+ * @throws UnmarshalException An
+ * {@link ValidationEventHandler ValidationEventHandler}
+ * returned false or the XML node could not be unmarshalled.
+ * @throws IllegalArgumentException
+ * The <code>pXmlNode</code> parameter is null.
+ */
+ public abstract Object unmarshal(XmlNode pXmlNode) throws JAXBException;
+
+ /**
+ * Similar to {@link Unmarshaller#unmarshal(Node, Class)},
+ * except that the unmarshalled object may later be synchronized
+ * forth or back by invoking {@link #updateXML(Object, Object)}
+ * or {@link #updateJAXB(Object)}.</p>
+ * <p>
+ * If {@link #getSchema()} is non-null, <code>pXmlNode</code>
+ * and its descendants is validated during this operation.</p>
+ * @param pXmlNode A representation of the XML node, which
+ * is being unmarshalled.
+ * @param pType A suitable JAXB class for unmarshalling the
+ * given <code>pXmlNode</code> into a new instance of this
+ * class.
+ * @return The unmarshalled JAXB object.
+ * @throws JAXBException An unexpected error occurred while
+ * unmarshalling the XML node.
+ * @throws UnmarshalException An
+ * {@link ValidationEventHandler ValidationEventHandler}
+ * returned false or the XML node could not be unmarshalled.
+ * @throws IllegalArgumentException
+ * The <code>pXmlNode</code> parameter is null.
+ */
+ public abstract <T> JAXBElement<T> unmarshal(XmlNode pXmlNode,
+ Class<T> pType) throws JAXBException;
+
+ /**
+ * <p>Marshals the given JAXB object into a different
+ * XML representation. This object may later be synchronized
+ * forth and back by using {@link #updateXML(Object, Object)}
+ * or {@link #updateJAXB(Object)}.</p>
+ * <p>If {@link #getSchema()} is non-null, the marshalled
+ * xml content is validated during this operation.</p>
+ * @param pJaxbObject The JAXB object, which is being
+ * marshalled.
+ * @param pXmlNode The target node, which is being filled
+ * by marshalling the JAXB object.
+ * @throws JAXBException An unexpected error occurred while
+ * marshalling the JAXB object.
+ * @throws MarshalException An
+ * {@link ValidationEventHandler ValidationEventHandler}
+ * returned false or marshalling the JAXB object failed.
+ * @throws IllegalArgumentException A method parameter
+ * was null.
+ */
+ public abstract void marshal(Object pJaxbObject, XmlNode pXmlNode) throws JAXBException;
+
+ /**
+ * Returns an XML element, which is associated with the given
+ * JAXB object.
+ * @param pJaxbObject An object, which was typically created by
+ * a call
+ * to {@link #unmarshal(Object)}, {@link #unmarshal(Object, Class)},
+ * or {@link #updateJAXB(Object)}.
+ * @return Null, if the given JAXB object is unknown. An XML
+ * element otherwise.
+ * @throws IllegalArgumentException The parameter is null.
+ */
+ public abstract XmlNode getXMLNode(Object pJaxbObject);
+
+ /**
+ * Returns a JAXB object, which is associated with the given
+ * XML element.
+ * @param pXmlNode An object, which was typically created by
+ * a call to {@link #marshal(Object, Object)},
+ * {@link #updateXML(Object)}, or {@link #updateXML(Object, Object)}.
+ * @return Null, if the given XML element is unknown. A
+ * JAXB object otherwise.
+ * @throws IllegalArgumentException The parameter is null.
+ */
+ public abstract Object getJAXBNode(XmlNode pXmlNode);
+
+ /**
+ * Updates the XML node, which is associated with the
+ * given JAXB object. Shortcut for
+ * <pre>updateXML(pJaxbObject, getXMLNode(pJaxbObject))</pre>
+ * @throws JAXBException An error occurred while updating the
+ * XML node.
+ * @throws IllegalArgumentException The parameter is null.
+ */
+ public abstract XmlNode updateXML(Object pJaxbObject) throws JAXBException;
+
+ /**
+ * Updates the contents of the given XML node to match the
+ * JAXB objects contents. Additionally, the associations
+ * between JAXB objects and XML nodes are updated.
+ * @param pJaxbObject A JAXB object, which is associated with the
+ * given XML node.
+ * @param pXmlNode An XML node, which is associated with the
+ * given JAXB object.
+ * @return
+ * The updated XML node, typically the same as the input
+ * XML node. However, this isn't necessarily the case and
+ * a new XML node may have been created.
+ * @throws JAXBException An error occurred while updating the
+ * XML node.
+ * @throws IllegalArgumentException Either of the parameters was null.
+ */
+ public abstract XmlNode updateXML(Object pJaxbObject, XmlNode pXmlNode) throws JAXBException;
+
+ /**
+ * Updates the contents of the JAXB object, which is associated
+ * with the given XML node to match the XML nodes contents.
+ * Additionally, the associations
+ * between JAXB objects and XML nodes are updated.
+ * @return The updated JAXB object, typically the same object,
+ * that was already associated with the XML node. However,
+ * this isn't necessarily the case and a new JAXB object
+ * may have been created.
+ * @throws JAXBException An error occurred while updating the
+ * JAXB object.
+ * @throws IllegalArgumentException The parameter is null.
+ */
+ public abstract Object updateJAXB(XmlNode xmlNode) throws JAXBException;
+
+
+ /**
+ * Specifies, whether the marshal, unmarshal, or update
+ * methods are validating.
+ * @param schema A non-null argument specifies, that XML contents
+ * are being validated against the given schema object. Null
+ * disables validation.
+ * @see Unmarshaller#setSchema(Schema)
+ */
+ public abstract void setSchema( Schema schema );
+
+ /**
+ * Returns a schema object, which is used by the marshal,
+ * unmarshal or update methods for validating the XML
+ * contents.
+ * @return A non-null argument indicates, that the returned
+ * object is used for validating. Null is returned, if
+ * validation is disabled.
+ */
+ public abstract Schema getSchema();
+
+ /**
+ * Registers an event handler, which will be notified in case of
+ * validation errors.
+ * @param pHandler A non-null value registers the given handler as
+ * the new event handler. Null restores a default event handler.
+ * @throws JAXBException An error occurred while registering the
+ * event handler.
+ */
+ public abstract void setEventHandler(ValidationEventHandler pHandler) throws JAXBException;
+
+ /**
+ * Returns an event handler, which is currently registered for
+ * notifications in case of validation errors.
+ * @return The currently registered event handler, if any, or
+ * a default handler.
+ * @throws JAXBException An error occurred while returning the
+ * event handler.
+ */
+ public abstract ValidationEventHandler getEventHandler() throws JAXBException;
+
+ /**
+ * Sets a {@link Binder} property. For example, this may be a
+ * {@link Marshaller} or {@link Unmarshaller} property.
+ * @param pName Property name
+ * @param pValue Property value
+ * @throws PropertyException The property name is unknown or
+ * the value is invalid.
+ * @throws IllegalArgumentException The pName parameter is null.
+ */
+ abstract public void setProperty(String pName, Object pValue) throws PropertyException;
+
+
+ /**
+ * Returns the requested {@link Binder} property. For example,
+ * this may be a
+ * {@link Marshaller} or {@link Unmarshaller} property.
+ * @param pName Property name
+ * @throws PropertyException The property name is unknown or
+ * reading the value failed.
+ * @throws IllegalArgumentException The pName parameter is null.
+ */
+ abstract public Object getProperty(String pName) throws PropertyException;
+
+}
Added: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/ContextCreator.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/ContextCreator.java?view=auto&rev=494575
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/ContextCreator.java (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/ContextCreator.java Tue Jan 9 13:07:17 2007
@@ -0,0 +1,303 @@
+/*
+ * 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.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.util.Map;
+import java.util.Properties;
+import java.util.StringTokenizer;
+
+
+/**
+ * This class is actually implementing the various
+ * JAXBContext.newInstance() methods. It isn't part of the
+ * public API, which is why it is package private.
+ */
+class ContextCreator {
+ private static final String JAXB_CONTEXT_CLASS = JAXBContext.class.getName();
+ private static final String META_INF_SERVICE = "META-INF/services/" + JAXB_CONTEXT_CLASS;
+
+ /**
+ * Interface of a package list.
+ */
+ private interface PackageList {
+ /**
+ * Returns, whether the list contains more packages.
+ */
+ boolean hasMore();
+ /**
+ * Returns the next package name in the list.
+ */
+ String nextPackage();
+ /**
+ * Returns the next class loader in the list.
+ * @return
+ */
+ ClassLoader nextClassLoader();
+ }
+
+ /**
+ * Attempts to find a JAXBContext factory class
+ * via jaxb.properties.
+ */
+ private static Class<?> getFactoryClassFromJaxbProperties(String pFactoryProperty,
+ PackageList pPackageList) throws JAXBException {
+ while (pPackageList.hasMore()) {
+ String packageName = pPackageList.nextPackage();
+ ClassLoader cl = pPackageList.nextClassLoader();
+ if (packageName == null) {
+ continue;
+ }
+ String resourceName = packageName.replace('.', '/') + "/jaxb.properties";
+ URL resource = cl.getResource(resourceName);
+ if (resource == null) {
+ continue;
+ }
+ Properties props = new Properties();
+ InputStream istream = null;
+ try {
+ istream = resource.openStream();
+ props.load(istream);
+ istream.close();
+ istream = null;
+ } catch (IOException e) {
+ throw new JAXBException("Failed to load property file " + resource, e);
+ } finally {
+ if (istream != null) { try { istream.close(); } catch (Throwable t) { /* Ignore me */ } }
+ }
+ String className = props.getProperty(pFactoryProperty);
+ if (className == null) {
+ throw new JAXBException("The property " + pFactoryProperty
+ + " is not set in " + resource);
+ }
+ return loadFactoryClass(cl, className);
+ }
+ return null;
+ }
+
+ /**
+ * Attempts to find a JAXBContext factory class
+ * in the system properties.
+ */
+ private static Class<?> getFactoryClassFromSystemProperties(
+ ClassLoader pClassLoader) throws JAXBException {
+ final String className;
+ try {
+ className = System.getProperty(JAXB_CONTEXT_CLASS);
+ } catch (SecurityException e) {
+ return null;
+ }
+ if (className == null) {
+ return null;
+ }
+ return loadFactoryClass(pClassLoader, className);
+ }
+
+ /**
+ * Attempts to find a JAXBContext factory class
+ * in META-INF/services.
+ */
+ private static Class<?> getFactoryClassFromMetaInfServices(
+ ClassLoader pClassLoader) throws JAXBException {
+ URL url = pClassLoader.getResource(META_INF_SERVICE);
+ if (url == null) {
+ return null;
+ }
+ InputStream istream = null;
+ try {
+ BufferedReader r = new BufferedReader(new InputStreamReader(istream, "UTF-8"));
+ String factoryClassName = r.readLine().trim();
+ r.close();
+ istream = url.openStream();
+ istream.close();
+ istream = null;
+ if (factoryClassName == null || "".equals(factoryClassName)) {
+ throw new JAXBException("No factory class name found in " + url);
+ }
+ return loadFactoryClass(pClassLoader, factoryClassName);
+ } catch (IOException e) {
+ throw new JAXBException("Failed to load " + url + ": " + e.getMessage(), e);
+ } finally {
+ if (istream != null) {
+ try {
+ istream.close();
+ } catch (Throwable t) {
+ // Ignore me
+ }
+ }
+ }
+ }
+
+ /**
+ * Loads the JAXBContext factory class.
+ */
+ private static Class<?> loadFactoryClass(ClassLoader pClassLoader,
+ String pFactoryClass) throws JAXBException {
+ try {
+ return pClassLoader.loadClass(pFactoryClass);
+ } catch (ClassNotFoundException e) {
+ throw new JAXBException("Unable to load class "
+ + pFactoryClass
+ + " via ClassLoader " + pClassLoader);
+ }
+ }
+
+ private static JAXBContext createInstance(Method pMethod, Object[] pArgs)
+ throws JAXBException {
+ try {
+ Object o = pMethod.invoke(null, pArgs);
+ if (o == null) {
+ throw new JAXBException("The method "
+ + pMethod + " returned null.");
+ }
+ if(!(o instanceof JAXBContext)) {
+ throw new JAXBException("The created instance of "
+ + o.getClass().getName()
+ + " doesn't implement " + JAXB_CONTEXT_CLASS);
+ }
+ return (JAXBContext) o;
+ } catch (IllegalAccessException e) {
+ throw new JAXBException("Illegal access to method "
+ + pMethod + ": " + e.getMessage(), e);
+ } catch (InvocationTargetException e) {
+ Throwable t = e.getTargetException();
+ if (t instanceof JAXBException) {
+ throw (JAXBException)t;
+ }
+ if (t instanceof RuntimeException) {
+ throw (RuntimeException) t;
+ }
+ if (t instanceof Error) {
+ throw (Error) t;
+ }
+ throw new JAXBException("Failed to invoke method "
+ + pMethod + ": " + e.getMessage(), e);
+ }
+ }
+
+ /**
+ * Implements {@link JAXBContext#newInstance(String, ClassLoader, Map)}.
+ */
+ static JAXBContext newContext(String pFactoryProperty,
+ final String pPath,
+ final ClassLoader pClassLoader,
+ Map<String,?> pProperties)
+ throws JAXBException {
+ if (pPath == null) {
+ throw new JAXBException("The context path must not be null.");
+ }
+ if (pClassLoader == null) {
+ throw new JAXBException("The classloader must not be null.");
+ }
+ final PackageList packageList = new PackageList(){
+ private final StringTokenizer st = new StringTokenizer(pPath, ":");
+ public boolean hasMore() {
+ return st.hasMoreTokens();
+ }
+ public ClassLoader nextClassLoader() {
+ return pClassLoader;
+ }
+ public String nextPackage() {
+ return st.nextToken();
+ }
+ };
+ Class<?> factoryClass = getFactoryClassFromJaxbProperties(pFactoryProperty, packageList);
+ if (factoryClass == null) {
+ factoryClass = getFactoryClassFromSystemProperties(pClassLoader);
+ if (factoryClass == null) {
+ factoryClass = getFactoryClassFromMetaInfServices(pClassLoader);
+ if (factoryClass == null) {
+ throw new JAXBException("Unable to determine JAXBContext class.");
+ }
+ }
+ }
+
+ Method m;
+ Object[] args;
+ try {
+ m = factoryClass.getMethod("createContext", String.class, ClassLoader.class, Map.class);
+ args = new Object[]{pPath, pClassLoader, pProperties};
+ } catch (NoSuchMethodException e1) {
+ try {
+ m = factoryClass.getMethod("createContext", String.class, ClassLoader.class);
+ args = new Object[]{pPath, pClassLoader};
+ } catch (NoSuchMethodException e2) {
+ throw new JAXBException("Factory class "
+ + factoryClass.getName()
+ + " doesn't have a method createContext(String,ClassLoader,Map).");
+ }
+ }
+ return createInstance(m, args);
+ }
+
+
+ /**
+ * Implements {@link JAXBContext#newInstance(Class[], Map)}.
+ */
+ static JAXBContext newContext(String pFactoryProperty,
+ final Class<?>[] classes,
+ Map<String,?> properties)
+ throws JAXBException {
+ final PackageList packageList = new PackageList() {
+ int i = 0;
+ public boolean hasMore() { return i < classes.length; }
+ public ClassLoader nextClassLoader() {
+ return classes[i++].getClassLoader();
+ }
+ public String nextPackage() {
+ final Class<?> c = classes[i];
+ final Package pkg = c.getPackage();
+ String pkgName = pkg.getName();
+ if (pkgName != null) {
+ return pkgName;
+ }
+ int offset = c.getName().lastIndexOf('.');
+ if (offset == -1) {
+ return null;
+ }
+ return c.getName().substring(0, offset);
+ }
+ };
+
+ Class<?> factoryClass = getFactoryClassFromJaxbProperties(pFactoryProperty, packageList);
+ if (factoryClass == null) {
+ factoryClass = getFactoryClassFromSystemProperties(Thread.currentThread().getContextClassLoader());
+ if (factoryClass == null) {
+ factoryClass = getFactoryClassFromMetaInfServices(Thread.currentThread().getContextClassLoader());
+ if (factoryClass == null) {
+ throw new JAXBException("Unable to determine JAXBContext class.");
+ }
+ }
+ }
+
+ Method m;
+ try {
+ m = factoryClass.getMethod("createContext", Class[].class, Map.class);
+ } catch (NoSuchMethodException e) {
+ throw new JAXBException("Factory class "
+ + factoryClass.getName()
+ + " doesn't have a method createContext(Class[],Map).");
+ }
+ return createInstance(m, new Object[]{classes, properties});
+ }
+}
Added: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/DataBindingException.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/DataBindingException.java?view=auto&rev=494575
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/DataBindingException.java (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/DataBindingException.java Tue Jan 9 13:07:17 2007
@@ -0,0 +1,45 @@
+/*
+ * 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;
+
+
+/**
+ * This is a runtime exception, which is used to represent a failure
+ * in a JAXB operation. Unlike {@link JAXBException}, it is derived
+ * from the {@link RuntimeException}. In other words, it is no
+ * checked exception.
+ */
+@SuppressWarnings("serial") // The RI doesn't specify a serialversionuid.
+public class DataBindingException extends RuntimeException {
+ /**
+ * Creates a new instance with the given detail message
+ * and cause.
+ * @param message The exceptions detail message.
+ * @param cause The exceptions cause.
+ */
+ public DataBindingException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Creates a new instance with the given cause.
+ * @param cause The exceptions cause.
+ */
+ public DataBindingException(Throwable cause) {
+ super(cause);
+ }
+}
Added: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/DatatypeConverter.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/DatatypeConverter.java?view=auto&rev=494575
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/DatatypeConverter.java (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/DatatypeConverter.java Tue Jan 9 13:07:17 2007
@@ -0,0 +1,520 @@
+/*
+ * 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.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Calendar;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+
+/** <p>This is a helper class for customized datatypes. It provides a
+ * set of static methods which may be useful in custom methods for
+ * parsing and printing values.</p>
+ * <p>The JAXB provider is responsible to initialize the
+ * <code>DatatypeConverter</code> class by invoking
+ * {@link #setDatatypeConverter(DatatypeConverterInterface)} as soon
+ * as possible.</p>
+ *
+ * @author JSR-31
+ * @since JAXB1.0
+ */
+public final class DatatypeConverter {
+ private static DatatypeConverterInterface converter;
+
+ /**
+ * Private constructor, to prevent instantiation.
+ */
+ private DatatypeConverter() {
+ // Does nothing
+ }
+
+ /** <p>This method must be invoked by the JAXB provider to set the actual
+ * instance, which is invoked by the static methods. Subsequent
+ * invocations of the method are ignored: First come, first wins.</p>
+ * @throws IllegalArgumentException The parameter was null.
+ */
+ public static void setDatatypeConverter(DatatypeConverterInterface pConverter) {
+ if (pConverter == null) {
+ throw new IllegalArgumentException("The parameter must not be null.");
+ }
+ synchronized (DatatypeConverter.class) {
+ if (converter == null) {
+ converter = pConverter;
+ }
+ }
+ }
+
+ /** <p>Parses the lexical representation and converts it into a String.</p>
+ *
+ * @param pLexicalXSDString The input string being parsed.
+ * @return The unmodified input string.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public static String parseString(String pLexicalXSDString) {
+ return converter.parseString(pLexicalXSDString);
+ }
+
+ /** <p>Parses the lexical representation of the given integer value
+ * (arbitrary precision) and converts it into an instance of
+ * {@link java.math.BigInteger}.</p>
+ * @param pLexicalXSDInteger The input string being parsed.
+ * @return The input string converted into an instance of {@link BigInteger}.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public static BigInteger parseInteger(String pLexicalXSDInteger) {
+ return converter.parseInteger(pLexicalXSDInteger);
+ }
+
+ /** <p>Parses the lexical representation of the given 32 bit integer value
+ * and converts it into a primitive <code>int</code> value.</p>
+ * @param pLexicalXSDInt The input string being parsed.
+ * @return The input string converted into a primitive <code>int</code>.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public static int parseInt(String pLexicalXSDInt) {
+ return converter.parseInt(pLexicalXSDInt);
+ }
+
+ /** <p>Parses the lexical representation of the given 64 bit integer value
+ * and converts it into a primitive <code>long</code> value.</p>
+ * @param pLexicalXSDLong The input string being parsed.
+ * @return The input string converted into a primitive <code>long</code>.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public static long parseLong(String pLexicalXSDLong) {
+ return converter.parseLong(pLexicalXSDLong);
+ }
+
+ /** <p>Parses the lexical representation of the given 16 bit integer value
+ * and converts it into a primitive <code>short</code> value.</p>
+ * @param pLexicalXSDShort The input string being parsed.
+ * @return The input string converted into a primitive <code>short</code>.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public static short parseShort(String pLexicalXSDShort) {
+ return converter.parseShort(pLexicalXSDShort);
+ }
+
+ /** <p>Parses the lexical representation of the given decimal value
+ * (arbitrary precision) and converts it into an instance of
+ * {@link java.math.BigDecimal}.</p>
+ * @param pLexicalXSDDecimal The input string being parsed.
+ * @return The input string converted into an instance of {@link java.math.BigDecimal}.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public static BigDecimal parseDecimal(String pLexicalXSDDecimal) {
+ return converter.parseDecimal(pLexicalXSDDecimal);
+ }
+
+ /** <p>Parses the lexical representation of the given 32 bit floating
+ * point value and converts it into a primitive <code>float</code> value.</p>
+ * @param pLexicalXSDFloat The input string being parsed.
+ * @return The input string converted into a primitive <code>float</code>.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public static float parseFloat(String pLexicalXSDFloat) {
+ return converter.parseFloat(pLexicalXSDFloat);
+ }
+
+ /** <p>Parses the lexical representation of the given 64 bit floating
+ * point value and converts it into a primitive <code>double</code> value.</p>
+ * @param pLexicalXSDDouble The input string being parsed.
+ * @return The input string converted into a primitive <code>double</code>.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public static double parseDouble(String pLexicalXSDDouble) {
+ return converter.parseDouble(pLexicalXSDDouble);
+ }
+
+ /** <p>Parses the lexical representation of the given boolean value
+ * and converts it into a primitive <code>boolean</code> value.</p>
+ * @param pLexicalXSDBoolean The input string being parsed.
+ * @return The input string converted into a primitive <code>boolean</code>.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public static boolean parseBoolean(String pLexicalXSDBoolean) {
+ return converter.parseBoolean(pLexicalXSDBoolean);
+ }
+
+ /** <p>Parses the lexical representation of the given 8 bit integer value
+ * and converts it into a primitive <code>byte</code> value.</p>
+ * @param pLexicalXSDByte The input string being parsed.
+ * @return The input string converted into a primitive <code>byte</code>.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public static byte parseByte(String pLexicalXSDByte) {
+ return converter.parseByte(pLexicalXSDByte);
+ }
+
+ /** <p>Parses the lexical representation of the given qualified name
+ * and converts it into an instance of {@link javax.xml.namespace.QName}.
+ * The {@link javax.xml.namespace.QName} consists of a namespace URI
+ * and a local name.</p>
+ * @param pLexicalXSDQName The input string being parsed, an optional
+ * namespace prefix, followed by the local name, if any. If a prefix
+ * is present, they are separated by a colon.
+ * @param pNamespaceContext The namespace context is used to query
+ * mappings between prefixes and namespace URI's.
+ * @return The input string converted into an instance of
+ * {@link javax.xml.namespace.QName}.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public static QName parseQName(String pLexicalXSDQName,
+ NamespaceContext pNamespaceContext) {
+ return converter.parseQName(pLexicalXSDQName, pNamespaceContext);
+ }
+
+ /** <p>Parses the lexical representation of the given dateTime value
+ * and converts it into an instance of {@link java.util.Calendar}.
+ * Valid lexical representations of a dateTime value include
+ * <pre>
+ * YYYY-MM-DDThh:mm:ss
+ * YYYY-MM-DDThh:mm:ss.sss
+ * YYYY-MM-DDThh:mm:ssZ
+ * YYYY-MM-DDThh:mm:ss-01:00
+ * </pre>
+ * The former examples are all specified in UTC time. The last example
+ * uses a negatice offset of one hour to UTC.</p>
+ * @param pLexicalXSDDateTime The input string being parsed.
+ * @return The input string converted into an instance of
+ * {@link java.util.Calendar}.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public static Calendar parseDateTime(String pLexicalXSDDateTime) {
+ return converter.parseDateTime(pLexicalXSDDateTime);
+ }
+
+ /** <p>Parses the lexical representation of the given byte array, which
+ * is encoded in base 64.</p>
+ * @param pLexicalXSDBase64Binary The input string being parsed, a
+ * base 64 encoded array of bytes.
+ * @return The decoded byte array.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public static byte[] parseBase64Binary(String pLexicalXSDBase64Binary) {
+ return converter.parseBase64Binary(pLexicalXSDBase64Binary);
+ }
+
+ /** <p>Parses the lexical representation of the given byte array, which
+ * is encoded in hex digits.</p>
+ * @param pLexicalXSDHexBinary The input string being parsed, an
+ * array of bytes encoded in hex digits.
+ * @return The decoded byte array.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public static byte[] parseHexBinary(String pLexicalXSDHexBinary) {
+ return converter.parseHexBinary(pLexicalXSDHexBinary);
+ }
+
+ /** <p>Parses the lexical representation of the given 32 bit
+ * unsignet integer value and converts it into a primitive <code>long</code>
+ * value.</p>
+ * @param pLexicalXSDUnsignedInt The input string being parsed.
+ * @return The input string converted into a primitive <code>long</code>.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public static long parseUnsignedInt(String pLexicalXSDUnsignedInt) {
+ return converter.parseUnsignedInt(pLexicalXSDUnsignedInt);
+ }
+
+ /** <p>Parses the lexical representation of the given 16 bit
+ * unsignet integer value and converts it into a primitive <code>int</code>
+ * value.</p>
+ * @param pLexicalXSDUnsignedShort The input string being parsed.
+ * @return The input string conve
+ * rted into a primitive <code>int</code>.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public static int parseUnsignedShort(String pLexicalXSDUnsignedShort) {
+ return converter.parseUnsignedShort(pLexicalXSDUnsignedShort);
+ }
+
+ /** <p>Parses the lexical representation of the given time value
+ * and converts it into an instance of {@link java.util.Calendar}.
+ * Valid lexical representations of a time value include
+ * <pre>
+ * hh:mm:ss
+ * hh:mm:ss.sss
+ * hh:mm:ssZ
+ * hh:mm:ss-01:00
+ * </pre>
+ * The former examples are all specified in UTC time. The last example
+ * uses a negatice offset of one hour to UTC.</p>
+ * @param pLexicalXSDTime The input string being parsed.
+ * @return The input string converted into an instance of
+ * {@link java.util.Calendar}.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public static Calendar parseTime(String pLexicalXSDTime) {
+ return converter.parseTime(pLexicalXSDTime);
+ }
+
+ /** <p>Parses the lexical representation of the given date value
+ * and converts it into an instance of {@link java.util.Calendar}.
+ * Valid lexical representations of a date value include
+ * <pre>
+ * YYYY-MM-DD
+ * YYYY-MM-DDZ
+ * YYYY-MM-DD-01:00
+ * </pre>
+ * The former examples are all specified in UTC time. The last example
+ * uses a negatice offset of one hour to UTC.</p>
+ * @param pLexicalXSDDate The input string being parsed.
+ * @return The input string converted into an instance of
+ * {@link java.util.Calendar}.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public static Calendar parseDate(String pLexicalXSDDate) {
+ return converter.parseDate(pLexicalXSDDate);
+ }
+
+ /** <p>Returns the lexical representation of the input string, which is
+ * the unmodified input string.</p>
+ * @param pLexicalXSDAnySimpleType An input string in lexical representation.
+ * @return The unmodified input string.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public static String parseAnySimpleType(String pLexicalXSDAnySimpleType) {
+ return converter.parseAnySimpleType(pLexicalXSDAnySimpleType);
+ }
+
+ /** <p>Returns a lexical representation of the given input string, which
+ * is the unmodified input string.</p>
+ * @param pValue The input string.
+ * @return The unmodified input string.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public static String printString(String pValue) {
+ return converter.printString(pValue);
+ }
+
+ /** <p>Returns a lexical representation of the given instance of
+ * {@link BigInteger}, which is an integer in arbitrary precision.</p>
+ * @param pValue The integer value being converted.
+ * @return A lexical representation of the input value.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public static String printInteger(BigInteger pValue) {
+ return converter.printInteger(pValue);
+ }
+
+ /** <p>Returns a lexical representation of the given primitive
+ * 32 bit integer.</p>
+ * @param pValue The <code>int</code> value being converted.
+ * @return A lexical representation of the input value.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public static String printInt(int pValue) {
+ return converter.printInt(pValue);
+ }
+
+ /** <p>Returns a lexical representation of the given primitive
+ * 64 bit integer.</p>
+ * @param pValue The <code>long</code> value being converted.
+ * @return A lexical representation of the input value.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public static String printLong(long pValue) {
+ return converter.printLong(pValue);
+ }
+
+ /** <p>Returns a lexical representation of the given primitive
+ * 16 bit integer.</p>
+ * @param pValue The <code>short</code> value being converted.
+ * @return A lexical representation of the input value.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public static String printShort(short pValue) {
+ return converter.printShort(pValue);
+ }
+
+ /** <p>Returns a lexical representation of the given instance of
+ * {@link BigDecimal}, which is a decimal number in arbitrary
+ * precision.</p>
+ * @param pValue The decimal value being converted.
+ * @return A lexical representation of the input value.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public static String printDecimal(BigDecimal pValue) {
+ return converter.printDecimal(pValue);
+ }
+
+ /** <p>Returns a lexical representation of the given primitive
+ * 32 bit floating point number.</p>
+ * @param pValue The <code>float</code> value being converted.
+ * @return A lexical representation of the input value.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public static String printFloat(float pValue) {
+ return converter.printFloat(pValue);
+ }
+
+ /** <p>Returns a lexical representation of the given primitive
+ * 64 bit floating point number.</p>
+ * @param pValue The <code>double</code> value being converted.
+ * @return A lexical representation of the input value.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public static String printDouble(double pValue) {
+ return converter.printDouble(pValue);
+ }
+
+ /** <p>Returns a lexical representation of the given primitive
+ * boolean value.</p>
+ * @param pValue The <code>boolean</code> value being converted.
+ * @return A lexical representation of the input value.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public static String printBoolean(boolean pValue) {
+ return converter.printBoolean(pValue);
+ }
+
+ /** <p>Returns a lexical representation of the given primitive
+ * 8 bit integer.</p>
+ * @param pValue The <code>byte</code> value being converted.
+ * @return A lexical representation of the input value.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public static String printByte(byte pValue) {
+ return converter.printByte(pValue);
+ }
+
+ /** <p>Returns a lexical representation of the given qualified
+ * name, which is a combination of namespace URI and local name.
+ * The lexical representation is an optional prefix, which is
+ * currently mapped to namespace URI of the qualified name,
+ * followed by a colon and the local name. If the namespace URI
+ * is the current default namespace URI, then the prefix and
+ * the colon may be omitted.</p>
+ * @param pValue The qualified name being converted.
+ * @param pNamespaceContext A mapping of prefixes to namespace
+ * URI's which may be used to determine a valid prefix.
+ * @return A lexical representation of the qualified name.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public static String printQName(QName pValue,
+ NamespaceContext pNamespaceContext) {
+ return converter.printQName(pValue, pNamespaceContext);
+ }
+
+ /** <p>Returns a lexical representation of the given dateTime
+ * value. Valid lexical representations include:
+ * <pre>
+ * YYYY-MM-DDThh:mm:ss
+ * YYYY-MM-DDThh:mm:ss.sss
+ * YYYY-MM-DDThh:mm:ssZ
+ * YYYY-MM-DDThh:mm:ss-01:00
+ * </pre>
+ * The former examples are all specified in UTC time. The last example
+ * uses a negatice offset of one hour to UTC.</p>
+ * @param pValue The dateTime value being converted
+ * @return A lexical representation of the input value.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public static String printDateTime(Calendar pValue) {
+ return converter.printDateTime(pValue);
+ }
+
+ /** <p>Returns a lexical representation of the given byte array.
+ * The lexical representation is obtained by application of the
+ * base 64 encoding.</p>
+ * @param pValue The byte array being converted.
+ * @return The converted byte array.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public static String printBase64Binary(byte[] pValue) {
+ return converter.printBase64Binary(pValue);
+ }
+
+ /** <p>Returns a lexical representation of the given byte array.
+ * The lexical representation is obtained by encoding any byte
+ * as two hex digits.</p>
+ * @param pValue The byte array being converted.
+ * @return The converted byte array.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public static String printHexBinary(byte[] pValue) {
+ return converter.printHexBinary(pValue);
+ }
+
+ /** <p>Returns a lexical representation of the given primitive,
+ * unsigned 32 bit integer.</p>
+ * @param pValue The <code>long</code> value being converted.
+ * @return A lexical representation of the input value.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public static String printUnsignedInt(long pValue) {
+ return converter.printUnsignedInt(pValue);
+ }
+
+ /** <p>Returns a lexical representation of the given primitive,
+ * unsigned 16 bit integer.</p>
+ * @param pValue The <code>short</code> value being converted.
+ * @return A lexical representation of the input value.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public static String printUnsignedShort(int pValue) {
+ return converter.printUnsignedShort(pValue);
+ }
+
+ /** <p>Returns a lexical representation of the given time
+ * value. Valid lexical representations include:
+ * <pre>
+ * hh:mm:ss
+ * hh:mm:ss.sss
+ * hh:mm:ssZ
+ * hh:mm:ss-01:00
+ * </pre>
+ * The former examples are all specified in UTC time. The last example
+ * uses a negatice offset of one hour to UTC.</p>
+ * @param pValue The time value being converted
+ * @return A lexical representation of the input value.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public static String printTime(Calendar pValue) {
+ return converter.printTime(pValue);
+ }
+
+ /** <p>Returns a lexical representation of the given date
+ * value. Valid lexical representations include:
+ * <pre>
+ * YYYY-MM-DD
+ * YYYY-MM-DDZ
+ * YYYY-MM-DD-01:00
+ * </pre>
+ * The former examples are all specified in UTC time. The last example
+ * uses a negatice offset of one hour to UTC.</p>
+ * @param pValue The date value being converted
+ * @return A lexical representation of the input value.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public static String printDate(Calendar pValue) {
+ return converter.printDate(pValue);
+ }
+
+ /** <p>Returns a lexical representation of the given input
+ * string, which is the unmodified input string.</p>
+ * @param pValue The input string.
+ * @return The unmodified input string.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public static String printAnySimpleType(String pValue) {
+ return converter.printAnySimpleType(pValue);
+ }
+}
Added: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/DatatypeConverterInterface.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/DatatypeConverterInterface.java?view=auto&rev=494575
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/DatatypeConverterInterface.java (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/DatatypeConverterInterface.java Tue Jan 9 13:07:17 2007
@@ -0,0 +1,435 @@
+/*
+ * 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.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Calendar;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+
+
+/** <p>The <code>DatatypeConverterInterface</code> is a helper class for
+ * implementation of custom <code>print()</code> and <code>parse()</code>
+ * methods, as specified by <samp>jaxb:javaType/@printMethod</samp> and
+ * <samp>jaxb:javaType/@parseMethod</samp>. However, the JAXB user won't
+ * be accessing this class directly. The JAXB provider is required to
+ * create an instance of this class and pass it to the JAXB runtime by
+ * invoking
+ * {@link javax.xml.bind.DatatypeConverter#setDatatypeConverter(DatatypeConverterInterface)}.
+ * The JAXB user may access this instance via the static methods of
+ * {@link javax.xml.bind.DatatypeConverter}.</p>
+ * <p>The interface provides methods <code>parseFoo()</code> and
+ * <code>printFoo()</code> for any XML Schema type <samp>foo</samp>.
+ * The <code>parseFoo()</code> method must accept any lexically valid
+ * value and convert it into the corresponding canonical value. An error
+ * in the conversion routine must be mapped to a
+ * {@link javax.xml.bind.ParseConversionEvent}.</p>
+ * <p>The <code>printFoo(foo pValue)</code> method must convert the value
+ * <samp>pValue</samp> into an arbitrary lexical representation. It is
+ * recommended to use the default representation.</p>
+ *
+ * @author JSR-31
+ * @since JAXB 1.0
+ * @see javax.xml.bind.DatatypeConverter
+ * @see javax.xml.bind.ParseConversionEvent
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+public interface DatatypeConverterInterface {
+ /** <p>Parses the lexical representation and converts it into a String.</p>
+ *
+ * @param pLexicalXSDString The input string being parsed.
+ * @return The unmodified input string.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public String parseString(String pLexicalXSDString);
+
+ /** <p>Parses the lexical representation of the given integer value
+ * (arbitrary precision) and converts it into an instance of
+ * {@link java.math.BigInteger}.</p>
+ * @param pLexicalXSDInteger The input string being parsed.
+ * @return The input string converted into an instance of {@link BigInteger}.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public BigInteger parseInteger(String pLexicalXSDInteger);
+
+ /** <p>Parses the lexical representation of the given 32 bit integer value
+ * and converts it into a primitive <code>int</code> value.</p>
+ * @param pLexicalXSDInt The input string being parsed.
+ * @return The input string converted into a primitive <code>int</code>.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public int parseInt(String pLexicalXSDInt);
+
+ /** <p>Parses the lexical representation of the given 64 bit integer value
+ * and converts it into a primitive <code>long</code> value.</p>
+ * @param pLexicalXSDLong The input string being parsed.
+ * @return The input string converted into a primitive <code>long</code>.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public long parseLong(String pLexicalXSDLong);
+
+ /** <p>Parses the lexical representation of the given 16 bit integer value
+ * and converts it into a primitive <code>short</code> value.</p>
+ * @param pLexicalXSDShort The input string being parsed.
+ * @return The input string converted into a primitive <code>short</code>.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public short parseShort(String pLexicalXSDShort);
+
+ /** <p>Parses the lexical representation of the given decimal value
+ * (arbitrary precision) and converts it into an instance of
+ * {@link java.math.BigDecimal}.</p>
+ * @param pLexicalXSDDecimal The input string being parsed.
+ * @return The input string converted into an instance of {@link java.math.BigDecimal}.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public BigDecimal parseDecimal(String pLexicalXSDDecimal);
+
+ /** <p>Parses the lexical representation of the given 32 bit floating
+ * point value and converts it into a primitive <code>float</code> value.</p>
+ * @param pLexicalXSDFloat The input string being parsed.
+ * @return The input string converted into a primitive <code>float</code>.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public float parseFloat(String pLexicalXSDFloat);
+
+ /** <p>Parses the lexical representation of the given 64 bit floating
+ * point value and converts it into a primitive <code>double</code> value.</p>
+ * @param pLexicalXSDDouble The input string being parsed.
+ * @return The input string converted into a primitive <code>double</code>.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public double parseDouble(String pLexicalXSDDouble);
+
+ /** <p>Parses the lexical representation of the given boolean value
+ * and converts it into a primitive <code>boolean</code> value.</p>
+ * @param pLexicalXSDBoolean The input string being parsed.
+ * @return The input string converted into a primitive <code>boolean</code>.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public boolean parseBoolean(String pLexicalXSDBoolean);
+
+ /** <p>Parses the lexical representation of the given 8 bit integer value
+ * and converts it into a primitive <code>byte</code> value.</p>
+ * @param pLexicalXSDByte The input string being parsed.
+ * @return The input string converted into a primitive <code>byte</code>.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public byte parseByte(String pLexicalXSDByte);
+
+ /** <p>Parses the lexical representation of the given qualified name
+ * and converts it into an instance of {@link javax.xml.namespace.QName}.
+ * The {@link javax.xml.namespace.QName} consists of a namespace URI
+ * and a local name.</p>
+ * @param pLexicalXSDQName The input string being parsed, an optional
+ * namespace prefix, followed by the local name, if any. If a prefix
+ * is present, they are separated by a colon.
+ * @param pNamespaceContext The namespace context is used to query
+ * mappings between prefixes and namespace URI's.
+ * @return The input string converted into an instance of
+ * {@link javax.xml.namespace.QName}.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public QName parseQName(String pLexicalXSDQName,
+ NamespaceContext pNamespaceContext);
+
+ /** <p>Parses the lexical representation of the given dateTime value
+ * and converts it into an instance of {@link java.util.Calendar}.
+ * Valid lexical representations of a dateTime value include
+ * <pre>
+ * YYYY-MM-DDThh:mm:ss
+ * YYYY-MM-DDThh:mm:ss.sss
+ * YYYY-MM-DDThh:mm:ssZ
+ * YYYY-MM-DDThh:mm:ss-01:00
+ * </pre>
+ * The former examples are all specified in UTC time. The last example
+ * uses a negatice offset of one hour to UTC.</p>
+ * @param pLexicalXSDDateTime The input string being parsed.
+ * @return The input string converted into an instance of
+ * {@link java.util.Calendar}.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public Calendar parseDateTime(String pLexicalXSDDateTime);
+
+ /** <p>Parses the lexical representation of the given byte array, which
+ * is encoded in base 64.</p>
+ * @param pLexicalXSDBase64Binary The input string being parsed, a
+ * base 64 encoded array of bytes.
+ * @return The decoded byte array.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public byte[] parseBase64Binary(String pLexicalXSDBase64Binary);
+
+ /** <p>Parses the lexical representation of the given byte array, which
+ * is encoded in hex digits.</p>
+ * @param pLexicalXSDHexBinary The input string being parsed, an
+ * array of bytes encoded in hex digits.
+ * @return The decoded byte array.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public byte[] parseHexBinary(String pLexicalXSDHexBinary);
+
+ /** <p>Parses the lexical representation of the given 32 bit
+ * unsignet integer value and converts it into a primitive <code>long</code>
+ * value.</p>
+ * @param pLexicalXSDUnsignedInt The input string being parsed.
+ * @return The input string converted into a primitive <code>long</code>.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public long parseUnsignedInt(String pLexicalXSDUnsignedInt);
+
+ /** <p>Parses the lexical representation of the given 16 bit
+ * unsignet integer value and converts it into a primitive <code>int</code>
+ * value.</p>
+ * @param pLexicalXSDUnsignedShort The input string being parsed.
+ * @return The input string conve
+ * rted into a primitive <code>int</code>.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public int parseUnsignedShort(String pLexicalXSDUnsignedShort);
+
+ /** <p>Parses the lexical representation of the given time value
+ * and converts it into an instance of {@link java.util.Calendar}.
+ * Valid lexical representations of a time value include
+ * <pre>
+ * hh:mm:ss
+ * hh:mm:ss.sss
+ * hh:mm:ssZ
+ * hh:mm:ss-01:00
+ * </pre>
+ * The former examples are all specified in UTC time. The last example
+ * uses a negatice offset of one hour to UTC.</p>
+ * @param pLexicalXSDTime The input string being parsed.
+ * @return The input string converted into an instance of
+ * {@link java.util.Calendar}.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public Calendar parseTime(String pLexicalXSDTime);
+
+ /** <p>Parses the lexical representation of the given date value
+ * and converts it into an instance of {@link java.util.Calendar}.
+ * Valid lexical representations of a date value include
+ * <pre>
+ * YYYY-MM-DD
+ * YYYY-MM-DDZ
+ * YYYY-MM-DD-01:00
+ * </pre>
+ * The former examples are all specified in UTC time. The last example
+ * uses a negatice offset of one hour to UTC.</p>
+ * @param pLexicalXSDDate The input string being parsed.
+ * @return The input string converted into an instance of
+ * {@link java.util.Calendar}.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public Calendar parseDate(String pLexicalXSDDate);
+
+ /** <p>Returns the lexical representation of the input string, which is
+ * the unmodified input string.</p>
+ * @param pLexicalXSDAnySimpleType An input string in lexical representation.
+ * @return The unmodified input string.
+ * @see javax.xml.bind.ParseConversionEvent
+ */
+ public String parseAnySimpleType(String pLexicalXSDAnySimpleType);
+
+ /** <p>Returns a lexical representation of the given input string, which
+ * is the unmodified input string.</p>
+ * @param pValue The input string.
+ * @return The unmodified input string.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public String printString(String pValue);
+
+ /** <p>Returns a lexical representation of the given instance of
+ * {@link BigInteger}, which is an integer in arbitrary precision.</p>
+ * @param pValue The integer value being converted.
+ * @return A lexical representation of the input value.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public String printInteger(BigInteger pValue);
+
+ /** <p>Returns a lexical representation of the given primitive
+ * 32 bit integer.</p>
+ * @param pValue The <code>int</code> value being converted.
+ * @return A lexical representation of the input value.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public String printInt(int pValue);
+
+ /** <p>Returns a lexical representation of the given primitive
+ * 64 bit integer.</p>
+ * @param pValue The <code>long</code> value being converted.
+ * @return A lexical representation of the input value.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public String printLong(long pValue);
+
+ /** <p>Returns a lexical representation of the given primitive
+ * 16 bit integer.</p>
+ * @param pValue The <code>short</code> value being converted.
+ * @return A lexical representation of the input value.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public String printShort(short pValue);
+
+ /** <p>Returns a lexical representation of the given instance of
+ * {@link BigDecimal}, which is a decimal number in arbitrary
+ * precision.</p>
+ * @param pValue The decimal value being converted.
+ * @return A lexical representation of the input value.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public String printDecimal(BigDecimal pValue);
+
+ /** <p>Returns a lexical representation of the given primitive
+ * 32 bit floating point number.</p>
+ * @param pValue The <code>float</code> value being converted.
+ * @return A lexical representation of the input value.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public String printFloat(float pValue);
+
+ /** <p>Returns a lexical representation of the given primitive
+ * 64 bit floating point number.</p>
+ * @param pValue The <code>double</code> value being converted.
+ * @return A lexical representation of the input value.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public String printDouble(double pValue);
+
+ /** <p>Returns a lexical representation of the given primitive
+ * boolean value.</p>
+ * @param pValue The <code>boolean</code> value being converted.
+ * @return A lexical representation of the input value.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public String printBoolean(boolean pValue);
+
+ /** <p>Returns a lexical representation of the given primitive
+ * 8 bit integer.</p>
+ * @param pValue The <code>byte</code> value being converted.
+ * @return A lexical representation of the input value.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public String printByte(byte pValue);
+
+ /** <p>Returns a lexical representation of the given qualified
+ * name, which is a combination of namespace URI and local name.
+ * The lexical representation is an optional prefix, which is
+ * currently mapped to namespace URI of the qualified name,
+ * followed by a colon and the local name. If the namespace URI
+ * is the current default namespace URI, then the prefix and
+ * the colon may be omitted.</p>
+ * @param pValue The qualified name being converted.
+ * @param pNamespaceContext A mapping of prefixes to namespace
+ * URI's which may be used to determine a valid prefix.
+ * @return A lexical representation of the qualified name.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public String printQName(QName pValue,
+ NamespaceContext pNamespaceContext);
+
+ /** <p>Returns a lexical representation of the given dateTime
+ * value. Valid lexical representations include:
+ * <pre>
+ * YYYY-MM-DDThh:mm:ss
+ * YYYY-MM-DDThh:mm:ss.sss
+ * YYYY-MM-DDThh:mm:ssZ
+ * YYYY-MM-DDThh:mm:ss-01:00
+ * </pre>
+ * The former examples are all specified in UTC time. The last example
+ * uses a negatice offset of one hour to UTC.</p>
+ * @param pValue The dateTime value being converted
+ * @return A lexical representation of the input value.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public String printDateTime(Calendar pValue);
+
+ /** <p>Returns a lexical representation of the given byte array.
+ * The lexical representation is obtained by application of the
+ * base 64 encoding.</p>
+ * @param pValue The byte array being converted.
+ * @return The converted byte array.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public String printBase64Binary(byte[] pValue);
+
+ /** <p>Returns a lexical representation of the given byte array.
+ * The lexical representation is obtained by encoding any byte
+ * as two hex digits.</p>
+ * @param pValue The byte array being converted.
+ * @return The converted byte array.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public String printHexBinary(byte[] pValue);
+
+ /** <p>Returns a lexical representation of the given primitive,
+ * unsigned 32 bit integer.</p>
+ * @param pValue The <code>long</code> value being converted.
+ * @return A lexical representation of the input value.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public java.lang.String printUnsignedInt(long pValue);
+
+ /** <p>Returns a lexical representation of the given primitive,
+ * unsigned 16 bit integer.</p>
+ * @param pValue The <code>short</code> value being converted.
+ * @return A lexical representation of the input value.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public java.lang.String printUnsignedShort(int pValue);
+
+ /** <p>Returns a lexical representation of the given time
+ * value. Valid lexical representations include:
+ * <pre>
+ * hh:mm:ss
+ * hh:mm:ss.sss
+ * hh:mm:ssZ
+ * hh:mm:ss-01:00
+ * </pre>
+ * The former examples are all specified in UTC time. The last example
+ * uses a negatice offset of one hour to UTC.</p>
+ * @param pValue The time value being converted
+ * @return A lexical representation of the input value.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public String printTime(Calendar pValue);
+
+ /** <p>Returns a lexical representation of the given date
+ * value. Valid lexical representations include:
+ * <pre>
+ * YYYY-MM-DD
+ * YYYY-MM-DDZ
+ * YYYY-MM-DD-01:00
+ * </pre>
+ * The former examples are all specified in UTC time. The last example
+ * uses a negatice offset of one hour to UTC.</p>
+ * @param pValue The date value being converted
+ * @return A lexical representation of the input value.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public String printDate(Calendar pValue);
+
+ /** <p>Returns a lexical representation of the given input
+ * string, which is the unmodified input string.</p>
+ * @param pValue The input string.
+ * @return The unmodified input string.
+ * @see javax.xml.bind.PrintConversionEvent
+ */
+ public String printAnySimpleType(String pValue);
+}
Added: webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/Element.java
URL: http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/Element.java?view=auto&rev=494575
==============================================================================
--- webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/Element.java (added)
+++ webservices/jaxme/trunk/ws-jaxme/jaxme-jaxb-api/src/main/java/javax/xml/bind/Element.java Tue Jan 9 13:07:17 2007
@@ -0,0 +1,31 @@
+/*
+ * 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>This interface doesn't expose any methods. Like
+ * {@link java.io.Serializable}, it is a marker interface with the
+ * single purpose of indicating what the implementation is.</p>
+ * <p>See section 5.7 "Element Declaration", and 5.7.1
+ * "Bind to Java Element Interface" of the JAXB specification
+ * for more details.</p>
+ *
+ * @author JSR-31
+ * @since JAXB1.0
+ */
+public interface Element {
+ // No methods, this is a marker interface.
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org