[jbpm-commits] JBoss JBPM SVN: r2467 - in jbpm3/trunk/modules/gwt-console: rpc and 36 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Thu Oct 2 08:37:28 EDT 2008
Author: heiko.braun at jboss.com
Date: 2008-10-02 08:37:27 -0400 (Thu, 02 Oct 2008)
New Revision: 2467
Added:
jbpm3/trunk/modules/gwt-console/rpc/
jbpm3/trunk/modules/gwt-console/rpc/pom.xml
jbpm3/trunk/modules/gwt-console/rpc/src/
jbpm3/trunk/modules/gwt-console/rpc/src/main/
jbpm3/trunk/modules/gwt-console/rpc/src/main/java/
jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/
jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/
jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/
jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/
jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/
jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/ProcessManagementService.java
jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/ProcessManagementServiceAsync.java
jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/
jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinition.java
jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionWrapper.java
jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstance.java
jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstancePerformance.java
jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstanceWrapper.java
jbpm3/trunk/modules/gwt-console/rpc/src/main/resources/
jbpm3/trunk/modules/gwt-console/server/
jbpm3/trunk/modules/gwt-console/server/pom.xml
jbpm3/trunk/modules/gwt-console/server/src/
jbpm3/trunk/modules/gwt-console/server/src/main/
jbpm3/trunk/modules/gwt-console/server/src/main/java/
jbpm3/trunk/modules/gwt-console/server/src/main/java/org/
jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/
jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/
jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/
jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/
jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/BufferedResponseWrapper.java
jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/FilterServletOutputStream.java
jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/GWTJsonFilter.java
jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/ProcessManagement.java
jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/ProcessManagementApplication.java
jbpm3/trunk/modules/gwt-console/server/src/main/resources/
jbpm3/trunk/modules/gwt-console/server/src/main/webapp/
jbpm3/trunk/modules/gwt-console/server/src/main/webapp/WEB-INF/
jbpm3/trunk/modules/gwt-console/server/src/main/webapp/WEB-INF/jboss-web.xml
jbpm3/trunk/modules/gwt-console/server/src/main/webapp/WEB-INF/web.xml
jbpm3/trunk/modules/gwt-console/server/src/main/webapp/index.html
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Binder.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ContextFinder.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/DatatypeConverter.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/DatatypeConverterInterface.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Element.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/JAXBContext.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/JAXBElement.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/JAXBException.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/JAXBIntrospector.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/MarshalException.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Marshaller.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Messages.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/NotIdentifiableEvent.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ParseConversionEvent.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/PrintConversionEvent.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/PropertyException.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/SchemaOutputResolver.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/TypeConstraintException.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/UnmarshalException.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Unmarshaller.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/UnmarshallerHandler.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ValidationEvent.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ValidationEventHandler.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ValidationEventLocator.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ValidationException.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Validator.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/DomHandler.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/W3CDomHandler.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAccessOrder.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAccessType.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAccessorOrder.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAttribute.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElement.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElementRef.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElementRefs.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElementWrapper.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElements.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlEnum.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlID.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlIDREF.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlInlineBinaryData.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlList.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlMimeType.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlMixed.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlNs.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlNsForm.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlRegistry.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlRootElement.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlSchema.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlSchemaTypes.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlTransient.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlType.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlValue.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/XmlAdapter.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/package.html
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/package.html
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/attachment/
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/attachment/AttachmentMarshaller.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/attachment/AttachmentUnmarshaller.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/attachment/package.html
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/AbstractMarshallerImpl.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/DefaultValidationEventHandler.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/Messages.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/NotIdentifiableEventImpl.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/ParseConversionEventImpl.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/PrintConversionEventImpl.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/ValidationEventImpl.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/ValidationEventLocatorImpl.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/package.html
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/package.html
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/util/
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/util/JAXBResult.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/util/JAXBSource.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/util/Messages.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/util/ValidationEventCollector.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/util/package.html
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/Config.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java
Removed:
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinition.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessInstance.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessInstancePerformance.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/ListView.java
Modified:
jbpm3/trunk/modules/gwt-console/pom.xml
jbpm3/trunk/modules/gwt-console/war/pom.xml
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/ConsoleView.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricEditor.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricView.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverview.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverviewEditor.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockMetricsDAO.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockProcessDefinitionDAO.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionList.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceEditor.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java
jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/UIConstants.java
Log:
Console server (REST) and RPC package (data structure), first cut
Modified: jbpm3/trunk/modules/gwt-console/pom.xml
===================================================================
--- jbpm3/trunk/modules/gwt-console/pom.xml 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm3/trunk/modules/gwt-console/pom.xml 2008-10-02 12:37:27 UTC (rev 2467)
@@ -20,6 +20,8 @@
</properties>
<modules>
+ <module>rpc</module>
+ <module>server</module>
<module>war</module>
</modules>
Added: jbpm3/trunk/modules/gwt-console/rpc/pom.xml
===================================================================
--- jbpm3/trunk/modules/gwt-console/rpc/pom.xml (rev 0)
+++ jbpm3/trunk/modules/gwt-console/rpc/pom.xml 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,47 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <name>JBoss jBPM3 - GWT Console (RPC)</name>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>gwt-console-rpc</artifactId>
+ <packaging>jar</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>gwt-console</artifactId>
+ <version>3.3.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-servlet</artifactId>
+ <version>${gwt.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-user</artifactId>
+ <version>${gwt.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <!-- Include SOURCE in output artifact for GWT (GWT libraries must include source) -->
+ <resources>
+ <resource>
+ <directory>src/main/java</directory>
+ </resource>
+ </resources>
+ </build>
+</project>
Property changes on: jbpm3/trunk/modules/gwt-console/rpc/pom.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/ProcessManagementService.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/ProcessManagementService.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/ProcessManagementService.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import com.google.gwt.user.client.rpc.RemoteService;
+
+import java.util.List;
+
+import org.jboss.bpm.console.client.model.ProcessDefinition;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public interface ProcessManagementService extends RemoteService
+{
+ List<ProcessDefinition> getAllProcessDefinitions();
+}
Property changes on: jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/ProcessManagementService.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/ProcessManagementServiceAsync.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/ProcessManagementServiceAsync.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/ProcessManagementServiceAsync.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public interface ProcessManagementServiceAsync
+{
+ void getAllProcessDefinitions(AsyncCallback async);
+}
Property changes on: jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/ProcessManagementServiceAsync.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinition.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinition.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinition.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+import com.google.gwt.user.client.rpc.IsSerializable;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlElement;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at XmlRootElement(name="processDefinition")
+public class ProcessDefinition implements IsSerializable
+{
+ private long processId;
+ private String name;
+ private String version;
+
+ public ProcessDefinition()
+ {
+ }
+
+ public ProcessDefinition(long id, String name, String version)
+ {
+ this.processId = id;
+ this.name = name;
+ this.version = version;
+ }
+
+ @XmlElement(name = "processId")
+ public long getProcessId()
+ {
+ return processId;
+ }
+
+ public void setProcessId(long processId)
+ {
+ this.processId = processId;
+ }
+
+ @XmlElement(name = "name")
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getVersion()
+ {
+ return version;
+ }
+
+ public void setVersion(String version)
+ {
+ this.version = version;
+ }
+
+ public String toString()
+ {
+ return "ProcessDefinition{id="+this.processId +", name="+this.name+"}";
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinition.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionWrapper.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionWrapper.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionWrapper.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at XmlRootElement(name = "wrapper")
+public class ProcessDefinitionWrapper
+{
+
+ List<ProcessDefinition> definitions;
+
+ public ProcessDefinitionWrapper()
+ {
+ }
+
+ public ProcessDefinitionWrapper(List<ProcessDefinition> defs)
+ {
+ this.definitions = defs;
+ }
+
+ @XmlElement
+ public List<ProcessDefinition> getDefinitions()
+ {
+ return definitions;
+ }
+
+ @XmlElement(name = "totalCount")
+ public int getTotalCount()
+ {
+ return definitions.size();
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinitionWrapper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstance.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstance.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstance.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,120 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlElement;
+import java.util.Date;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at XmlRootElement(name="processInstance")
+public class ProcessInstance
+{
+ private long Id;
+ private long parentId;
+
+ private String key;
+ private String status;
+ private Date startDate;
+ private Date endDate;
+
+ public ProcessInstance()
+ {
+ }
+
+ public ProcessInstance(long id, long parentId, String status, Date startDate, Date endDate)
+ {
+ this.Id = id;
+ this.parentId = parentId;
+ this.status = status;
+ this.startDate = startDate;
+ this.endDate = endDate;
+ }
+
+ @XmlElement(name = "instanceId")
+ public long getId()
+ {
+ return Id;
+ }
+
+ public void setId(long id)
+ {
+ Id = id;
+ }
+
+ @XmlElement(name = "parentId")
+ public long getParentId()
+ {
+ return parentId;
+ }
+
+ public void setParentId(long parentId)
+ {
+ this.parentId = parentId;
+ }
+
+ @XmlElement(name = "key")
+ public String getKey()
+ {
+ return key !=null ? key : "";
+ }
+
+ public void setKey(String key)
+ {
+ this.key = key;
+ }
+
+ @XmlElement(name = "status")
+ public String getStatus()
+ {
+ return status;
+ }
+
+ public void setStatus(String status)
+ {
+ this.status = status;
+ }
+
+ @XmlElement(name = "start")
+ public Date getStartDate()
+ {
+ return startDate;
+ }
+
+ public void setStartDate(Date startDate)
+ {
+ this.startDate = startDate;
+ }
+
+ @XmlElement(name = "end")
+ public Date getEndDate()
+ {
+ return endDate;
+ }
+
+ public void setEndDate(Date endDate)
+ {
+ this.endDate = endDate;
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstance.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstancePerformance.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstancePerformance.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstancePerformance.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+import java.util.Map;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public final class ProcessInstancePerformance
+{
+ private long id;
+ private String processName;
+
+ Map instanceMetrics; // Map<instanceId,averageExectime>
+
+ public ProcessInstancePerformance(long processId, String processName, Map instanceMetrics)
+ {
+ this.id = processId;
+ this.processName = processName;
+ this.instanceMetrics = instanceMetrics;
+ }
+
+
+ public long getId()
+ {
+ return id;
+ }
+
+ public String getProcessName()
+ {
+ return processName;
+ }
+
+ public Map getInstanceMetrics()
+ {
+ return instanceMetrics;
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstancePerformance.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstanceWrapper.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstanceWrapper.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstanceWrapper.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.model;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at XmlRootElement(name = "wrapper")
+public class ProcessInstanceWrapper
+{
+
+ List<ProcessInstance> instances;
+
+ public ProcessInstanceWrapper()
+ {
+ }
+
+ public ProcessInstanceWrapper(List<ProcessInstance> instances)
+ {
+ this.instances = instances;
+ }
+
+ @XmlElement
+ public List<ProcessInstance> getInstances()
+ {
+ return instances;
+ }
+
+ @XmlElement(name = "totalCount")
+ public int getTotalCount()
+ {
+ return instances.size();
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstanceWrapper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/server/pom.xml
===================================================================
--- jbpm3/trunk/modules/gwt-console/server/pom.xml (rev 0)
+++ jbpm3/trunk/modules/gwt-console/server/pom.xml 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,68 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+
+ <modelVersion>4.0.0</modelVersion>
+ <name>JBoss jBPM3 - GWT Console (Server)</name>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>gwt-console-server</artifactId>
+ <packaging>war</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>gwt-console</artifactId>
+ <version>3.3.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>gwt-console-rpc</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-servlet</artifactId>
+ <version>${gwt.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-user</artifactId>
+ <version>${gwt.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jaxrs</artifactId>
+ <version>1.0-beta-8</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <!-- Include SOURCE in output artifact for GWT (GWT libraries must include source) -->
+ <resources>
+ <resource>
+ <directory>src/main/java</directory>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ </resources>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ <finalName>gwt-console-server</finalName>
+ </build>
+</project>
Property changes on: jbpm3/trunk/modules/gwt-console/server/pom.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/BufferedResponseWrapper.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/BufferedResponseWrapper.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/BufferedResponseWrapper.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server;
+
+
+import javax.servlet.http.HttpServletResponseWrapper;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletOutputStream;
+import java.io.PrintWriter;
+import java.io.ByteArrayOutputStream;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class BufferedResponseWrapper extends HttpServletResponseWrapper
+{
+ private ByteArrayOutputStream output;
+ private int contentLength;
+ private String contentType = "";
+
+ public BufferedResponseWrapper(HttpServletResponse httpServletResponse)
+ {
+ super(httpServletResponse);
+ output=new ByteArrayOutputStream();
+ }
+
+ public byte[] getData() {
+ return output.toByteArray();
+ }
+
+ public ServletOutputStream getOutputStream() {
+ return new FilterServletOutputStream(output);
+ }
+
+ public PrintWriter getWriter() {
+ return new PrintWriter(getOutputStream(),true);
+ }
+
+ public void setContentLength(int length) {
+ this.contentLength = length;
+ super.setContentLength(length);
+ }
+
+ public int getContentLength() {
+ return contentLength;
+ }
+
+ public void setContentType(String type) {
+ this.contentType = type;
+ super.setContentType(type);
+ }
+
+ public String getContentType() {
+ return contentType;
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/BufferedResponseWrapper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/FilterServletOutputStream.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/FilterServletOutputStream.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/FilterServletOutputStream.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server;
+
+import javax.servlet.ServletOutputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class FilterServletOutputStream extends ServletOutputStream
+{
+
+ private DataOutputStream stream;
+
+ public FilterServletOutputStream(OutputStream output) {
+ stream = new DataOutputStream(output);
+ }
+
+ public void write(int b) throws IOException {
+ stream.write(b);
+ }
+
+ public void write(byte[] b) throws IOException {
+ stream.write(b);
+ }
+
+ public void write(byte[] b, int off, int len) throws IOException
+ {
+ stream.write(b,off,len);
+ }
+
+}
Property changes on: jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/FilterServletOutputStream.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/GWTJsonFilter.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/GWTJsonFilter.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/GWTJsonFilter.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,100 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server;
+
+import javax.servlet.*;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.OutputStream;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class GWTJsonFilter implements Filter
+{
+
+ public FilterConfig filterConfig;
+ private static final String COLLECTION_PREFIX = "{\"wrapper\":";
+ private static final String COLLECTION_SUFFIX = "}";
+
+ public void init(FilterConfig filterConfig) throws ServletException
+ {
+ this.filterConfig = filterConfig;
+ }
+
+ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
+ throws IOException, ServletException
+ {
+
+ boolean isGWTRequest = false;
+
+ // identify GWT json requests
+ if(request.getParameter("callback")!=null)
+ isGWTRequest = true;
+
+ // sneak in repsonse wrapper
+ OutputStream out = response.getOutputStream();
+ BufferedResponseWrapper wrapper = new BufferedResponseWrapper((HttpServletResponse) response);
+
+ // proceed chain
+ chain.doFilter(request, wrapper);
+
+ // add callback std. json output
+ String contentType = response.getContentType() != null ? response.getContentType() : "application/octet-stream";
+ boolean isJSONEncoding = contentType.equals("application/json");
+ StringBuffer sb = null;
+ if(isGWTRequest && isJSONEncoding)
+ {
+ String payload = new String(wrapper.getData());
+ String gwtextFriendly = trimPayload(payload);
+
+ sb = new StringBuffer(request.getParameter("callback"));
+ sb.append("(");
+ sb.append(gwtextFriendly);
+ sb.append(");");
+ }
+
+ // flush
+ if(sb!=null)
+ out.write(sb.toString().getBytes());
+ else
+ out.write(wrapper.getData());
+
+ out.flush();
+ out.close();
+ }
+
+ private String trimPayload(String payload)
+ {
+ String s = payload;
+ if(s.startsWith(COLLECTION_PREFIX))
+ {
+ s = payload.substring( COLLECTION_PREFIX.length(), payload.lastIndexOf(COLLECTION_SUFFIX));
+ }
+ return s;
+ }
+
+ public void destroy()
+ {
+
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/GWTJsonFilter.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/ProcessManagement.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/ProcessManagement.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/ProcessManagement.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server;
+
+import org.jboss.bpm.console.client.model.ProcessDefinitionWrapper;
+import org.jboss.bpm.console.client.model.ProcessDefinition;
+import org.jboss.bpm.console.client.model.ProcessInstanceWrapper;
+import org.jboss.bpm.console.client.model.ProcessInstance;
+import org.jboss.resteasy.annotations.providers.jaxb.json.BadgerFish;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.PathParam;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Date;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+ at Path("process")
+public class ProcessManagement
+{
+ final static List<ProcessDefinition> defs = new ArrayList<ProcessDefinition>();
+ static
+ {
+ defs.add( new ProcessDefinition(1, "OrderProcess", "1"));
+ defs.add( new ProcessDefinition(2, "VacationManagement", "1"));
+ defs.add( new ProcessDefinition(3, "New Employee walkthrough", "1"));
+ defs.add( new ProcessDefinition(4, "Source code review", "2"));
+ defs.add( new ProcessDefinition(5, "Loan application", "1"));
+ defs.add( new ProcessDefinition(6, "Expense report review", "4"));
+ defs.add( new ProcessDefinition(7, "Expense claim", "4"));
+ defs.add( new ProcessDefinition(8, "Credit approval", "4"));
+ defs.add( new ProcessDefinition(9, "Hello World", "4"));
+ }
+
+ final static List instances = new ArrayList();
+ static
+ {
+ instances.add( new ProcessInstance(2, -1, "Running", new Date(), null));
+ instances.add( new ProcessInstance(3, -1, "Stopped", new Date(System.currentTimeMillis()-(1000*60*120)), new Date(System.currentTimeMillis()-(1000*60*12))));
+ instances.add( new ProcessInstance(4, -1, "Ended", new Date(System.currentTimeMillis()-(1000*60*60)), new Date(System.currentTimeMillis()-(1000*60*24))));
+ instances.add( new ProcessInstance(5, -1, "Suspended", new Date(System.currentTimeMillis()-(1000*60*90)), new Date(System.currentTimeMillis()-(1000*60*17))));
+ instances.add( new ProcessInstance(6, -1, "Running", new Date(), null));
+ instances.add( new ProcessInstance(7, -1, "Running", new Date(), null));
+ }
+
+
+ @GET
+ @Path("definitions")
+ @Produces("application/json")
+ public ProcessDefinitionWrapper getDefinitionsJSON()
+ {
+ return new ProcessDefinitionWrapper(defs);
+ }
+
+ @GET
+ @Path("definitions/{id}/instances")
+ @Produces("application/json")
+ public ProcessInstanceWrapper getInstancesJSON(@PathParam("id") long instanceId)
+ {
+ return new ProcessInstanceWrapper(instances);
+ }
+
+}
Property changes on: jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/ProcessManagement.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/ProcessManagementApplication.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/ProcessManagementApplication.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/ProcessManagementApplication.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.server;
+
+import javax.ws.rs.core.Application;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ProcessManagementApplication extends Application
+{
+ HashSet<Object> singletons = new HashSet<Object>();
+
+ public ProcessManagementApplication()
+ {
+ singletons.add(new ProcessManagement());
+ }
+
+ @Override
+ public Set<Class<?>> getClasses()
+ {
+ HashSet<Class<?>> set = new HashSet<Class<?>>();
+ return set;
+ }
+
+ @Override
+ public Set<Object> getSingletons()
+ {
+ return singletons;
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/server/src/main/java/org/jboss/bpm/console/server/ProcessManagementApplication.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/server/src/main/webapp/WEB-INF/jboss-web.xml
===================================================================
--- jbpm3/trunk/modules/gwt-console/server/src/main/webapp/WEB-INF/jboss-web.xml (rev 0)
+++ jbpm3/trunk/modules/gwt-console/server/src/main/webapp/WEB-INF/jboss-web.xml 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jboss-web PUBLIC
+ "-//JBoss//DTD Web Application 2.4//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
+
+<jboss-web>
+
+ <!--security-domain>java:/jaas/jbpm-console</security-domain-->
+
+ <context-root>gwt-console-server</context-root>
+
+ <loader-repository>
+ org.bpm.console.server:gwt-consoler-server.war
+ </loader-repository>
+
+ <!--resource-ref>
+ <res-ref-name>jdbc/JbpmDataSource</res-ref-name>
+ <jndi-name>java:/JbpmDS</jndi-name>
+ </resource-ref>
+ -->
+
+</jboss-web>
Property changes on: jbpm3/trunk/modules/gwt-console/server/src/main/webapp/WEB-INF/jboss-web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/server/src/main/webapp/WEB-INF/web.xml
===================================================================
--- jbpm3/trunk/modules/gwt-console/server/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ jbpm3/trunk/modules/gwt-console/server/src/main/webapp/WEB-INF/web.xml 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,45 @@
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd" >
+
+<web-app>
+ <display-name>GWT Console Server</display-name>
+
+ <context-param>
+ <param-name>javax.ws.rs.core.Application</param-name>
+ <param-value>org.jboss.bpm.console.server.ProcessManagementApplication</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>resteasy.servlet.mapping.prefix</param-name>
+ <param-value>/rs</param-value>
+ </context-param>
+
+ <filter>
+ <filter-name>gwtJSON</filter-name>
+ <filter-class>org.jboss.bpm.console.server.GWTJsonFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>gwtJSON</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <listener>
+ <listener-class>
+ org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap
+ </listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>Resteasy</servlet-name>
+ <servlet-class>
+ org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher
+ </servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Resteasy</servlet-name>
+ <url-pattern>/rs/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Property changes on: jbpm3/trunk/modules/gwt-console/server/src/main/webapp/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/server/src/main/webapp/index.html
===================================================================
--- jbpm3/trunk/modules/gwt-console/server/src/main/webapp/index.html (rev 0)
+++ jbpm3/trunk/modules/gwt-console/server/src/main/webapp/index.html 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,43 @@
+<html>
+<body>
+
+<h1>GWT Console Server</h1>
+
+<h2>Published REST Url's </h2>
+
+<table border=1 cellpadding=5>
+ <tr>
+ <th>Method</th>
+ <th>Context</th>
+ <th>Description</th>
+ <th>Mime Types</th>
+ </tr>
+
+ <tr>
+ <td colspan=4><h3>Process Management</h3></td>
+ </tr>
+
+ <tr>
+ <td>GET</td>
+ <td><a href="/gwt-console-server/rs/process/definitions">/rs/process/definitions</a></td>
+ <td>A list of process definitions</td>
+ <td>application/json, text/html</td>
+ </tr>
+
+ <tr>
+ <td>GET</td>
+ <td><a href="/gwt-console-server/rs/process/1/instances">/rs/process/definitions/{id}/instances</a></td>
+ <td>A list of process instances for a given process definition</td>
+ <td>application/json, text/html</td>
+ </tr>
+
+</table>
+
+<h2>Example usage</h2>
+
+<pre>
+ curl -H 'Accept: application/json' http://localhost:8080/gwt-console-server/rs/process/definitions
+ curl -H 'Accept: application/json' http://localhrocess/definitions/1/instances
+</pre>
+</body>
+</html>
\ No newline at end of file
Modified: jbpm3/trunk/modules/gwt-console/war/pom.xml
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/pom.xml 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm3/trunk/modules/gwt-console/war/pom.xml 2008-10-02 12:37:27 UTC (rev 2467)
@@ -16,7 +16,20 @@
<!-- Dependencies -->
<dependencies>
+
<dependency>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>gwt-console-rpc</artifactId>
+ <version>${version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jbpm.jbpm3</groupId>
+ <artifactId>gwt-console-server</artifactId>
+ <version>${version}</version>
+ </dependency>
+
+ <dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>${gwt.version}</version>
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Binder.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Binder.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Binder.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,401 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+import org.w3c.dom.Node;
+
+import javax.xml.validation.Schema;
+
+/**
+ * Enable synchronization between XML infoset nodes and JAXB objects
+ * representing same XML document.
+ *
+ * <p>
+ * An instance of this class maintains the association between XML nodes of
+ * an infoset preserving view and a JAXB representation of an XML document.
+ * Navigation between the two views is provided by the methods
+ * {@link #getXMLNode(Object)} and {@link #getJAXBNode(Object)}.
+ *
+ * <p>
+ * Modifications can be made to either the infoset preserving view or the
+ * JAXB representation of the document while the other view remains
+ * unmodified. The binder is able to synchronize the changes made in the
+ * modified view back into the other view using the appropriate
+ * Binder update methods, {@link #updateXML(Object, Object)} or
+ * {@link #updateJAXB(Object)}.
+ *
+ * <p>
+ * A typical usage scenario is the following:
+ * <ul>
+ * <li>load XML document into an XML infoset representation</li>
+ * <li>{@link #unmarshal(Object)} XML infoset view to JAXB view.
+ * (Note to conserve resources, it is possible to only unmarshal a
+ * subtree of the XML infoset view to the JAXB view.)</li>
+ * <li>application access/updates JAXB view of XML document.</li>
+ * <li>{@link #updateXML(Object)} synchronizes modifications to JAXB view
+ * back into the XML infoset view. Update operation preserves as
+ * much of original XML infoset as possible (i.e. comments, PI, ...)</li>
+ * </ul>
+ *
+ * <p>
+ * A Binder instance is created using the factory method
+ * {@link JAXBContext#createBinder()} or {@link JAXBContext#createBinder(Class)}.
+ *
+ * <p>
+ * The template parameter, <code>XmlNode</code>, is the
+ * root interface/class for the XML infoset preserving representation.
+ * A Binder implementation is required to minimally support
+ * an <code>XmlNode</code> value of <code>org.w3c.dom.Node.class</code>.
+ * A Binder implementation can support alternative XML infoset
+ * preserving representations.
+ *
+ * @author
+ * Kohsuke Kawaguchi (kohsuke.kawaguchi at sun.com)
+ * Joseph Fialli
+ *
+ * @since JAXB 2.0
+ */
+public abstract class Binder<XmlNode> {
+ /**
+ * Unmarshal XML infoset view to a JAXB object tree.
+ *
+ * <p>
+ * This method is similar to {@link Unmarshaller#unmarshal(Node)}
+ * with the addition of maintaining the association between XML nodes
+ * and the produced JAXB objects, enabling future update operations,
+ * {@link #updateXML(Object, Object)} or {@link #updateJAXB(Object)}.
+ *
+ * <p>
+ * When {@link #getSchema()} is non-null, <code>xmlNode</code>
+ * and its descendants is validated during this operation.
+ *
+ * <p>
+ * This method throws {@link UnmarshalException} when the Binder's
+ * {@link JAXBContext} does not have a mapping for the XML element name
+ * or the type, specifiable via <tt>@xsi:type</tt>, of <tt>xmlNode</tt>
+ * to a JAXB mapped class. The method {@link #unmarshal(Object, Class)}
+ * enables an application to specify the JAXB mapped class that
+ * the <tt>xmlNode</tt> should be mapped to.
+ *
+ * @param xmlNode
+ * the document/element to unmarshal XML data from.
+ *
+ * @return
+ * the newly created root object of the JAXB object tree.
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Binder</tt> is unable to perform the XML to Java
+ * binding.
+ * @throws IllegalArgumentException
+ * If the node parameter is null
+ */
+ public abstract Object unmarshal( XmlNode xmlNode ) throws JAXBException;
+
+ /**
+ * Unmarshal XML root element by provided <tt>declaredType</tt>
+ * to a JAXB object tree.
+ *
+ * <p>
+ * Implements <a href="Unmarshaller.html#unmarshalByDeclaredType">Unmarshal by Declared Type</a>
+ *
+ * <p>
+ * This method is similar to {@link Unmarshaller#unmarshal(Node, Class)}
+ * with the addition of maintaining the association between XML nodes
+ * and the produced JAXB objects, enabling future update operations,
+ * {@link #updateXML(Object, Object)} or {@link #updateJAXB(Object)}.
+ *
+ * <p>
+ * When {@link #getSchema()} is non-null, <code>xmlNode</code>
+ * and its descendants is validated during this operation.
+ *
+ * @param xmlNode
+ * the document/element to unmarshal XML data from.
+ * @param declaredType
+ * appropriate JAXB mapped class to hold <tt>node</tt>'s XML data.
+ *
+ * @return
+ * <a href="#unmarshalDeclaredTypeReturn">JAXB Element</a> representation
+ * of <tt>node</tt>
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Binder</tt> is unable to perform the XML to Java
+ * binding.
+ * @throws IllegalArgumentException
+ * If any of the input parameters are null
+ * @since JAXB2.0
+ */
+ public abstract <T> JAXBElement<T>
+ unmarshal( XmlNode xmlNode, Class<T> declaredType )
+ throws JAXBException;
+
+ /**
+ * Marshal a JAXB object tree to a new XML document.
+ *
+ * <p>
+ * This method is similar to {@link Marshaller#marshal(Object, Node)}
+ * with the addition of maintaining the association between JAXB objects
+ * and the produced XML nodes,
+ * enabling future update operations such as
+ * {@link #updateXML(Object, Object)} or {@link #updateJAXB(Object)}.
+ *
+ * <p>
+ * When {@link #getSchema()} is non-null, the marshalled
+ * xml content is validated during this operation.
+ *
+ * @param jaxbObject
+ * The content tree to be marshalled.
+ * @param xmlNode
+ * The parameter must be a Node that accepts children.
+ *
+ * @throws JAXBException
+ * If any unexpected problem occurs during the marshalling.
+ * @throws MarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Binder</tt> is unable to marshal <tt>jaxbObject</tt> (or any
+ * object reachable from <tt>jaxbObject</tt>).
+ *
+ * @throws IllegalArgumentException
+ * If any of the method parameters are null
+ */
+ public abstract void marshal( Object jaxbObject, XmlNode xmlNode ) throws JAXBException;
+
+ /**
+ * Gets the XML element associated with the given JAXB object.
+ *
+ * <p>
+ * Once a JAXB object tree is associated with an XML fragment,
+ * this method enables navigation between the two trees.
+ *
+ * <p>
+ * An association between an XML element and a JAXB object is
+ * established by the bind methods and the update methods.
+ * Note that this association is partial; not all XML elements
+ * have associated JAXB objects, and not all JAXB objects have
+ * associated XML elements.
+ *
+ * @param jaxbObject An instance that is reachable from a prior
+ * call to a bind or update method that returned
+ * a JAXB object tree.
+ *
+ * @return
+ * null if the specified JAXB object is not known to this
+ * {@link Binder}, or if it is not associated with an
+ * XML element.
+ *
+ * @throws IllegalArgumentException
+ * If the jaxbObject parameter is null
+ */
+ public abstract XmlNode getXMLNode( Object jaxbObject );
+
+ /**
+ * Gets the JAXB object associated with the given XML element.
+ *
+ * <p>
+ * Once a JAXB object tree is associated with an XML fragment,
+ * this method enables navigation between the two trees.
+ *
+ * <p>
+ * An association between an XML element and a JAXB object is
+ * established by the unmarshal, marshal and update methods.
+ * Note that this association is partial; not all XML elements
+ * have associated JAXB objects, and not all JAXB objects have
+ * associated XML elements.
+ *
+ * @return
+ * null if the specified XML node is not known to this
+ * {@link Binder}, or if it is not associated with a
+ * JAXB object.
+ *
+ * @throws IllegalArgumentException
+ * If the node parameter is null
+ */
+ public abstract Object getJAXBNode( XmlNode xmlNode );
+
+ /**
+ * Takes an JAXB object and updates
+ * its associated XML node and its descendants.
+ *
+ * <p>
+ * This is a convenience method of:
+ * <pre>
+ * updateXML( jaxbObject, getXMLNode(jaxbObject));
+ * </pre>
+ *
+ * @throws JAXBException
+ * If any unexpected problem occurs updating corresponding XML content.
+ * @throws IllegalArgumentException
+ * If the jaxbObject parameter is null
+ */
+ public abstract XmlNode updateXML( Object jaxbObject ) throws JAXBException;
+
+ /**
+ * Changes in JAXB object tree are updated in its associated XML parse tree.
+ *
+ * <p>
+ * This operation can be thought of as an "in-place" marshalling.
+ * The difference is that instead of creating a whole new XML tree,
+ * this operation updates an existing tree while trying to preserve
+ * the XML as much as possible.
+ *
+ * <p>
+ * For example, unknown elements/attributes in XML that were not bound
+ * to JAXB will be left untouched (whereas a marshalling operation
+ * would create a new tree that doesn't contain any of those.)
+ *
+ * <p>
+ * As a side-effect, this operation updates the association between
+ * XML nodes and JAXB objects.
+ *
+ * @param jaxbObject root of potentially modified JAXB object tree
+ * @param xmlNode root of update target XML parse tree
+ *
+ * @return
+ * Returns the updated XML node. Typically, this is the same
+ * node you passed in as <i>xmlNode</i>, but it maybe
+ * a different object, for example when the tag name of the object
+ * has changed.
+ *
+ * @throws JAXBException
+ * If any unexpected problem occurs updating corresponding XML content.
+ * @throws IllegalArgumentException
+ * If any of the input parameters are null
+ */
+ public abstract XmlNode updateXML( Object jaxbObject, XmlNode xmlNode ) throws JAXBException;
+
+ /**
+ * Takes an XML node and updates its associated JAXB object and its descendants.
+ *
+ * <p>
+ * This operation can be thought of as an "in-place" unmarshalling.
+ * The difference is that instead of creating a whole new JAXB tree,
+ * this operation updates an existing tree, reusing as much JAXB objects
+ * as possible.
+ *
+ * <p>
+ * As a side-effect, this operation updates the association between
+ * XML nodes and JAXB objects.
+ *
+ * @return
+ * Returns the updated JAXB object. Typically, this is the same
+ * object that was returned from earlier
+ * {@link #marshal(Object,Object)} or
+ * {@link #updateJAXB(Object)} method invocation,
+ * but it maybe
+ * a different object, for example when the name of the XML
+ * element has changed.
+ *
+ * @throws JAXBException
+ * If any unexpected problem occurs updating corresponding JAXB mapped content.
+ * @throws IllegalArgumentException
+ * If node parameter is null
+ */
+ public abstract Object updateJAXB( XmlNode xmlNode ) throws JAXBException;
+
+
+ /**
+ * Specifies whether marshal, unmarshal and update methods
+ * performs validation on their XML content.
+ *
+ * @param schema set to null to disable validation.
+ *
+ * @see Unmarshaller#setSchema(Schema)
+ */
+ public abstract void setSchema( Schema schema );
+
+ /**
+ * Gets the last {@link Schema} object (including null) set by the
+ * {@link #setSchema(Schema)} method.
+ *
+ * @return the Schema object for validation or null if not present
+ */
+ public abstract Schema getSchema();
+
+ /**
+ * Allow an application to register a <tt>ValidationEventHandler</tt>.
+ * <p>
+ * The <tt>ValidationEventHandler</tt> will be called by the JAXB Provider
+ * if any validation errors are encountered during calls to any of the
+ * Binder unmarshal, marshal and update methods.
+ *
+ * <p>
+ * Calling this method with a null parameter will cause the Binder
+ * to revert back to the default default event handler.
+ *
+ * @param handler the validation event handler
+ * @throws JAXBException if an error was encountered while setting the
+ * event handler
+ */
+ public abstract void setEventHandler( ValidationEventHandler handler ) throws JAXBException;
+
+ /**
+ * Return the current event handler or the default event handler if one
+ * hasn't been set.
+ *
+ * @return the current ValidationEventHandler or the default event handler
+ * if it hasn't been set
+ * @throws JAXBException if an error was encountered while getting the
+ * current event handler
+ */
+ public abstract ValidationEventHandler getEventHandler() throws JAXBException;
+
+ /**
+ *
+ * Set the particular property in the underlying implementation of
+ * <tt>Binder</tt>. This method can only be used to set one of
+ * the standard JAXB defined unmarshal/marshal properties
+ * or a provider specific property for binder, unmarshal or marshal.
+ * Attempting to set an undefined property will result in
+ * a PropertyException being thrown. See
+ * <a href="Unmarshaller.html#supportedProps">Supported Unmarshal Properties</a>
+ * and
+ * <a href="Marshaller.html#supportedProps">Supported Marshal Properties</a>.
+ *
+ * @param name the name of the property to be set. This value can either
+ * be specified using one of the constant fields or a user
+ * supplied string.
+ * @param value the value of the property to be set
+ *
+ * @throws PropertyException when there is an error processing the given
+ * property or value
+ * @throws IllegalArgumentException
+ * If the name parameter is null
+ */
+ abstract public void setProperty( String name, Object value ) throws PropertyException;
+
+
+ /**
+ * Get the particular property in the underlying implementation of
+ * <tt>Binder</tt>. This method can only
+ * be used to get one of
+ * the standard JAXB defined unmarshal/marshal properties
+ * or a provider specific property for binder, unmarshal or marshal.
+ * Attempting to get an undefined property will result in
+ * a PropertyException being thrown. See
+ * <a href="Unmarshaller.html#supportedProps">Supported Unmarshal Properties</a>
+ * and
+ * <a href="Marshaller.html#supportedProps">Supported Marshal Properties</a>.
+ *
+ * @param name the name of the property to retrieve
+ * @return the value of the requested property
+ *
+ * @throws PropertyException
+ * when there is an error retrieving the given property or value
+ * property name
+ * @throws IllegalArgumentException
+ * If the name parameter is null
+ */
+ abstract public Object getProperty( String name ) throws PropertyException;
+
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Binder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ContextFinder.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ContextFinder.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ContextFinder.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,467 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
+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;
+import java.util.logging.ConsoleHandler;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import static javax.xml.bind.JAXBContext.JAXB_CONTEXT_FACTORY;
+
+//import java.lang.reflect.InvocationTargetException;
+
+/**
+ * This class is package private and therefore is not exposed as part of the
+ * JAXB API.
+ *
+ * This code is designed to implement the JAXB 1.0 spec pluggability feature
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$
+ * @see JAXBContext
+ */
+class ContextFinder {
+ private static final Logger logger;
+ static {
+ logger = Logger.getLogger("javax.xml.bind");
+ try {
+ if (System.getProperty("jaxb.debug", null) != null) {
+ // disconnect the logger from a bigger framework (if any)
+ // and take the matters into our own hands
+ logger.setUseParentHandlers(false);
+ logger.setLevel(Level.ALL);
+ ConsoleHandler handler = new ConsoleHandler();
+ handler.setLevel(Level.ALL);
+ logger.addHandler(handler);
+ } else {
+ // don't change the setting of this logger
+ // to honor what other frameworks
+ // have done on configurations.
+ }
+ } catch(Throwable t) {
+ // just to be extra safe. in particular System.getProperty may throw
+ // SecurityException.
+ }
+ }
+
+ /**
+ * If the {@link InvocationTargetException} wraps an exception that shouldn't be wrapped,
+ * throw the wrapped exception.
+ */
+ private static void handleInvocationTargetException(InvocationTargetException x) throws JAXBException {
+ Throwable t = x.getTargetException();
+ if( t != null ) {
+ if( t instanceof JAXBException )
+ // one of our exceptions, just re-throw
+ throw (JAXBException)t;
+ if( t instanceof RuntimeException )
+ // avoid wrapping exceptions unnecessarily
+ throw (RuntimeException)t;
+ if( t instanceof Error )
+ throw (Error)t;
+ }
+ }
+
+
+ /**
+ * Determine if two types (JAXBContext in this case) will generate a ClassCastException.
+ *
+ * For example, (targetType)originalType
+ *
+ * @param originalType
+ * The Class object of the type being cast
+ * @param targetType
+ * The Class object of the type that is being cast to
+ * @throws JAXBException
+ * If the cast would fail
+ */
+ private static void handleClassCastException(Class originalType, Class targetType) throws JAXBException {
+ final URL targetTypeURL = which(targetType);
+
+ throw new JAXBException(Messages.format(Messages.ILLEGAL_CAST,
+ // we don't care where the impl class is, we want to know where JAXBContext lives in the impl
+ // class' ClassLoader
+ originalType.getClass().getClassLoader().getResource("javax/xml/bind/JAXBContext.class").toString(),
+ targetTypeURL.toString()));
+ }
+
+ /**
+ * Create an instance of a class using the specified ClassLoader
+ */
+ static JAXBContext newInstance( String contextPath,
+ String className,
+ ClassLoader classLoader,
+ Map properties )
+ throws JAXBException
+ {
+ try {
+ Class spiClass;
+ if (classLoader == null) {
+ spiClass = Class.forName(className);
+ } else {
+ spiClass = classLoader.loadClass(className);
+ }
+
+ /*
+ * javax.xml.bind.context.factory points to a class which has a
+ * static method called 'createContext' that
+ * returns a javax.xml.JAXBContext.
+ */
+
+ Object context = null;
+
+ // first check the method that takes Map as the third parameter.
+ // this is added in 2.0.
+ try {
+ Method m = spiClass.getMethod("createContext",String.class,ClassLoader.class,Map.class);
+ // any failure in invoking this method would be considered fatal
+ context = m.invoke(null,contextPath,classLoader,properties);
+ } catch (NoSuchMethodException e) {
+ ; // it's not an error for the provider not to have this method.
+ }
+
+ if(context==null) {
+ // try the old method that doesn't take properties. compatible with 1.0.
+ // it is an error for an implementation not to have both forms of the createContext method.
+ Method m = spiClass.getMethod("createContext",String.class,ClassLoader.class);
+ // any failure in invoking this method would be considered fatal
+ context = m.invoke(null,contextPath,classLoader);
+ }
+
+ if(!(context instanceof JAXBContext)) {
+ // the cast would fail, so generate an exception with a nice message
+ handleClassCastException(context.getClass(), JAXBContext.class);
+ }
+ return (JAXBContext)context;
+ } catch (ClassNotFoundException x) {
+ throw new JAXBException(
+ Messages.format( Messages.PROVIDER_NOT_FOUND, className ),
+ x);
+ } catch (InvocationTargetException x) {
+ handleInvocationTargetException(x);
+ // for other exceptions, wrap the internal target exception
+ // with a JAXBException
+ Throwable e = x;
+ if(x.getTargetException()!=null)
+ e = x.getTargetException();
+
+ throw new JAXBException( Messages.format( Messages.COULD_NOT_INSTANTIATE, className, e ), e );
+ } catch (RuntimeException x) {
+ // avoid wrapping RuntimeException to JAXBException,
+ // because it indicates a bug in this code.
+ throw x;
+ } catch (Exception x) {
+ // can't catch JAXBException because the method is hidden behind
+ // reflection. Root element collisions detected in the call to
+ // createContext() are reported as JAXBExceptions - just re-throw it
+ // some other type of exception - just wrap it
+ throw new JAXBException(
+ Messages.format( Messages.COULD_NOT_INSTANTIATE, className, x ),
+ x);
+ }
+ }
+
+
+ /**
+ * Create an instance of a class using the specified ClassLoader
+ */
+ static JAXBContext newInstance(
+ Class[] classes,
+ Map properties,
+ String className) throws JAXBException {
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ Class spi;
+ try {
+ logger.fine("Trying to load "+className);
+ if (cl != null)
+ spi = cl.loadClass(className);
+ else
+ spi = Class.forName(className);
+ } catch (ClassNotFoundException e) {
+ throw new JAXBException(e);
+ }
+
+ if(logger.isLoggable(Level.FINE)) {
+ // extra check to avoid costly which operation if not logged
+ logger.fine("loaded "+className+" from "+which(spi));
+ }
+
+ Method m;
+ try {
+ m = spi.getMethod("createContext", Class[].class, Map.class);
+ } catch (NoSuchMethodException e) {
+ throw new JAXBException(e);
+ }
+ try {
+ Object context = m.invoke(null, classes, properties);
+ if(!(context instanceof JAXBContext)) {
+ // the cast would fail, so generate an exception with a nice message
+ handleClassCastException(context.getClass(), JAXBContext.class);
+ }
+ return (JAXBContext)context;
+ } catch (IllegalAccessException e) {
+ throw new JAXBException(e);
+ } catch (InvocationTargetException e) {
+ handleInvocationTargetException(e);
+
+ Throwable x = e;
+ if (e.getTargetException() != null)
+ x = e.getTargetException();
+
+ throw new JAXBException(x);
+ }
+ }
+
+
+ static JAXBContext find(String factoryId, String contextPath, ClassLoader classLoader, Map properties ) throws JAXBException {
+
+ // TODO: do we want/need another layer of searching in $java.home/lib/jaxb.properties like JAXP?
+
+ final String jaxbContextFQCN = JAXBContext.class.getName();
+
+ // search context path for jaxb.properties first
+ StringBuilder propFileName;
+ StringTokenizer packages = new StringTokenizer( contextPath, ":" );
+ String factoryClassName;
+
+ if(!packages.hasMoreTokens())
+ // no context is specified
+ throw new JAXBException(Messages.format(Messages.NO_PACKAGE_IN_CONTEXTPATH));
+
+
+ logger.fine("Searching jaxb.properties");
+
+ while( packages.hasMoreTokens() ) {
+ String packageName = packages.nextToken(":").replace('.','/');
+ // com.acme.foo - > com/acme/foo/jaxb.properties
+ propFileName = new StringBuilder().append(packageName).append("/jaxb.properties");
+
+ Properties props = loadJAXBProperties( classLoader, propFileName.toString() );
+ if (props == null) {
+ continue;
+ } else {
+ if (props.containsKey(factoryId)) {
+ factoryClassName = props.getProperty(factoryId);
+ return newInstance( contextPath, factoryClassName, classLoader, properties );
+ } else {
+ throw new JAXBException(Messages.format(Messages.MISSING_PROPERTY, packageName, factoryId));
+ }
+ }
+ }
+
+ logger.fine("Searching the system property");
+
+ // search for a system property second (javax.xml.bind.JAXBContext)
+ factoryClassName = System.getProperty(jaxbContextFQCN, null);
+ if( factoryClassName != null ) {
+ return newInstance( contextPath, factoryClassName, classLoader, properties );
+ }
+
+ logger.fine("Searching META-INF/services");
+
+ // search META-INF services next
+ BufferedReader r;
+ try {
+ final StringBuilder resource = new StringBuilder().append("META-INF/services/").append(jaxbContextFQCN);
+ final InputStream resourceStream =
+ classLoader.getResourceAsStream(resource.toString());
+
+ if (resourceStream != null) {
+ r = new BufferedReader(new InputStreamReader(resourceStream, "UTF-8"));
+ factoryClassName = r.readLine().trim();
+ return newInstance(contextPath, factoryClassName, classLoader, properties);
+ } else {
+ logger.fine("Unable to load:" + resource.toString());
+ }
+ } catch (UnsupportedEncodingException e) {
+ // should never happen
+ throw new JAXBException(e);
+ } catch (IOException e) {
+ throw new JAXBException(e);
+ }
+
+ // else no provider found
+ logger.fine("Trying to create the platform default provider");
+ return newInstance(contextPath, PLATFORM_DEFAULT_FACTORY_CLASS, classLoader, properties);
+ }
+
+ // TODO: log each step in the look up process
+ static JAXBContext find( Class[] classes, Map properties ) throws JAXBException {
+
+ // TODO: do we want/need another layer of searching in $java.home/lib/jaxb.properties like JAXP?
+
+ final String jaxbContextFQCN = JAXBContext.class.getName();
+ String factoryClassName;
+
+ // search for jaxb.properties in the class loader of each class first
+ for (Class c : classes) {
+ ClassLoader classLoader = c.getClassLoader();
+ Package pkg = c.getPackage();
+ if(pkg==null)
+ continue; // this is possible for primitives, arrays, and classes that are loaded by poorly implemented ClassLoaders
+ String packageName = pkg.getName().replace('.', '/');
+
+ // TODO: do we want to optimize away searching the same package? org.Foo, org.Bar, com.Baz
+ // classes from the same package might come from different class loades, so it might be a bad idea
+
+ // TODO: it's easier to look things up from the class
+ // c.getResourceAsStream("jaxb.properties");
+
+ // build the resource name and use the property loader code
+ String resourceName = packageName+"/jaxb.properties";
+ logger.fine("Trying to locate "+resourceName);
+ Properties props = loadJAXBProperties(classLoader, resourceName);
+ if (props == null) {
+ logger.fine(" not found");
+ continue;
+ } else {
+ logger.fine(" found");
+ if (props.containsKey(JAXB_CONTEXT_FACTORY)) {
+ // trim() seems redundant, but adding to satisfy customer complaint
+ factoryClassName = props.getProperty(JAXB_CONTEXT_FACTORY).trim();
+ return newInstance(classes, properties, factoryClassName);
+ } else {
+ throw new JAXBException(Messages.format(Messages.MISSING_PROPERTY, packageName, JAXB_CONTEXT_FACTORY));
+ }
+ }
+ }
+
+ // search for a system property second (javax.xml.bind.JAXBContext)
+ logger.fine("Checking system property "+jaxbContextFQCN);
+ factoryClassName = System.getProperty(jaxbContextFQCN, null);
+ if( factoryClassName != null ) {
+ logger.fine(" found "+factoryClassName);
+ return newInstance( classes, properties, factoryClassName );
+ }
+ logger.fine(" not found");
+
+ // search META-INF services next
+ logger.fine("Checking META-INF/services");
+ BufferedReader r;
+ try {
+ final String resource = new StringBuilder("META-INF/services/").append(jaxbContextFQCN).toString();
+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+ URL resourceURL;
+ if(classLoader==null)
+ resourceURL = ClassLoader.getSystemResource(resource);
+ else
+ resourceURL = classLoader.getResource(resource);
+
+ if (resourceURL != null) {
+ logger.fine("Reading "+resourceURL);
+ r = new BufferedReader(new InputStreamReader(resourceURL.openStream(), "UTF-8"));
+ factoryClassName = r.readLine().trim();
+ return newInstance(classes, properties, factoryClassName);
+ } else {
+ logger.fine("Unable to find: " + resource);
+ }
+ } catch (UnsupportedEncodingException e) {
+ // should never happen
+ throw new JAXBException(e);
+ } catch (IOException e) {
+ throw new JAXBException(e);
+ }
+
+ // else no provider found
+ logger.fine("Trying to create the platform default provider");
+ return newInstance(classes, properties, PLATFORM_DEFAULT_FACTORY_CLASS);
+ }
+
+
+ private static Properties loadJAXBProperties( ClassLoader classLoader,
+ String propFileName )
+ throws JAXBException {
+
+ Properties props = null;
+
+ try {
+ URL url;
+ if(classLoader==null)
+ url = ClassLoader.getSystemResource(propFileName);
+ else
+ url = classLoader.getResource( propFileName );
+
+ if( url != null ) {
+ logger.fine("loading props from "+url);
+ props = new Properties();
+ InputStream is = url.openStream();
+ props.load( is );
+ is.close();
+ }
+ } catch( IOException ioe ) {
+ logger.log(Level.FINE,"Unable to load "+propFileName,ioe);
+ throw new JAXBException( ioe.toString(), ioe );
+ }
+
+ return props;
+ }
+
+
+ /**
+ * Search the given ClassLoader for an instance of the specified class and
+ * return a string representation of the URL that points to the resource.
+ *
+ * @param clazz
+ * The class to search for
+ * @param loader
+ * The ClassLoader to search. If this parameter is null, then the
+ * system class loader will be searched
+ * @return
+ * the URL for the class or null if it wasn't found
+ */
+ static URL which(Class clazz, ClassLoader loader) {
+
+ String classnameAsResource = clazz.getName().replace('.', '/') + ".class";
+
+ if(loader == null) {
+ loader = ClassLoader.getSystemClassLoader();
+ }
+
+ return loader.getResource(classnameAsResource);
+ }
+
+ /**
+ * Get the URL for the Class from it's ClassLoader.
+ *
+ * Convenience method for {@link #which(Class, ClassLoader)}.
+ *
+ * Equivalent to calling: which(clazz, clazz.getClassLoader())
+ *
+ * @param clazz
+ * The class to search for
+ * @return
+ * the URL for the class or null if it wasn't found
+ */
+ static URL which(Class clazz) {
+ return which(clazz, clazz.getClassLoader());
+ }
+
+ /**
+ * When JAXB is in J2SE, rt.jar has to have a JAXB implementation.
+ * However, rt.jar cannot have META-INF/services/javax.xml.bind.JAXBContext
+ * because if it has, it will take precedence over any file that applications have
+ * in their jar files.
+ *
+ * <p>
+ * When the user bundles his own JAXB implementation, we'd like to use it, and we
+ * want the platform default to be used only when there's no other JAXB provider.
+ *
+ * <p>
+ * For this reason, we have to hard-code the class name into the API.
+ */
+ private static final String PLATFORM_DEFAULT_FACTORY_CLASS = "com.sun.xml.bind.v2.ContextFactory";
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ContextFinder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/DatatypeConverter.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/DatatypeConverter.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/DatatypeConverter.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,624 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+import javax.xml.namespace.NamespaceContext;
+
+/**
+ * <p>
+ * The javaType binding declaration can be used to customize the binding of
+ * an XML schema datatype to a Java datatype. Customizations can involve
+ * writing a parse and print method for parsing and printing lexical
+ * representations of a XML schema datatype respectively. However, writing
+ * parse and print methods requires knowledge of the lexical representations (
+ * <a href="http://www.w3.org/TR/xmlschema-2/"> XML Schema Part2: Datatypes
+ * specification </a>) and hence may be difficult to write.
+ * </p>
+ * <p>
+ * This class makes it easier to write parse and print methods. It defines
+ * static parse and print methods that provide access to a JAXB provider's
+ * implementation of parse and print methods. These methods are invoked by
+ * custom parse and print methods. For example, the binding of xsd:dateTime
+ * to a long can be customized using parse and print methods as follows:
+ * <blockquote>
+ * <pre>
+ * // Customized parse method
+ * public long myParseCal( String dateTimeString ) {
+ * java.util.Calendar cal = DatatypeConverter.parseDateTime(dateTimeString);
+ * long longval = convert_calendar_to_long(cal); //application specific
+ * return longval;
+ * }
+ *
+ * // Customized print method
+ * public String myPrintCal( Long longval ) {
+ * java.util.Calendar cal = convert_long_to_calendar(longval) ; //application specific
+ * String dateTimeString = DatatypeConverter.printDateTime(cal);
+ * return dateTimeString;
+ * }
+ * </pre>
+ * </blockquote>
+ * <p>
+ * There is a static parse and print method corresponding to each parse and
+ * print method respectively in the {@link DatatypeConverterInterface
+ * DatatypeConverterInterface}.
+ * <p>
+ * The static methods defined in the class can also be used to specify
+ * a parse or a print method in a javaType binding declaration.
+ * </p>
+ * <p>
+ * JAXB Providers are required to call the
+ * {@link #setDatatypeConverter(DatatypeConverterInterface)
+ * setDatatypeConverter} api at some point before the first marshal or unmarshal
+ * operation (perhaps during the call to JAXBContext.newInstance). This step is
+ * necessary to configure the converter that should be used to perform the
+ * print and parse functionality.
+ * </p>
+ *
+ * <p>
+ * A print method for a XML schema datatype can output any lexical
+ * representation that is valid with respect to the XML schema datatype.
+ * If an error is encountered during conversion, then an IllegalArgumentException,
+ * or a subclass of IllegalArgumentException must be thrown by the method.
+ * </p>
+ *
+ * @author <ul><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Ryan Shoemaker,Sun Microsystems Inc.</li></ul>
+ * @version $Revision$
+ * @see DatatypeConverterInterface
+ * @see ParseConversionEvent
+ * @see PrintConversionEvent
+ * @since JAXB1.0
+ */
+
+final public class DatatypeConverter {
+
+ // delegate to this instance of DatatypeConverter
+ private static DatatypeConverterInterface theConverter = null;
+
+ private DatatypeConverter() {
+ // private constructor
+ }
+
+ /**
+ * This method is for JAXB provider use only.
+ * <p>
+ * JAXB Providers are required to call this method at some point before
+ * allowing any of the JAXB client marshal or unmarshal operations to
+ * occur. This is necessary to configure the datatype converter that
+ * should be used to perform the print and parse conversions.
+ *
+ * <p>
+ * Calling this api repeatedly will have no effect - the
+ * DatatypeConverterInterface instance passed into the first invocation is
+ * the one that will be used from then on.
+ *
+ * @param converter an instance of a class that implements the
+ * DatatypeConverterInterface class - this parameter must not be null.
+ * @throws IllegalArgumentException if the parameter is null
+ */
+ public static void setDatatypeConverter( DatatypeConverterInterface converter ) {
+ if( converter == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.CONVERTER_MUST_NOT_BE_NULL ) );
+ } else if( theConverter == null ) {
+ theConverter = converter;
+ }
+ }
+
+ /**
+ * <p>
+ * Convert the lexical XSD string argument into a String value.
+ * @param lexicalXSDString
+ * A string containing a lexical representation of
+ * xsd:string.
+ * @return
+ * A String value represented by the string argument.
+ */
+ public static String parseString( String lexicalXSDString ) {
+ return theConverter.parseString( lexicalXSDString );
+ }
+
+ /**
+ * <p>
+ * Convert the string argument into a BigInteger value.
+ * @param lexicalXSDInteger
+ * A string containing a lexical representation of
+ * xsd:integer.
+ * @return
+ * A BigInteger value represented by the string argument.
+ * @throws NumberFormatException <code>lexicalXSDInteger</code> is not a valid string representation of a {@link java.math.BigInteger} value.
+ */
+ public static java.math.BigInteger parseInteger( String lexicalXSDInteger ) {
+ return theConverter.parseInteger( lexicalXSDInteger );
+ }
+
+ /**
+ * <p>
+ * Convert the string argument into an int value.
+ * @param lexicalXSDInt
+ * A string containing a lexical representation of
+ * xsd:int.
+ * @return
+ * A int value represented by the string argument.
+ * @throws NumberFormatException <code>lexicalXSDInt</code> is not a valid string representation of an <code>int</code> value.
+ */
+ public static int parseInt( String lexicalXSDInt ) {
+ return theConverter.parseInt( lexicalXSDInt );
+ }
+
+ /**
+ * <p>
+ * Converts the string argument into a long value.
+ * @param lexicalXSDLong
+ * A string containing lexical representation of
+ * xsd:long.
+ * @return
+ * A long value represented by the string argument.
+ * @throws NumberFormatException <code>lexicalXSDLong</code> is not a valid string representation of a <code>long</code> value.
+ */
+ public static long parseLong( String lexicalXSDLong ) {
+ return theConverter.parseLong( lexicalXSDLong );
+ }
+
+ /**
+ * <p>
+ * Converts the string argument into a short value.
+ * @param lexicalXSDShort
+ * A string containing lexical representation of
+ * xsd:short.
+ * @return
+ * A short value represented by the string argument.
+ * @throws NumberFormatException <code>lexicalXSDShort</code> is not a valid string representation of a <code>short</code> value.
+ */
+ public static short parseShort( String lexicalXSDShort ) {
+ return theConverter.parseShort( lexicalXSDShort );
+ }
+
+ /**
+ * <p>
+ * Converts the string argument into a BigDecimal value.
+ * @param lexicalXSDDecimal
+ * A string containing lexical representation of
+ * xsd:decimal.
+ * @return
+ * A BigDecimal value represented by the string argument.
+ * @throws NumberFormatException <code>lexicalXSDDecimal</code> is not a valid string representation of {@link java.math.BigDecimal}.
+ */
+ public static java.math.BigDecimal parseDecimal( String lexicalXSDDecimal ) {
+ return theConverter.parseDecimal( lexicalXSDDecimal );
+ }
+
+ /**
+ * <p>
+ * Converts the string argument into a float value.
+ * @param lexicalXSDFloat
+ * A string containing lexical representation of
+ * xsd:float.
+ * @return
+ * A float value represented by the string argument.
+ * @throws NumberFormatException <code>lexicalXSDFloat</code> is not a valid string representation of a <code>float</code> value.
+ */
+ public static float parseFloat( String lexicalXSDFloat ) {
+ return theConverter.parseFloat( lexicalXSDFloat );
+ }
+
+ /**
+ * <p>
+ * Converts the string argument into a double value.
+ * @param lexicalXSDDouble
+ * A string containing lexical representation of
+ * xsd:double.
+ * @return
+ * A double value represented by the string argument.
+ * @throws NumberFormatException <code>lexicalXSDDouble</code> is not a valid string representation of a <code>double</code> value.
+ */
+ public static double parseDouble( String lexicalXSDDouble ) {
+ return theConverter.parseDouble( lexicalXSDDouble );
+ }
+
+ /**
+ * <p>
+ * Converts the string argument into a boolean value.
+ * @param lexicalXSDBoolean
+ * A string containing lexical representation of
+ * xsd:boolean.
+ * @return
+ * A boolean value represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:boolean.
+ */
+ public static boolean parseBoolean( String lexicalXSDBoolean ) {
+ return theConverter.parseBoolean( lexicalXSDBoolean );
+ }
+
+ /**
+ * <p>
+ * Converts the string argument into a byte value.
+ * @param lexicalXSDByte
+ * A string containing lexical representation of
+ * xsd:byte.
+ * @return
+ * A byte value represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:byte.
+ */
+ public static byte parseByte( String lexicalXSDByte ) {
+ return theConverter.parseByte( lexicalXSDByte );
+ }
+
+ /**
+ * <p>
+ * Converts the string argument into a byte value.
+ *
+ * <p>
+ * String parameter <tt>lexicalXSDQname</tt> must conform to lexical value space specifed at
+ * <a href="http://www.w3.org/TR/xmlschema-2/#QName">XML Schema Part 2:Datatypes specification:QNames</a>
+ *
+ * @param lexicalXSDQName
+ * A string containing lexical representation of xsd:QName.
+ * @param nsc
+ * A namespace context for interpreting a prefix within a QName.
+ * @return
+ * A QName value represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to XML Schema Part 2 specification or
+ * if namespace prefix of <tt>lexicalXSDQname</tt> is not bound to a URI in NamespaceContext <tt>nsc</tt>.
+ */
+ public static javax.xml.namespace.QName parseQName( String lexicalXSDQName,
+ NamespaceContext nsc) {
+ return theConverter.parseQName( lexicalXSDQName, nsc );
+ }
+
+ /**
+ * <p>
+ * Converts the string argument into a Calendar value.
+ * @param lexicalXSDDateTime
+ * A string containing lexical representation of
+ * xsd:datetime.
+ * @return
+ * A Calendar object represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:dateTime.
+ */
+ public static java.util.Calendar parseDateTime( String lexicalXSDDateTime ) {
+ return theConverter.parseDateTime( lexicalXSDDateTime );
+ }
+
+ /**
+ * <p>
+ * Converts the string argument into an array of bytes.
+ * @param lexicalXSDBase64Binary
+ * A string containing lexical representation
+ * of xsd:base64Binary.
+ * @return
+ * An array of bytes represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:base64Binary
+ */
+ public static byte[] parseBase64Binary( String lexicalXSDBase64Binary ) {
+ return theConverter.parseBase64Binary( lexicalXSDBase64Binary );
+ }
+
+ /**
+ * <p>
+ * Converts the string argument into an array of bytes.
+ * @param lexicalXSDHexBinary
+ * A string containing lexical representation of
+ * xsd:hexBinary.
+ * @return
+ * An array of bytes represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:hexBinary.
+ */
+ public static byte[] parseHexBinary( String lexicalXSDHexBinary ) {
+ return theConverter.parseHexBinary( lexicalXSDHexBinary );
+ }
+
+ /**
+ * <p>
+ * Converts the string argument into a long value.
+ * @param lexicalXSDUnsignedInt
+ * A string containing lexical representation
+ * of xsd:unsignedInt.
+ * @return
+ * A long value represented by the string argument.
+ * @throws NumberFormatException if string parameter can not be parsed into a <tt>long</tt> value.
+ */
+ public static long parseUnsignedInt( String lexicalXSDUnsignedInt ) {
+ return theConverter.parseUnsignedInt( lexicalXSDUnsignedInt );
+ }
+
+ /**
+ * <p>
+ * Converts the string argument into an int value.
+ * @param lexicalXSDUnsignedShort
+ * A string containing lexical
+ * representation of xsd:unsignedShort.
+ * @return
+ * An int value represented by the string argument.
+ * @throws NumberFormatException if string parameter can not be parsed into an <tt>int</tt> value.
+ */
+ public static int parseUnsignedShort( String lexicalXSDUnsignedShort ) {
+ return theConverter.parseUnsignedShort( lexicalXSDUnsignedShort );
+ }
+
+ /**
+ * <p>
+ * Converts the string argument into a Calendar value.
+ * @param lexicalXSDTime
+ * A string containing lexical representation of
+ * xsd:time.
+ * @return
+ * A Calendar value represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:Time.
+ */
+ public static java.util.Calendar parseTime( String lexicalXSDTime ) {
+ return theConverter.parseTime( lexicalXSDTime );
+ }
+ /**
+ * <p>
+ * Converts the string argument into a Calendar value.
+ * @param lexicalXSDDate
+ * A string containing lexical representation of
+ * xsd:Date.
+ * @return
+ * A Calendar value represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:Date.
+ */
+ public static java.util.Calendar parseDate( String lexicalXSDDate ) {
+ return theConverter.parseDate( lexicalXSDDate );
+ }
+
+ /**
+ * <p>
+ * Return a string containing the lexical representation of the
+ * simple type.
+ * @param lexicalXSDAnySimpleType
+ * A string containing lexical
+ * representation of the simple type.
+ * @return
+ * A string containing the lexical representation of the
+ * simple type.
+ */
+ public static String parseAnySimpleType( String lexicalXSDAnySimpleType ) {
+ return theConverter.parseAnySimpleType( lexicalXSDAnySimpleType );
+ }
+ /**
+ * <p>
+ * Converts the string argument into a string.
+ * @param val
+ * A string value.
+ * @return
+ * A string containing a lexical representation of xsd:string.
+ */
+ // also indicate the print methods produce a lexical
+ // representation for given Java datatypes.
+
+ public static String printString( String val ) {
+ return theConverter.printString( val );
+ }
+
+ /**
+ * <p>
+ * Converts a BigInteger value into a string.
+ * @param val
+ * A BigInteger value
+ * @return
+ * A string containing a lexical representation of xsd:integer
+ * @throws IllegalArgumentException <tt>val</tt> is null.
+ */
+ public static String printInteger( java.math.BigInteger val ) {
+ return theConverter.printInteger( val );
+ }
+
+ /**
+ * <p>
+ * Converts an int value into a string.
+ * @param val
+ * An int value
+ * @return
+ * A string containing a lexical representation of xsd:int
+ */
+ public static String printInt( int val ) {
+ return theConverter.printInt( val );
+ }
+
+ /**
+ * <p>
+ * Converts A long value into a string.
+ * @param val
+ * A long value
+ * @return
+ * A string containing a lexical representation of xsd:long
+ */
+ public static String printLong( long val ) {
+ return theConverter.printLong( val );
+ }
+
+ /**
+ * <p>
+ * Converts a short value into a string.
+ * @param val
+ * A short value
+ * @return
+ * A string containing a lexical representation of xsd:short
+ */
+ public static String printShort( short val ) {
+ return theConverter.printShort( val );
+ }
+
+ /**
+ * <p>
+ * Converts a BigDecimal value into a string.
+ * @param val
+ * A BigDecimal value
+ * @return
+ * A string containing a lexical representation of xsd:decimal
+ * @throws IllegalArgumentException <tt>val</tt> is null.
+ */
+ public static String printDecimal( java.math.BigDecimal val ) {
+ return theConverter.printDecimal( val );
+ }
+
+ /**
+ * <p>
+ * Converts a float value into a string.
+ * @param val
+ * A float value
+ * @return
+ * A string containing a lexical representation of xsd:float
+ */
+ public static String printFloat( float val ) {
+ return theConverter.printFloat( val );
+ }
+
+ /**
+ * <p>
+ * Converts a double value into a string.
+ * @param val
+ * A double value
+ * @return
+ * A string containing a lexical representation of xsd:double
+ */
+ public static String printDouble( double val ) {
+ return theConverter.printDouble( val );
+ }
+
+ /**
+ * <p>
+ * Converts a boolean value into a string.
+ * @param val
+ * A boolean value
+ * @return
+ * A string containing a lexical representation of xsd:boolean
+ */
+ public static String printBoolean( boolean val ) {
+ return theConverter.printBoolean( val );
+ }
+
+ /**
+ * <p>
+ * Converts a byte value into a string.
+ * @param val
+ * A byte value
+ * @return
+ * A string containing a lexical representation of xsd:byte
+ */
+ public static String printByte( byte val ) {
+ return theConverter.printByte( val );
+ }
+
+ /**
+ * <p>
+ * Converts a QName instance into a string.
+ * @param val
+ * A QName value
+ * @param nsc
+ * A namespace context for interpreting a prefix within a QName.
+ * @return
+ * A string containing a lexical representation of QName
+ * @throws IllegalArgumentException if <tt>val</tt> is null or
+ * if <tt>nsc</tt> is non-null or <tt>nsc.getPrefix(nsprefixFromVal)</tt> is null.
+ */
+ public static String printQName( javax.xml.namespace.QName val,
+ NamespaceContext nsc ) {
+ return theConverter.printQName( val, nsc );
+ }
+
+ /**
+ * <p>
+ * Converts a Calendar value into a string.
+ * @param val
+ * A Calendar value
+ * @return
+ * A string containing a lexical representation of xsd:dateTime
+ * @throws IllegalArgumentException if <tt>val</tt> is null.
+ */
+ public static String printDateTime( java.util.Calendar val ) {
+ return theConverter.printDateTime( val );
+ }
+
+ /**
+ * <p>
+ * Converts an array of bytes into a string.
+ * @param val
+ * An array of bytes
+ * @return
+ * A string containing a lexical representation of xsd:base64Binary
+ * @throws IllegalArgumentException if <tt>val</tt> is null.
+ */
+ public static String printBase64Binary( byte[] val ) {
+ return theConverter.printBase64Binary( val );
+ }
+
+ /**
+ * <p>
+ * Converts an array of bytes into a string.
+ * @param val
+ * An array of bytes
+ * @return
+ * A string containing a lexical representation of xsd:hexBinary
+ * @throws IllegalArgumentException if <tt>val</tt> is null.
+ */
+ public static String printHexBinary( byte[] val ) {
+ return theConverter.printHexBinary( val );
+ }
+
+ /**
+ * <p>
+ * Converts a long value into a string.
+ * @param val
+ * A long value
+ * @return
+ * A string containing a lexical representation of xsd:unsignedInt
+ */
+ public static String printUnsignedInt( long val ) {
+ return theConverter.printUnsignedInt( val );
+ }
+
+ /**
+ * <p>
+ * Converts an int value into a string.
+ * @param val
+ * An int value
+ * @return
+ * A string containing a lexical representation of xsd:unsignedShort
+ */
+ public static String printUnsignedShort( int val ) {
+ return theConverter.printUnsignedShort( val );
+ }
+
+ /**
+ * <p>
+ * Converts a Calendar value into a string.
+ * @param val
+ * A Calendar value
+ * @return
+ * A string containing a lexical representation of xsd:time
+ * @throws IllegalArgumentException if <tt>val</tt> is null.
+ */
+ public static String printTime( java.util.Calendar val ) {
+ return theConverter.printTime( val );
+ }
+
+ /**
+ * <p>
+ * Converts a Calendar value into a string.
+ * @param val
+ * A Calendar value
+ * @return
+ * A string containing a lexical representation of xsd:date
+ * @throws IllegalArgumentException if <tt>val</tt> is null.
+ */
+ public static String printDate( java.util.Calendar val ) {
+ return theConverter.printDate( val );
+ }
+
+ /**
+ * <p>
+ * Converts a string value into a string.
+ * @param val
+ * A string value
+ * @return
+ * A string containing a lexical representation of xsd:AnySimpleType
+ */
+ public static String printAnySimpleType( String val ) {
+ return theConverter.printAnySimpleType( val );
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/DatatypeConverter.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/DatatypeConverterInterface.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/DatatypeConverterInterface.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/DatatypeConverterInterface.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,504 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+/**
+ * <p>
+ * The DatatypeConverterInterface is for JAXB provider use only. A
+ * JAXB provider must supply a class that implements this interface.
+ * JAXB Providers are required to call the
+ * {@link DatatypeConverter#setDatatypeConverter(DatatypeConverterInterface)
+ * DatatypeConverter.setDatatypeConverter} api at
+ * some point before the first marshal or unmarshal operation (perhaps during
+ * the call to JAXBContext.newInstance). This step is necessary to configure
+ * the converter that should be used to perform the print and parse
+ * functionality. Calling this api repeatedly will have no effect - the
+ * DatatypeConverter instance passed into the first invocation is the one that
+ * will be used from then on.
+ * </p>
+ *
+ * <p>
+ * This interface defines the parse and print methods. There is one
+ * parse and print method for each XML schema datatype specified in the
+ * the default binding Table 5-1 in the JAXB specification.
+ * </p>
+ *
+ * <p>
+ * The parse and print methods defined here are invoked by the static parse
+ * and print methods defined in the {@link DatatypeConverter DatatypeConverter}
+ * class.
+ * </p>
+ *
+ * <p>
+ * A parse method for a XML schema datatype must be capable of converting any
+ * lexical representation of the XML schema datatype ( specified by the
+ * <a href="http://www.w3.org/TR/xmlschema-2/"> XML Schema Part2: Datatypes
+ * specification</a> into a value in the value space of the XML schema datatype.
+ * If an error is encountered during conversion, then an IllegalArgumentException
+ * or a subclass of IllegalArgumentException must be thrown by the method.
+ *
+ * </p>
+ *
+ * <p>
+ * A print method for a XML schema datatype can output any lexical
+ * representation that is valid with respect to the XML schema datatype.
+ * If an error is encountered during conversion, then an IllegalArgumentException,
+ * or a subclass of IllegalArgumentException must be thrown by the method.
+ * </p>
+ *
+ * The prefix xsd: is used to refer to XML schema datatypes
+ * <a href="http://www.w3.org/TR/xmlschema-2/"> XML Schema Part2: Datatypes
+ * specification.</a>
+ *
+ * <p>
+ * @author <ul><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Ryan Shoemaker,Sun Microsystems Inc.</li></ul>
+ * @version $Revision$
+ * @see DatatypeConverter
+ * @see ParseConversionEvent
+ * @see PrintConversionEvent
+ * @since JAXB1.0
+ */
+
+public interface DatatypeConverterInterface {
+ /**
+ * <p>
+ * Convert the string argument into a string.
+ * @param lexicalXSDString
+ * A lexical representation of the XML Schema datatype xsd:string
+ * @return
+ * A string that is the same as the input string.
+ */
+ public String parseString( String lexicalXSDString );
+
+ /**
+ * <p>
+ * Convert the string argument into a BigInteger value.
+ * @param lexicalXSDInteger
+ * A string containing a lexical representation of
+ * xsd:integer.
+ * @return
+ * A BigInteger value represented by the string argument.
+ * @throws NumberFormatException <code>lexicalXSDInteger</code> is not a valid string representation of a {@link java.math.BigInteger} value.
+ */
+ public java.math.BigInteger parseInteger( String lexicalXSDInteger );
+
+ /**
+ * <p>
+ * Convert the string argument into an int value.
+ * @param lexicalXSDInt
+ * A string containing a lexical representation of
+ * xsd:int.
+ * @return
+ * An int value represented byte the string argument.
+ * @throws NumberFormatException <code>lexicalXSDInt</code> is not a valid string representation of an <code>int</code> value.
+ */
+ public int parseInt( String lexicalXSDInt );
+
+ /**
+ * <p>
+ * Converts the string argument into a long value.
+ * @param lexicalXSDLong
+ * A string containing lexical representation of
+ * xsd:long.
+ * @return
+ * A long value represented by the string argument.
+ * @throws NumberFormatException <code>lexicalXSDLong</code> is not a valid string representation of a <code>long</code> value.
+ */
+ public long parseLong( String lexicalXSDLong );
+
+ /**
+ * <p>
+ * Converts the string argument into a short value.
+ * @param lexicalXSDShort
+ * A string containing lexical representation of
+ * xsd:short.
+ * @return
+ * A short value represented by the string argument.
+ * @throws NumberFormatException <code>lexicalXSDShort</code> is not a valid string representation of a <code>short</code> value.
+ */
+ public short parseShort( String lexicalXSDShort );
+
+ /**
+ * <p>
+ * Converts the string argument into a BigDecimal value.
+ * @param lexicalXSDDecimal
+ * A string containing lexical representation of
+ * xsd:decimal.
+ * @return
+ * A BigDecimal value represented by the string argument.
+ * @throws NumberFormatException <code>lexicalXSDDecimal</code> is not a valid string representation of {@link java.math.BigDecimal}.
+ */
+ public java.math.BigDecimal parseDecimal( String lexicalXSDDecimal );
+
+ /**
+ * <p>
+ * Converts the string argument into a float value.
+ * @param lexicalXSDFloat
+ * A string containing lexical representation of
+ * xsd:float.
+ * @return
+ * A float value represented by the string argument.
+ * @throws NumberFormatException <code>lexicalXSDFloat</code> is not a valid string representation of a <code>float</code> value.
+ */
+ public float parseFloat( String lexicalXSDFloat );
+
+ /**
+ * <p>
+ * Converts the string argument into a double value.
+ * @param lexicalXSDDouble
+ * A string containing lexical representation of
+ * xsd:double.
+ * @return
+ * A double value represented by the string argument.
+ * @throws NumberFormatException <code>lexicalXSDDouble</code> is not a valid string representation of a <code>double</code> value.
+ */
+ public double parseDouble( String lexicalXSDDouble );
+
+ /**
+ * <p>
+ * Converts the string argument into a boolean value.
+ * @param lexicalXSDBoolean
+ * A string containing lexical representation of
+ * xsd:boolean.
+ * @return
+ * A boolean value represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:boolean.
+ */
+ public boolean parseBoolean( String lexicalXSDBoolean );
+
+ /**
+ * <p>
+ * Converts the string argument into a byte value.
+ * @param lexicalXSDByte
+ * A string containing lexical representation of
+ * xsd:byte.
+ * @return
+ * A byte value represented by the string argument.
+ * @throws NumberFormatException <code>lexicalXSDByte</code> does not contain a parseable byte.
+ * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:byte.
+ */
+ public byte parseByte( String lexicalXSDByte );
+
+ /**
+ * <p>
+ * Converts the string argument into a QName value.
+ *
+ * <p>
+ * String parameter <tt>lexicalXSDQname</tt> must conform to lexical value space specifed at
+ * <a href="http://www.w3.org/TR/xmlschema-2/#QName">XML Schema Part 2:Datatypes specification:QNames</a>
+ *
+ * @param lexicalXSDQName
+ * A string containing lexical representation of xsd:QName.
+ * @param nsc
+ * A namespace context for interpreting a prefix within a QName.
+ * @return
+ * A QName value represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to XML Schema Part 2 specification or
+ * if namespace prefix of <tt>lexicalXSDQname</tt> is not bound to a URI in NamespaceContext <tt>nsc</tt>.
+ */
+ public javax.xml.namespace.QName parseQName( String lexicalXSDQName,
+ javax.xml.namespace.NamespaceContext nsc);
+
+ /**
+ * <p>
+ * Converts the string argument into a Calendar value.
+ * @param lexicalXSDDateTime
+ * A string containing lexical representation of
+ * xsd:datetime.
+ * @return
+ * A Calendar object represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:dateTime.
+ */
+ public java.util.Calendar parseDateTime( String lexicalXSDDateTime );
+
+ /**
+ * <p>
+ * Converts the string argument into an array of bytes.
+ * @param lexicalXSDBase64Binary
+ * A string containing lexical representation
+ * of xsd:base64Binary.
+ * @return
+ * An array of bytes represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:base64Binary
+ */
+ public byte[] parseBase64Binary( String lexicalXSDBase64Binary );
+
+ /**
+ * <p>
+ * Converts the string argument into an array of bytes.
+ * @param lexicalXSDHexBinary
+ * A string containing lexical representation of
+ * xsd:hexBinary.
+ * @return
+ * An array of bytes represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:hexBinary.
+ */
+ public byte[] parseHexBinary( String lexicalXSDHexBinary );
+
+ /**
+ * <p>
+ * Converts the string argument into a long value.
+ * @param lexicalXSDUnsignedInt
+ * A string containing lexical representation
+ * of xsd:unsignedInt.
+ * @return
+ * A long value represented by the string argument.
+ * @throws NumberFormatException if string parameter can not be parsed into a <tt>long</tt> value.
+ */
+ public long parseUnsignedInt( String lexicalXSDUnsignedInt );
+
+ /**
+ * <p>
+ * Converts the string argument into an int value.
+ * @param lexicalXSDUnsignedShort
+ * A string containing lexical
+ * representation of xsd:unsignedShort.
+ * @return
+ * An int value represented by the string argument.
+ * @throws NumberFormatException if string parameter can not be parsed into an <tt>int</tt> value.
+ */
+ public int parseUnsignedShort( String lexicalXSDUnsignedShort );
+
+ /**
+ * <p>
+ * Converts the string argument into a Calendar value.
+ * @param lexicalXSDTime
+ * A string containing lexical representation of
+ * xsd:Time.
+ * @return
+ * A Calendar value represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:Time.
+ */
+ public java.util.Calendar parseTime( String lexicalXSDTime );
+
+ /**
+ * <p>
+ * Converts the string argument into a Calendar value.
+ * @param lexicalXSDDate
+ * A string containing lexical representation of
+ * xsd:Date.
+ * @return
+ * A Calendar value represented by the string argument.
+ * @throws IllegalArgumentException if string parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for xsd:Date.
+ */
+ public java.util.Calendar parseDate( String lexicalXSDDate );
+
+ /**
+ * <p>
+ * Return a string containing the lexical representation of the
+ * simple type.
+ * @param lexicalXSDAnySimpleType
+ * A string containing lexical
+ * representation of the simple type.
+ * @return
+ * A string containing the lexical representation of the
+ * simple type.
+ */
+ public String parseAnySimpleType( String lexicalXSDAnySimpleType );
+
+ /**
+ * <p>
+ * Converts the string argument into a string.
+ * @param val
+ * A string value.
+ * @return
+ * A string containing a lexical representation of xsd:string
+ */
+ public String printString( String val );
+
+ /**
+ * <p>
+ * Converts a BigInteger value into a string.
+ * @param val
+ * A BigInteger value
+ * @return
+ * A string containing a lexical representation of xsd:integer
+ * @throws IllegalArgumentException <tt>val</tt> is null.
+ */
+ public String printInteger( java.math.BigInteger val );
+
+ /**
+ * <p>
+ * Converts an int value into a string.
+ * @param val
+ * An int value
+ * @return
+ * A string containing a lexical representation of xsd:int
+ */
+ public String printInt( int val );
+
+
+ /**
+ * <p>
+ * Converts a long value into a string.
+ * @param val
+ * A long value
+ * @return
+ * A string containing a lexical representation of xsd:long
+ */
+ public String printLong( long val );
+
+ /**
+ * <p>
+ * Converts a short value into a string.
+ * @param val
+ * A short value
+ * @return
+ * A string containing a lexical representation of xsd:short
+ */
+ public String printShort( short val );
+
+ /**
+ * <p>
+ * Converts a BigDecimal value into a string.
+ * @param val
+ * A BigDecimal value
+ * @return
+ * A string containing a lexical representation of xsd:decimal
+ * @throws IllegalArgumentException <tt>val</tt> is null.
+ */
+ public String printDecimal( java.math.BigDecimal val );
+
+ /**
+ * <p>
+ * Converts a float value into a string.
+ * @param val
+ * A float value
+ * @return
+ * A string containing a lexical representation of xsd:float
+ */
+ public String printFloat( float val );
+
+ /**
+ * <p>
+ * Converts a double value into a string.
+ * @param val
+ * A double value
+ * @return
+ * A string containing a lexical representation of xsd:double
+ */
+ public String printDouble( double val );
+
+ /**
+ * <p>
+ * Converts a boolean value into a string.
+ * @param val
+ * A boolean value
+ * @return
+ * A string containing a lexical representation of xsd:boolean
+ */
+ public String printBoolean( boolean val );
+
+ /**
+ * <p>
+ * Converts a byte value into a string.
+ * @param val
+ * A byte value
+ * @return
+ * A string containing a lexical representation of xsd:byte
+ */
+ public String printByte( byte val );
+
+ /**
+ * <p>
+ * Converts a QName instance into a string.
+ * @param val
+ * A QName value
+ * @param nsc
+ * A namespace context for interpreting a prefix within a QName.
+ * @return
+ * A string containing a lexical representation of QName
+ * @throws IllegalArgumentException if <tt>val</tt> is null or
+ * if <tt>nsc</tt> is non-null or <tt>nsc.getPrefix(nsprefixFromVal)</tt> is null.
+ */
+ public String printQName( javax.xml.namespace.QName val,
+ javax.xml.namespace.NamespaceContext nsc );
+
+ /**
+ * <p>
+ * Converts a Calendar value into a string.
+ * @param val
+ * A Calendar value
+ * @return
+ * A string containing a lexical representation of xsd:dateTime
+ * @throws IllegalArgumentException if <tt>val</tt> is null.
+ */
+ public String printDateTime( java.util.Calendar val );
+
+ /**
+ * <p>
+ * Converts an array of bytes into a string.
+ * @param val
+ * an array of bytes
+ * @return
+ * A string containing a lexical representation of xsd:base64Binary
+ * @throws IllegalArgumentException if <tt>val</tt> is null.
+ */
+ public String printBase64Binary( byte[] val );
+
+ /**
+ * <p>
+ * Converts an array of bytes into a string.
+ * @param val
+ * an array of bytes
+ * @return
+ * A string containing a lexical representation of xsd:hexBinary
+ * @throws IllegalArgumentException if <tt>val</tt> is null.
+ */
+ public String printHexBinary( byte[] val );
+
+ /**
+ * <p>
+ * Converts a long value into a string.
+ * @param val
+ * A long value
+ * @return
+ * A string containing a lexical representation of xsd:unsignedInt
+ */
+ public String printUnsignedInt( long val );
+
+ /**
+ * <p>
+ * Converts an int value into a string.
+ * @param val
+ * An int value
+ * @return
+ * A string containing a lexical representation of xsd:unsignedShort
+ */
+ public String printUnsignedShort( int val );
+
+ /**
+ * <p>
+ * Converts a Calendar value into a string.
+ * @param val
+ * A Calendar value
+ * @return
+ * A string containing a lexical representation of xsd:time
+ * @throws IllegalArgumentException if <tt>val</tt> is null.
+ */
+ public String printTime( java.util.Calendar val );
+
+ /**
+ * <p>
+ * Converts a Calendar value into a string.
+ * @param val
+ * A Calendar value
+ * @return
+ * A string containing a lexical representation of xsd:date
+ * @throws IllegalArgumentException if <tt>val</tt> is null.
+ */
+ public String printDate( java.util.Calendar val );
+
+ /**
+ * <p>
+ * Converts a string value into a string.
+ * @param val
+ * A string value
+ * @return
+ * A string containing a lexical representation of xsd:AnySimpleType
+ */
+ public String printAnySimpleType( String val );
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/DatatypeConverterInterface.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Element.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Element.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Element.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+/**
+ * This is an element marker interface.
+ *
+ * Under certain circumstances, it is necessary for the binding compiler to
+ * generate derived java content classes that implement this interface. In
+ * those cases, client applications must supply element instances rather than
+ * types of elements. For more detail, see section 5.7 "Element Declaration"
+ * and 5.7.1 "Bind to Java Element Interface" of the specification.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$
+ * @since JAXB1.0
+ */
+
+public interface Element {
+}
\ No newline at end of file
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Element.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/JAXBContext.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/JAXBContext.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/JAXBContext.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,687 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+import org.w3c.dom.Node;
+
+import java.util.Collections;
+import java.util.Map;
+import java.io.IOException;
+
+/**
+ * <p>
+ * The <tt>JAXBContext</tt> class provides the client's entry point to the
+ * JAXB API. It provides an abstraction for managing the XML/Java binding
+ * information necessary to implement the JAXB binding framework operations:
+ * unmarshal, marshal and validate.
+ *
+ * <p>A client application normally obtains new instances of this class using
+ * one of these two styles for newInstance methods, although there are other
+ * specialized forms of the method available:
+ *
+ * <ul>
+ * <li>{@link #newInstance(String,ClassLoader) JAXBContext.newInstance( "com.acme.foo:com.acme.bar" )} <br/>
+ * The JAXBContext instance is initialized from a list of colon
+ * separated Java package names. Each java package contains
+ * JAXB mapped classes, schema-derived classes and/or user annotated
+ * classes. Additionally, the java package may contain JAXB package annotations
+ * that must be processed. (see JLS 3rd Edition, Section 7.4.1. Package Annotations).
+ * </li>
+ * <li>{@link #newInstance(Class...) JAXBContext.newInstance( com.acme.foo.Foo.class )} <br/>
+ * The JAXBContext instance is intialized with class(es)
+ * passed as parameter(s) and classes that are statically reachable from
+ * these class(es). See {@link #newInstance(Class...)} for details.
+ * </li>
+ * </ul>
+ *
+ * <p>
+ * <blockquote>
+ * <i><B>SPEC REQUIREMENT:</B> the provider must supply an implementation
+ * class containing the following method signatures:</i>
+ *
+ * <pre>
+ * public static JAXBContext createContext( String contextPath, ClassLoader classLoader, Map<String,Object> properties ) throws JAXBException
+ * public static JAXBContext createContext( Class[] classes, Map<String,Object> properties ) throws JAXBException
+ * </pre>
+ *
+ * <p><i>
+ * The following JAXB 1.0 requirement is only required for schema to
+ * java interface/implementation binding. It does not apply to JAXB annotated
+ * classes. JAXB Providers must generate a <tt>jaxb.properties</tt> file in
+ * each package containing schema derived classes. The property file must
+ * contain a property named <tt>javax.xml.bind.context.factory</tt> whose
+ * value is the name of the class that implements the <tt>createContext</tt>
+ * APIs.</i>
+ *
+ * <p><i>
+ * The class supplied by the provider does not have to be assignable to
+ * <tt>javax.xml.bind.JAXBContext</tt>, it simply has to provide a class that
+ * implements the <tt>createContext</tt> APIs.</i>
+ *
+ * <p><i>
+ * In addition, the provider must call the
+ * {@link DatatypeConverter#setDatatypeConverter(DatatypeConverterInterface)
+ * DatatypeConverter.setDatatypeConverter} api prior to any client
+ * invocations of the marshal and unmarshal methods. This is necessary to
+ * configure the datatype converter that will be used during these operations.</i>
+ * </blockquote>
+ *
+ * <p>
+ * <a name="Unmarshalling"></a>
+ * <b>Unmarshalling</b>
+ * <p>
+ * <blockquote>
+ * The {@link Unmarshaller} class provides the client application the ability
+ * to convert XML data into a tree of Java content objects.
+ * The unmarshal method allows for
+ * any global XML element declared in the schema to be unmarshalled as
+ * the root of an instance document.
+ * Additionally, the unmarshal method allows for an unrecognized root element that
+ * has an xsi:type attribute's value that references a type definition declared in
+ * the schema to be unmarshalled as the root of an instance document.
+ * The <tt>JAXBContext</tt> object
+ * allows the merging of global elements and type definitions across a set of schemas (listed
+ * in the <tt>contextPath</tt>). Since each schema in the schema set can belong
+ * to distinct namespaces, the unification of schemas to an unmarshalling
+ * context should be namespace independent. This means that a client
+ * application is able to unmarshal XML documents that are instances of
+ * any of the schemas listed in the <tt>contextPath</tt>. For example:
+ *
+ * <pre>
+ * JAXBContext jc = JAXBContext.newInstance( "com.acme.foo:com.acme.bar" );
+ * Unmarshaller u = jc.createUnmarshaller();
+ * FooObject fooObj = (FooObject)u.unmarshal( new File( "foo.xml" ) ); // ok
+ * BarObject barObj = (BarObject)u.unmarshal( new File( "bar.xml" ) ); // ok
+ * BazObject bazObj = (BazObject)u.unmarshal( new File( "baz.xml" ) ); // error, "com.acme.baz" not in contextPath
+ * </pre>
+ *
+ * <p>
+ * The client application may also generate Java content trees explicitly rather
+ * than unmarshalling existing XML data. For all JAXB-annotated value classes,
+ * an application can create content using constructors.
+ * For schema-derived interface/implementation classes and for the
+ * creation of elements that are not bound to a JAXB-annotated
+ * class, an application needs to have access and knowledge about each of
+ * the schema derived <tt> ObjectFactory</tt> classes that exist in each of
+ * java packages contained in the <tt>contextPath</tt>. For each schema
+ * derived java class, there is a static factory method that produces objects
+ * of that type. For example,
+ * assume that after compiling a schema, you have a package <tt>com.acme.foo</tt>
+ * that contains a schema derived interface named <tt>PurchaseOrder</tt>. In
+ * order to create objects of that type, the client application would use the
+ * factory method like this:
+ *
+ * <pre>
+ * com.acme.foo.PurchaseOrder po =
+ * com.acme.foo.ObjectFactory.createPurchaseOrder();
+ * </pre>
+ *
+ * <p>
+ * Once the client application has an instance of the the schema derived object,
+ * it can use the mutator methods to set content on it.
+ *
+ * <p>
+ * For more information on the generated <tt>ObjectFactory</tt> classes, see
+ * Section 4.2 <i>Java Package</i> of the specification.
+ *
+ * <p>
+ * <i><B>SPEC REQUIREMENT:</B> the provider must generate a class in each
+ * package that contains all of the necessary object factory methods for that
+ * package named ObjectFactory as well as the static
+ * <tt>newInstance( javaContentInterface )</tt> method</i>
+ * </blockquote>
+ *
+ * <p>
+ * <b>Marshalling</b>
+ * <p>
+ * <blockquote>
+ * The {@link Marshaller} class provides the client application the ability
+ * to convert a Java content tree back into XML data. There is no difference
+ * between marshalling a content tree that is created manually using the factory
+ * methods and marshalling a content tree that is the result an <tt>unmarshal
+ * </tt> operation. Clients can marshal a java content tree back to XML data
+ * to a <tt>java.io.OutputStream</tt> or a <tt>java.io.Writer</tt>. The
+ * marshalling process can alternatively produce SAX2 event streams to a
+ * registered <tt>ContentHandler</tt> or produce a DOM Node object.
+ * Client applications have control over the output encoding as well as
+ * whether or not to marshal the XML data as a complete document or
+ * as a fragment.
+ *
+ * <p>
+ * Here is a simple example that unmarshals an XML document and then marshals
+ * it back out:
+ *
+ * <pre>
+ * JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ *
+ * // unmarshal from foo.xml
+ * Unmarshaller u = jc.createUnmarshaller();
+ * FooObject fooObj = (FooObject)u.unmarshal( new File( "foo.xml" ) );
+ *
+ * // marshal to System.out
+ * Marshaller m = jc.createMarshaller();
+ * m.marshal( fooObj, System.out );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * <b>Validation</b>
+ * <p>
+ * <blockquote>
+ * Validation has been changed significantly since JAXB 1.0. The {@link Validator}
+ * class has been deprecated and made optional. This means that you are advised
+ * not to use this class and, in fact, it may not even be available depending on
+ * your JAXB provider. JAXB 1.0 client applications that rely on <tt>Validator</tt>
+ * will still work properly when deployed with the JAXB 1.0 runtime system.
+ *
+ * In JAXB 2.0, the {@link Unmarshaller} has included convenince methods that expose
+ * the JAXP 1.3 {@link javax.xml.validation} framework. Please refer to the
+ * {@link Unmarshaller#setSchema(javax.xml.validation.Schema)} API for more
+ * information.
+ * </blockquote>
+ *
+ * <p>
+ * <b>JAXB Runtime Binding Framework Compatibility</b><br>
+ * <blockquote>
+ * The following JAXB 1.0 restriction only applies to binding schema to
+ * interfaces/implementation classes.
+ * Since this binding does not require a common runtime system, a JAXB
+ * client application must not attempt to mix runtime objects (<tt>JAXBContext,
+ * Marshaller</tt>, etc. ) from different providers. This does not
+ * mean that the client application isn't portable, it simply means that a
+ * client has to use a runtime system provided by the same provider that was
+ * used to compile the schema.
+ * </blockquote>
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$ $Date: 2006/03/08 17:05:01 $
+ * @see Marshaller
+ * @see Unmarshaller
+ * @see <a href="http://java.sun.com/docs/books/jls">S 7.4.1.1 "Package Annotations" in Java Language Specification, 3rd Edition</a>
+ * @since JAXB1.0
+ */
+public abstract class JAXBContext {
+
+ /**
+ * The name of the property that contains the name of the class capable
+ * of creating new <tt>JAXBContext</tt> objects.
+ */
+ public static final String JAXB_CONTEXT_FACTORY =
+ "javax.xml.bind.context.factory";
+
+
+ protected JAXBContext() {
+ }
+
+
+ /**
+ * <p>
+ * Obtain a new instance of a <tt>JAXBContext</tt> class.
+ *
+ * <p>
+ * This is a convenience method for the
+ * {@link #newInstance(String,ClassLoader) newInstance} method. It uses
+ * the context class loader of the current thread. To specify the use of
+ * a different class loader, either set it via the
+ * <tt>Thread.setContextClassLoader()</tt> api or use the
+ * {@link #newInstance(String,ClassLoader) newInstance} method.
+ * @throws JAXBException if an error was encountered while creating the
+ * <tt>JAXBContext</tt> such as
+ * <ol>
+ * <li>failure to locate either ObjectFactory.class or jaxb.index in the packages</li>
+ * <li>an ambiguity among global elements contained in the contextPath</li>
+ * <li>failure to locate a value for the context factory provider property</li>
+ * <li>mixing schema derived packages from different providers on the same contextPath</li>
+ * </ol>
+ */
+ public static JAXBContext newInstance( String contextPath )
+ throws JAXBException {
+
+ //return newInstance( contextPath, JAXBContext.class.getClassLoader() );
+ return newInstance( contextPath, Thread.currentThread().getContextClassLoader() );
+ }
+
+ /**
+ * <p>
+ * Obtain a new instance of a <tt>JAXBContext</tt> class.
+ *
+ * <p>
+ * The client application must supply a context path which is a list of
+ * colon (':', \u005Cu003A) separated java package names that contain
+ * schema-derived classes and/or fully qualified JAXB-annotated classes.
+ * Schema-derived
+ * code is registered with the JAXBContext by the
+ * ObjectFactory.class generated per package.
+ * Alternatively than being listed in the context path, programmer
+ * annotated JAXB mapped classes can be listed in a
+ * <tt>jaxb.index</tt> resource file, format described below.
+ * Note that a java package can contain both schema-derived classes and
+ * user annotated JAXB classes. Additionally, the java package may
+ * contain JAXB package annotations that must be processed. (see JLS 3rd Edition,
+ * Section 7.4.1. "Package Annotations").
+ * </p>
+ *
+ * <p>
+ * Every package listed on the contextPath must meet <b>one or both</b> of the
+ * following conditions otherwise a <tt>JAXBException</tt> will be thrown:
+ * </p>
+ * <ol>
+ * <li>it must contain ObjectFactory.class</li>
+ * <li>it must contain jaxb.index</li>
+ * </ol>
+ *
+ * <p>
+ * <b>Format for jaxb.index</b>
+ * <p>
+ * The file contains a newline-separated list of class names.
+ * Space and tab characters, as well as blank
+ * lines, are ignored. The comment character
+ * is '#' (0x23); on each line all characters following the first comment
+ * character are ignored. The file must be encoded in UTF-8. Classes that
+ * are reachable, as defined in {@link #newInstance(Class...)}, from the
+ * listed classes are also registered with JAXBContext.
+ * <p>
+ * Constraints on class name occuring in a <tt>jaxb.index</tt> file are:
+ * <ul>
+ * <li>Must not end with ".class".</li>
+ * <li>Class names are resolved relative to package containing
+ * <tt>jaxb.index</tt> file. Only classes occuring directly in package
+ * containing <tt>jaxb.index</tt> file are allowed.</li>
+ * <li>Fully qualified class names are not allowed.
+ * A qualified class name,relative to current package,
+ * is only allowed to specify a nested or inner class.</li>
+ * </ul>
+ *
+ * <p>
+ * To maintain compatibility with JAXB 1.0 schema to java
+ * interface/implementation binding, enabled by schema customization
+ * <tt><jaxb:globalBindings valueClass="false"></tt>,
+ * the JAXB provider will ensure that each package on the context path
+ * has a <tt>jaxb.properties</tt> file which contains a value for the
+ * <tt>javax.xml.bind.context.factory</tt> property and that all values
+ * resolve to the same provider. This requirement does not apply to
+ * JAXB annotated classes.
+ *
+ * <p>
+ * If there are any global XML element name collisions across the various
+ * packages listed on the <tt>contextPath</tt>, a <tt>JAXBException</tt>
+ * will be thrown.
+ *
+ * <p>
+ * Mixing generated interface/impl bindings from multiple JAXB Providers
+ * in the same context path may result in a <tt>JAXBException</tt>
+ * being thrown.
+ *
+ * @param contextPath list of java package names that contain schema
+ * derived class and/or java to schema (JAXB-annotated)
+ * mapped classes
+ * @param classLoader
+ * This class loader will be used to locate the implementation
+ * classes.
+ *
+ * @return a new instance of a <tt>JAXBContext</tt>
+ * @throws JAXBException if an error was encountered while creating the
+ * <tt>JAXBContext</tt> such as
+ * <ol>
+ * <li>failure to locate either ObjectFactory.class or jaxb.index in the packages</li>
+ * <li>an ambiguity among global elements contained in the contextPath</li>
+ * <li>failure to locate a value for the context factory provider property</li>
+ * <li>mixing schema derived packages from different providers on the same contextPath</li>
+ * </ol>
+ */
+ public static JAXBContext newInstance( String contextPath, ClassLoader classLoader ) throws JAXBException {
+
+ return newInstance(contextPath,classLoader,Collections.<String,Object>emptyMap());
+ }
+
+ /**
+ * <p>
+ * Obtain a new instance of a <tt>JAXBContext</tt> class.
+ *
+ * <p>
+ * This is mostly the same as {@link JAXBContext#newInstance(String, ClassLoader)},
+ * but this version allows you to pass in provider-specific properties to configure
+ * the instanciation of {@link JAXBContext}.
+ *
+ * <p>
+ * The interpretation of properties is up to implementations.
+ *
+ * @param contextPath list of java package names that contain schema derived classes
+ * @param classLoader
+ * This class loader will be used to locate the implementation classes.
+ * @param properties
+ * provider-specific properties
+ *
+ * @return a new instance of a <tt>JAXBContext</tt>
+ * @throws JAXBException if an error was encountered while creating the
+ * <tt>JAXBContext</tt> such as
+ * <ol>
+ * <li>failure to locate either ObjectFactory.class or jaxb.index in the packages</li>
+ * <li>an ambiguity among global elements contained in the contextPath</li>
+ * <li>failure to locate a value for the context factory provider property</li>
+ * <li>mixing schema derived packages from different providers on the same contextPath</li>
+ * </ol>
+ * @since JAXB2.0
+ */
+ public static JAXBContext newInstance( String contextPath, ClassLoader classLoader, Map<String,?> properties )
+ throws JAXBException {
+
+ return ContextFinder.find(
+ /* The default property name according to the JAXB spec */
+ JAXB_CONTEXT_FACTORY,
+
+ /* the context path supplied by the client app */
+ contextPath,
+
+ /* class loader to be used */
+ classLoader,
+ properties );
+ }
+
+// TODO: resurrect this once we introduce external annotations
+// /**
+// * <p>
+// * Obtain a new instance of a <tt>JAXBContext</tt> class.
+// *
+// * <p>
+// * The client application must supply a list of classes that the new
+// * context object needs to recognize.
+// *
+// * Not only the new context will recognize all the classes specified,
+// * but it will also recognize any classes that are directly/indirectly
+// * referenced statically from the specified classes.
+// *
+// * For example, in the following Java code, if you do
+// * <tt>newInstance(Foo.class)</tt>, the newly created {@link JAXBContext}
+// * will recognize both <tt>Foo</tt> and <tt>Bar</tt>, but not <tt>Zot</tt>:
+// * <pre><xmp>
+// * class Foo {
+// * Bar b;
+// * }
+// * class Bar { int x; }
+// * class Zot extends Bar { int y; }
+// * </xmp></pre>
+// *
+// * Therefore, a typical client application only needs to specify the
+// * top-level classes, but it needs to be careful.
+// *
+// * TODO: if we are to define other mechanisms, refer to them.
+// *
+// * @param externalBindings
+// * list of external binding files. Can be null or empty if none is used.
+// * when specified, those files determine how the classes are bound.
+// *
+// * @param classesToBeBound
+// * list of java classes to be recognized by the new {@link JAXBContext}.
+// * Can be empty, in which case a {@link JAXBContext} that only knows about
+// * spec-defined classes will be returned.
+// *
+// * @return
+// * A new instance of a <tt>JAXBContext</tt>. Always non-null valid object.
+// *
+// * @throws JAXBException
+// * if an error was encountered while creating the
+// * <tt>JAXBContext</tt>, such as (but not limited to):
+// * <ol>
+// * <li>No JAXB implementation was discovered
+// * <li>Classes use JAXB annotations incorrectly
+// * <li>Classes have colliding annotations (i.e., two classes with the same type name)
+// * <li>Specified external bindings are incorrect
+// * <li>The JAXB implementation was unable to locate
+// * provider-specific out-of-band information (such as additional
+// * files generated at the development time.)
+// * </ol>
+// *
+// * @throws IllegalArgumentException
+// * if the parameter contains {@code null} (i.e., {@code newInstance(null);})
+// *
+// * @since JAXB2.0
+// */
+// public static JAXBContext newInstance( Source[] externalBindings, Class... classesToBeBound )
+// throws JAXBException {
+//
+// // empty class list is not an error, because the context will still include
+// // spec-specified classes like String and Integer.
+// // if(classesToBeBound.length==0)
+// // throw new IllegalArgumentException();
+//
+// // but it is an error to have nulls in it.
+// for( int i=classesToBeBound.length-1; i>=0; i-- )
+// if(classesToBeBound[i]==null)
+// throw new IllegalArgumentException();
+//
+// return ContextFinder.find(externalBindings,classesToBeBound);
+// }
+
+ /**
+ * <p>
+ * Obtain a new instance of a <tt>JAXBContext</tt> class.
+ *
+ * <p>
+ * The client application must supply a list of classes that the new
+ * context object needs to recognize.
+ *
+ * Not only the new context will recognize all the classes specified,
+ * but it will also recognize any classes that are directly/indirectly
+ * referenced statically from the specified classes. Subclasses of
+ * referenced classes nor <tt>@XmlTransient</tt> referenced classes
+ * are not registered with JAXBContext.
+ *
+ * For example, in the following Java code, if you do
+ * <tt>newInstance(Foo.class)</tt>, the newly created {@link JAXBContext}
+ * will recognize both <tt>Foo</tt> and <tt>Bar</tt>, but not <tt>Zot</tt> or <tt>FooBar</tt>:
+ * <pre>
+ * class Foo {
+ * @XmlTransient FooBar c;
+ * Bar b;
+ * }
+ * class Bar { int x; }
+ * class Zot extends Bar { int y; }
+ * class FooBar { }
+ * </pre>
+ *
+ * Therefore, a typical client application only needs to specify the
+ * top-level classes, but it needs to be careful.
+ *
+ * <p>
+ * Note that for each java package registered with JAXBContext,
+ * when the optional package annotations exist, they must be processed.
+ * (see JLS 3rd Edition, Section 7.4.1. "Package Annotations").
+ *
+ * @param classesToBeBound
+ * list of java classes to be recognized by the new {@link JAXBContext}.
+ * Can be empty, in which case a {@link JAXBContext} that only knows about
+ * spec-defined classes will be returned.
+ *
+ * @return
+ * A new instance of a <tt>JAXBContext</tt>. Always non-null valid object.
+ *
+ * @throws JAXBException
+ * if an error was encountered while creating the
+ * <tt>JAXBContext</tt>, such as (but not limited to):
+ * <ol>
+ * <li>No JAXB implementation was discovered
+ * <li>Classes use JAXB annotations incorrectly
+ * <li>Classes have colliding annotations (i.e., two classes with the same type name)
+ * <li>The JAXB implementation was unable to locate
+ * provider-specific out-of-band information (such as additional
+ * files generated at the development time.)
+ * </ol>
+ *
+ * @throws IllegalArgumentException
+ * if the parameter contains {@code null} (i.e., {@code newInstance(null);})
+ *
+ * @since JAXB2.0
+ */
+ public static JAXBContext newInstance( Class... classesToBeBound )
+ throws JAXBException {
+
+ return newInstance(classesToBeBound,Collections.<String,Object>emptyMap());
+ }
+
+ /**
+ * <p>
+ * Obtain a new instance of a <tt>JAXBContext</tt> class.
+ *
+ * <p>
+ * An overloading of {@link JAXBContext#newInstance(Class...)}
+ * to configure 'properties' for this instantiation of {@link JAXBContext}.
+ *
+ * <p>
+ * The interpretation of properties is implementation specific.
+ *
+ * @param classesToBeBound
+ * list of java classes to be recognized by the new {@link JAXBContext}.
+ * Can be empty, in which case a {@link JAXBContext} that only knows about
+ * spec-defined classes will be returned.
+ *
+ * @return
+ * A new instance of a <tt>JAXBContext</tt>. Always non-null valid object.
+ *
+ * @throws JAXBException
+ * if an error was encountered while creating the
+ * <tt>JAXBContext</tt>, such as (but not limited to):
+ * <ol>
+ * <li>No JAXB implementation was discovered
+ * <li>Classes use JAXB annotations incorrectly
+ * <li>Classes have colliding annotations (i.e., two classes with the same type name)
+ * <li>The JAXB implementation was unable to locate
+ * provider-specific out-of-band information (such as additional
+ * files generated at the development time.)
+ * </ol>
+ *
+ * @throws IllegalArgumentException
+ * if the parameter contains {@code null} (i.e., {@code newInstance(null);})
+ *
+ * @since JAXB2.0
+ */
+ public static JAXBContext newInstance( Class[] classesToBeBound, Map<String,?> properties )
+ throws JAXBException {
+
+ // empty class list is not an error, because the context will still include
+ // spec-specified classes like String and Integer.
+ // if(classesToBeBound.length==0)
+ // throw new IllegalArgumentException();
+
+ // but it is an error to have nulls in it.
+ for( int i=classesToBeBound.length-1; i>=0; i-- )
+ if(classesToBeBound[i]==null)
+ throw new IllegalArgumentException();
+
+ return ContextFinder.find(classesToBeBound,properties);
+ }
+
+ /**
+ * Create an <tt>Unmarshaller</tt> object that can be used to convert XML
+ * data into a java content tree.
+ *
+ * @return an <tt>Unmarshaller</tt> object
+ *
+ * @throws JAXBException if an error was encountered while creating the
+ * <tt>Unmarshaller</tt> object
+ */
+ public abstract Unmarshaller createUnmarshaller() throws JAXBException;
+
+
+ /**
+ * Create a <tt>Marshaller</tt> object that can be used to convert a
+ * java content tree into XML data.
+ *
+ * @return a <tt>Marshaller</tt> object
+ *
+ * @throws JAXBException if an error was encountered while creating the
+ * <tt>Marshaller</tt> object
+ */
+ public abstract Marshaller createMarshaller() throws JAXBException;
+
+
+ /**
+ * {@link Validator} has been made optional and deprecated in JAXB 2.0. Please
+ * refer to the javadoc for {@link Validator} for more detail.
+ * <p>
+ * Create a <tt>Validator</tt> object that can be used to validate a
+ * java content tree against its source schema.
+ *
+ * @return a <tt>Validator</tt> object
+ *
+ * @throws JAXBException if an error was encountered while creating the
+ * <tt>Validator</tt> object
+ * @deprecated since JAXB2.0
+ */
+ public abstract Validator createValidator() throws JAXBException;
+
+ /**
+ * Creates a <tt>Binder</tt> object that can be used for
+ * associative/in-place unmarshalling/marshalling.
+ *
+ * @param domType select the DOM API to use by passing in its DOM Node class.
+ *
+ * @return always a new valid <tt>Binder</tt> object.
+ *
+ * @throws UnsupportedOperationException
+ * if DOM API corresponding to <tt>domType</tt> is not supported by
+ * the implementation.
+ *
+ * @since JAXB2.0
+ */
+ public <T> Binder<T> createBinder(Class<T> domType) {
+ // to make JAXB 1.0 implementations work, this method must not be
+ // abstract
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Creates a <tt>Binder</tt> for W3C DOM.
+ *
+ * @return always a new valid <tt>Binder</tt> object.
+ *
+ * @since JAXB2.0
+ */
+ public Binder<Node> createBinder() {
+ return createBinder(Node.class);
+ }
+
+ /**
+ * Creates a <tt>JAXBIntrospector</tt> object that can be used to
+ * introspect JAXB objects.
+ *
+ * @return
+ * always return a non-null valid <tt>JAXBIntrospector</tt> object.
+ *
+ * @throws UnsupportedOperationException
+ * Calling this method on JAXB 1.0 implementations will throw
+ * an UnsupportedOperationException.
+ *
+ * @since JAXB2.0
+ */
+ public JAXBIntrospector createJAXBIntrospector() {
+ // to make JAXB 1.0 implementations work, this method must not be
+ // abstract
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Generates the schema documents for this context.
+ *
+ * @param outputResolver
+ * this object controls the output to which schemas
+ * will be sent.
+ *
+ * @throws IOException
+ * if {@link SchemaOutputResolver} throws an {@link IOException}.
+ *
+ * @throws UnsupportedOperationException
+ * Calling this method on JAXB 1.0 implementations will throw
+ * an UnsupportedOperationException.
+ *
+ * @since JAXB 2.0
+ */
+ public void generateSchema(SchemaOutputResolver outputResolver) throws IOException {
+ // to make JAXB 1.0 implementations work, this method must not be
+ // abstract
+ throw new UnsupportedOperationException();
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/JAXBContext.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/JAXBElement.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/JAXBElement.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/JAXBElement.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,198 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+import javax.xml.namespace.QName;
+import java.io.Serializable;
+
+/**
+ * <p>JAXB representation of an Xml Element.</p>
+ *
+ * <p>This class represents information about an Xml Element from both the element
+ * declaration within a schema and the element instance value within an xml document
+ * with the following properties
+ * <ul>
+ * <li>element's xml tag <b><tt>name</tt></b></li>
+ * <li><b><tt>value</tt></b> represents the element instance's atttribute(s) and content model</li>
+ * <li>element declaration's <b><tt>declaredType</tt></b> (<tt>xs:element @type</tt> attribute)</li>
+ * <li><b><tt>scope</tt></b> of element declaration</li>
+ * <li>boolean <b><tt>nil</tt></b> property. (element instance's <tt><b>xsi:nil</b></tt> attribute)</li>
+ * </ul>
+ *
+ * <p>The <tt>declaredType</tt> and <tt>scope</tt> property are the
+ * JAXB class binding for the xml type definition.
+ * </p>
+ *
+ * <p><b><tt>Scope</tt></b> is either {@link GlobalScope} or the Java class representing the
+ * complex type definition containing the schema element declaration.
+ * </p>
+ *
+ * <p>There is a property constraint that if <b><tt>value</tt></b> is <tt>null</tt>,
+ * then <tt>nil</tt> must be <tt>true</tt>. The converse is not true to enable
+ * representing a nil element with attribute(s). If <tt>nil</tt> is true, it is possible
+ * that <tt>value</tt> is non-null so it can hold the value of the attributes
+ * associated with a nil element.
+ * </p>
+ *
+ * @author Kohsuke Kawaguchi, Joe Fialli
+ * @since JAXB 2.0
+ */
+
+public class JAXBElement<T> implements Serializable {
+
+ /** xml element tag name */
+ final protected QName name;
+
+ /** Java datatype binding for xml element declaration's type. */
+ final protected Class<T> declaredType;
+
+ /** Scope of xml element declaration representing this xml element instance.
+ * Can be one of the following values:
+ * - {@link GlobalScope} for global xml element declaration.
+ * - local element declaration has a scope set to the Java class
+ * representation of complex type defintion containing
+ * xml element declaration.
+ */
+ final protected Class scope;
+
+ /** xml element value.
+ Represents content model and attributes of an xml element instance. */
+ protected T value;
+
+ /** true iff the xml element instance has xsi:nil="true". */
+ protected boolean nil = false;
+
+ /**
+ * Designates global scope for an xml element.
+ */
+ public static final class GlobalScope {}
+
+ /**
+ * <p>Construct an xml element instance.</p>
+ *
+ * @param name Java binding of xml element tag name
+ * @param declaredType Java binding of xml element declaration's type
+ * @param scope
+ * Java binding of scope of xml element declaration.
+ * Passing null is the same as passing <tt>GlobalScope.class</tt>
+ * @param value
+ * Java instance representing xml element's value.
+ * @see #getScope()
+ * @see #isTypeSubstituted()
+ */
+ public JAXBElement(QName name,
+ Class<T> declaredType,
+ Class scope,
+ T value) {
+ if(declaredType==null || name==null)
+ throw new IllegalArgumentException();
+ this.declaredType = declaredType;
+ if(scope==null) scope = GlobalScope.class;
+ this.scope = scope;
+ this.name = name;
+ setValue(value);
+ }
+
+ /**
+ * Construct an xml element instance.
+ *
+ * This is just a convenience method for <tt>new JAXBElement(name,declaredType,GlobalScope.class,value)</tt>
+ */
+ public JAXBElement(QName name, Class<T> declaredType, T value ) {
+ this(name,declaredType,GlobalScope.class,value);
+ }
+
+ /**
+ * Returns the Java binding of the xml element declaration's type attribute.
+ */
+ public Class<T> getDeclaredType() {
+ return declaredType;
+ }
+
+ /**
+ * Returns the xml element tag name.
+ */
+ public QName getName() {
+ return name;
+ }
+
+ /**
+ * <p>Set the content model and attributes of this xml element.</p>
+ *
+ * <p>When this property is set to <tt>null</tt>, <tt>isNil()</tt> must by <tt>true</tt>.
+ * Details of constraint are described at {@link #isNil()}.</pp>
+ *
+ * @see #isTypeSubstituted()
+ */
+ public void setValue(T t) {
+ this.value = t;
+ }
+
+ /**
+ * <p>Return the content model and attribute values for this element.</p>
+ *
+ * <p>See {@link #isNil()} for a description of a property constraint when
+ * this value is <tt>null</tt></p>
+ */
+ public T getValue() {
+ return value;
+ }
+
+ /**
+ * Returns scope of xml element declaration.
+ *
+ * @see #isGlobalScope()
+ * @return <tt>GlobalScope.class</tt> if this element is of global scope.
+ */
+ public Class getScope() {
+ return scope;
+ }
+
+ /**
+ * <p>Returns <tt>true</tt> iff this element instance content model
+ * is nil.</p>
+ *
+ * <p>This property always returns <tt>true</tt> when {@link #getValue()} is null.
+ * Note that the converse is not true, when this property is <tt>true</tt>,
+ * {@link #getValue()} can contain a non-null value for attribute(s). It is
+ * valid for a nil xml element to have attribute(s).</p>
+ */
+ public boolean isNil() {
+ return (value == null) || nil;
+ }
+
+ /**
+ * <p>Set whether this element has nil content.</p>
+ *
+ * @see #isNil()
+ */
+ public void setNil(boolean value) {
+ this.nil = value;
+ }
+
+ /* Convenience methods
+ * (Not necessary but they do unambiguously conceptualize
+ * the rationale behind this class' fields.)
+ */
+
+ /**
+ * Returns true iff this xml element declaration is global.
+ */
+ public boolean isGlobalScope() {
+ return this.scope == GlobalScope.class;
+ }
+
+ /**
+ * Returns true iff this xml element instance's value has a different
+ * type than xml element declaration's declared type.
+ */
+ public boolean isTypeSubstituted() {
+ if(value==null) return false;
+ return value.getClass() != declaredType;
+ }
+
+ private static final long serialVersionUID = 1L;
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/JAXBElement.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/JAXBException.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/JAXBException.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/JAXBException.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,165 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+import java.io.PrintWriter;
+
+/**
+ * This is the root exception class for all JAXB exceptions.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$ $Date: 2004/12/14 21:50:39 $
+ * @see JAXBContext
+ * @see Marshaller
+ * @see Unmarshaller
+ * @since JAXB1.0
+ */
+public class JAXBException extends Exception {
+
+ /**
+ * Vendor specific error code
+ *
+ */
+ private String errorCode;
+
+ /**
+ * Exception reference
+ *
+ */
+ private Throwable linkedException;
+
+ static final long serialVersionUID = -5621384651494307979L;
+
+ /**
+ * Construct a JAXBException with the specified detail message. The
+ * errorCode and linkedException will default to null.
+ *
+ * @param message a description of the exception
+ */
+ public JAXBException(String message) {
+ this( message, null, null );
+ }
+
+ /**
+ * Construct a JAXBException with the specified detail message and vendor
+ * specific errorCode. The linkedException will default to null.
+ *
+ * @param message a description of the exception
+ * @param errorCode a string specifying the vendor specific error code
+ */
+ public JAXBException(String message, String errorCode) {
+ this( message, errorCode, null );
+ }
+
+ /**
+ * Construct a JAXBException with a linkedException. The detail message and
+ * vendor specific errorCode will default to null.
+ *
+ * @param exception the linked exception
+ */
+ public JAXBException(Throwable exception) {
+ this( null, null, exception );
+ }
+
+ /**
+ * Construct a JAXBException with the specified detail message and
+ * linkedException. The errorCode will default to null.
+ *
+ * @param message a description of the exception
+ * @param exception the linked exception
+ */
+ public JAXBException(String message, Throwable exception) {
+ this( message, null, exception );
+ }
+
+ /**
+ * Construct a JAXBException with the specified detail message, vendor
+ * specific errorCode, and linkedException.
+ *
+ * @param message a description of the exception
+ * @param errorCode a string specifying the vendor specific error code
+ * @param exception the linked exception
+ */
+ public JAXBException(String message, String errorCode, Throwable exception) {
+ super( message );
+ this.errorCode = errorCode;
+ this.linkedException = exception;
+ }
+
+ /**
+ * Get the vendor specific error code
+ *
+ * @return a string specifying the vendor specific error code
+ */
+ public String getErrorCode() {
+ return this.errorCode;
+ }
+
+ /**
+ * Get the linked exception
+ *
+ * @return the linked Exception, null if none exists
+ */
+ public Throwable getLinkedException() {
+ return linkedException;
+ }
+
+ /**
+ * Add a linked Exception.
+ *
+ * @param exception the linked Exception (A null value is permitted and
+ * indicates that the linked exception does not exist or
+ * is unknown).
+ */
+ public synchronized void setLinkedException( Throwable exception ) {
+ this.linkedException = exception;
+ }
+
+ /**
+ * Returns a short description of this JAXBException.
+ *
+ */
+ public String toString() {
+ return linkedException == null ?
+ super.toString() :
+ super.toString() + "\n - with linked exception:\n[" +
+ linkedException.toString()+ "]";
+ }
+
+ /**
+ * Prints this JAXBException and its stack trace (including the stack trace
+ * of the linkedException if it is non-null) to the PrintStream.
+ *
+ * @param s PrintStream to use for output
+ */
+ public void printStackTrace( java.io.PrintStream s ) {
+ super.printStackTrace(s);
+ }
+
+ /**
+ * Prints this JAXBException and its stack trace (including the stack trace
+ * of the linkedException if it is non-null) to <tt>System.err</tt>.
+ *
+ */
+ public void printStackTrace() {
+ super.printStackTrace();
+ }
+
+ /**
+ * Prints this JAXBException and its stack trace (including the stack trace
+ * of the linkedException if it is non-null) to the PrintWriter.
+ *
+ * @param s PrintWriter to use for output
+ */
+ public void printStackTrace(PrintWriter s) {
+ super.printStackTrace(s);
+ }
+
+ @Override
+ public Throwable getCause() {
+ return linkedException;
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/JAXBException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/JAXBIntrospector.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/JAXBIntrospector.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/JAXBIntrospector.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+import javax.xml.namespace.QName;
+
+/**
+ * Provide access to JAXB xml binding data for a JAXB object.
+ *
+ * <p>
+ * Intially, the intent of this class is to just conceptualize how
+ * a JAXB application developer can access xml binding information,
+ * independent if binding model is java to schema or schema to java.
+ * Since accessing the XML element name related to a JAXB element is
+ * a highly requested feature, demonstrate access to this
+ * binding information.
+ *
+ * The factory method to get a <code>JAXBIntrospector</code> instance is
+ * {@link JAXBContext#createJAXBIntrospector()}.
+ *
+ * @see JAXBContext#createJAXBIntrospector()
+ * @since JAXB2.0
+ */
+public abstract class JAXBIntrospector {
+
+ /**
+ * <p>Return true iff <code>object</code> represents a JAXB element.</p>
+ * <p>Parameter <code>object</code> is a JAXB element for following cases:
+ * <ol>
+ * <li>It is an instance of <code>javax.xml.bind.JAXBElement</code>.</li>
+ * <li>The class of <code>object</code> is annotated with
+ * <code>@XmlRootElement</code>.
+ * </li>
+ * </ol>
+ *
+ * @see #getElementName(Object)
+ */
+ public abstract boolean isElement(Object object);
+
+ /**
+ * <p>Get xml element qname for <code>jaxbElement</code>.</p>
+ *
+ * @param jaxbElement is an object that {@link #isElement(Object)} returned true.
+ *
+ * @return xml element qname associated with jaxbElement;
+ * null if <code>jaxbElement</code> is not a JAXB Element.
+ */
+ public abstract QName getElementName(Object jaxbElement);
+
+ /**
+ * <p>Get the element value of a JAXB element.</p>
+ *
+ * <p>Convenience method to abstract whether working with either
+ * a javax.xml.bind.JAXBElement instance or an instance of
+ * <tt>@XmlRootElement</tt> annotated Java class.</p>
+ *
+ * @param jaxbElement object that #isElement(Object) returns true.
+ *
+ * @return The element value of the <code>jaxbElement</code>.
+ */
+ public static Object getValue(Object jaxbElement) {
+ if (jaxbElement instanceof JAXBElement) {
+ return ((JAXBElement)jaxbElement).getValue();
+ } else {
+ // assume that class of this instance is
+ // annotated with @XmlRootElement.
+ return jaxbElement;
+ }
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/JAXBIntrospector.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/MarshalException.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/MarshalException.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/MarshalException.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+/**
+ * This exception indicates that an error has occurred while performing
+ * a marshal operation that the provider is unable to recover from.
+ *
+ * <p>
+ * The <tt>ValidationEventHandler</tt> can cause this exception to be thrown
+ * during the marshal operations. See
+ * {@link ValidationEventHandler#handleEvent(ValidationEvent)
+ * ValidationEventHandler.handleEvent(ValidationEvent)}.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$
+ * @see JAXBException
+ * @see Marshaller
+ * @since JAXB1.0
+ */
+public class MarshalException extends JAXBException {
+
+ /**
+ * Construct a MarshalException with the specified detail message. The
+ * errorCode and linkedException will default to null.
+ *
+ * @param message a description of the exception
+ */
+ public MarshalException( String message ) {
+ this( message, null, null );
+ }
+
+ /**
+ * Construct a MarshalException with the specified detail message and vendor
+ * specific errorCode. The linkedException will default to null.
+ *
+ * @param message a description of the exception
+ * @param errorCode a string specifying the vendor specific error code
+ */
+ public MarshalException( String message, String errorCode ) {
+ this( message, errorCode, null );
+ }
+
+ /**
+ * Construct a MarshalException with a linkedException. The detail message and
+ * vendor specific errorCode will default to null.
+ *
+ * @param exception the linked exception
+ */
+ public MarshalException( Throwable exception ) {
+ this( null, null, exception );
+ }
+
+ /**
+ * Construct a MarshalException with the specified detail message and
+ * linkedException. The errorCode will default to null.
+ *
+ * @param message a description of the exception
+ * @param exception the linked exception
+ */
+ public MarshalException( String message, Throwable exception ) {
+ this( message, null, exception );
+ }
+
+ /**
+ * Construct a MarshalException with the specified detail message, vendor
+ * specific errorCode, and linkedException.
+ *
+ * @param message a description of the exception
+ * @param errorCode a string specifying the vendor specific error code
+ * @param exception the linked exception
+ */
+ public MarshalException( String message, String errorCode, Throwable exception ) {
+ super( message, errorCode, exception );
+ }
+
+}
+
+
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/MarshalException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Marshaller.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Marshaller.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Marshaller.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,784 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+import javax.xml.bind.attachment.AttachmentMarshaller;
+import javax.xml.validation.Schema;
+
+/**
+ * <p>
+ * The <tt>Marshaller</tt> class is responsible for governing the process
+ * of serializing Java content trees back into XML data. It provides the basic
+ * marshalling methods:
+ *
+ * <p>
+ * <i>Assume the following setup code for all following code fragments:</i>
+ * <blockquote>
+ * <pre>
+ * JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ * Unmarshaller u = jc.createUnmarshaller();
+ * Object element = u.unmarshal( new File( "foo.xml" ) );
+ * Marshaller m = jc.createMarshaller();
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a File:
+ * <blockquote>
+ * <pre>
+ * OutputStream os = new FileOutputStream( "nosferatu.xml" );
+ * m.marshal( element, os );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a SAX ContentHandler:
+ * <blockquote>
+ * <pre>
+ * // assume MyContentHandler instanceof ContentHandler
+ * m.marshal( element, new MyContentHandler() );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a DOM Node:
+ * <blockquote>
+ * <pre>
+ * DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ * dbf.setNamespaceAware(true);
+ * DocumentBuilder db = dbf.newDocumentBuilder();
+ * Document doc = db.newDocument();
+ *
+ * m.marshal( element, doc );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a java.io.OutputStream:
+ * <blockquote>
+ * <pre>
+ * m.marshal( element, System.out );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a java.io.Writer:
+ * <blockquote>
+ * <pre>
+ * m.marshal( element, new PrintWriter( System.out ) );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a javax.xml.transform.SAXResult:
+ * <blockquote>
+ * <pre>
+ * // assume MyContentHandler instanceof ContentHandler
+ * SAXResult result = new SAXResult( new MyContentHandler() );
+ *
+ * m.marshal( element, result );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a javax.xml.transform.DOMResult:
+ * <blockquote>
+ * <pre>
+ * DOMResult result = new DOMResult();
+ *
+ * m.marshal( element, result );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a javax.xml.transform.StreamResult:
+ * <blockquote>
+ * <pre>
+ * StreamResult result = new StreamResult( System.out );
+ *
+ * m.marshal( element, result );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a javax.xml.stream.XMLStreamWriter:
+ * <blockquote>
+ * <pre>
+ * XMLStreamWriter xmlStreamWriter =
+ * XMLOutputFactory.newInstance().createXMLStreamWriter( ... );
+ *
+ * m.marshal( element, xmlStreamWriter );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Marshalling to a javax.xml.stream.XMLEventWriter:
+ * <blockquote>
+ * <pre>
+ * XMLEventWriter xmlEventWriter =
+ * XMLOutputFactory.newInstance().createXMLEventWriter( ... );
+ *
+ * m.marshal( element, xmlEventWriter );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * <a name="elementMarshalling"></a>
+ * <b>Marshalling content tree rooted by a JAXB element</b><br>
+ * <blockquote>
+ * The first parameter of the overloaded
+ * <tt>Marshaller.marshal(java.lang.Object, ...)</tt> methods must be a
+ * JAXB element as computed by
+ * {@link JAXBIntrospector#isElement(java.lang.Object)};
+ * otherwise, a <tt>Marshaller.marshal</tt> method must throw a
+ * {@link MarshalException}. There exist two mechanisms
+ * to enable marshalling an instance that is not a JAXB element.
+ * One method is to wrap the instance as a value of a {@link JAXBElement},
+ * and pass the wrapper element as the first parameter to
+ * a <tt>Marshaller.marshal</tt> method. For java to schema binding, it
+ * is also possible to simply annotate the instance's class with
+ * @{@link XmlRootElement}.
+ * </blockquote>
+ *
+ * <p>
+ * <b>Encoding</b><br>
+ * <blockquote>
+ * By default, the Marshaller will use UTF-8 encoding when generating XML data
+ * to a <tt>java.io.OutputStream</tt>, or a <tt>java.io.Writer</tt>. Use the
+ * {@link #setProperty(String,Object) setProperty} API to change the output
+ * encoding used during these marshal operations. Client applications are
+ * expected to supply a valid character encoding name as defined in the
+ * <a href="http://www.w3.org/TR/2000/REC-xml-20001006#charencoding">W3C XML 1.0
+ * Recommendation</a> and supported by your
+ * <a href="http://java.sun.com/j2se/1.3/docs/api/java/lang/package-summary.html#charenc">
+ * Java Platform</a>.
+ * </blockquote>
+ *
+ * <p>
+ * <b>Validation and Well-Formedness</b><br>
+ * <blockquote>
+ * <p>
+ * Client applications are not required to validate the Java content tree prior
+ * to calling any of the marshal API's. Furthermore, there is no requirement
+ * that the Java content tree be valid with respect to its original schema in
+ * order to marshal it back into XML data. Different JAXB Providers will
+ * support marshalling invalid Java content trees at varying levels, however
+ * all JAXB Providers must be able to marshal a valid content tree back to
+ * XML data. A JAXB Provider must throw a <tt>MarshalException</tt> when it
+ * is unable to complete the marshal operation due to invalid content. Some
+ * JAXB Providers will fully allow marshalling invalid content, others will fail
+ * on the first validation error.
+ * <p>
+ * Even when schema validation is not explictly enabled for the marshal operation,
+ * it is possible that certain types of validation events will be detected
+ * during the operation. Validation events will be reported to the registered
+ * event handler. If the client application has not registered an event handler
+ * prior to invoking one of the marshal API's, then events will be delivered to
+ * a default event handler which will terminate the marshal operation after
+ * encountering the first error or fatal error. Note that for JAXB 2.0 and
+ * later versions, {@link javax.xml.bind.helpers.DefaultValidationEventHandler} is
+ * no longer used.
+ *
+ * </blockquote>
+ *
+ * <p>
+ * <a name="supportedProps"></a>
+ * <b>Supported Properties</b><br>
+ * <blockquote>
+ * <p>
+ * All JAXB Providers are required to support the following set of properties.
+ * Some providers may support additional properties.
+ * <dl>
+ * <dt><tt>jaxb.encoding</tt> - value must be a java.lang.String</dd>
+ * <dd>The output encoding to use when marshalling the XML data. The
+ * Marshaller will use "UTF-8" by default if this property is not
+ * specified.</dd>
+ * <dt><tt>jaxb.formatted.output</tt> - value must be a java.lang.Boolean</dd>
+ * <dd>This property controls whether or not the Marshaller will format
+ * the resulting XML data with line breaks and indentation. A
+ * true value for this property indicates human readable indented
+ * xml data, while a false value indicates unformatted xml data.
+ * The Marshaller will default to false (unformatted) if this
+ * property is not specified.</dd>
+ * <dt><tt>jaxb.schemaLocation</tt> - value must be a java.lang.String</dd>
+ * <dd>This property allows the client application to specify an
+ * xsi:schemaLocation attribute in the generated XML data. The format of
+ * the schemaLocation attribute value is discussed in an easy to
+ * understand, non-normative form in
+ * <a href="http://www.w3.org/TR/xmlschema-0/#schemaLocation">Section 5.6
+ * of the W3C XML Schema Part 0: Primer</a> and specified in
+ * <a href="http://www.w3.org/TR/xmlschema-1/#Instance_Document_Constructions">
+ * Section 2.6 of the W3C XML Schema Part 1: Structures</a>.</dd>
+ * <dt><tt>jaxb.noNamespaceSchemaLocation</tt> - value must be a java.lang.String</dd>
+ * <dd>This property allows the client application to specify an
+ * xsi:noNamespaceSchemaLocation attribute in the generated XML
+ * data. The format of the schemaLocation attribute value is discussed in
+ * an easy to understand, non-normative form in
+ * <a href="http://www.w3.org/TR/xmlschema-0/#schemaLocation">Section 5.6
+ * of the W3C XML Schema Part 0: Primer</a> and specified in
+ * <a href="http://www.w3.org/TR/xmlschema-1/#Instance_Document_Constructions">
+ * Section 2.6 of the W3C XML Schema Part 1: Structures</a>.</dd>
+ * <dt><tt>jaxb.fragment</tt> - value must be a java.lang.Boolean</dd>
+ * <dd>This property determines whether or not document level events will be
+ * generated by the Marshaller. If the property is not specified, the
+ * default is <tt>false</tt>. This property has different implications depending
+ * on which marshal api you are using - when this property is set to true:<br>
+ * <ul>
+ * <li>{@link #marshal(Object,org.xml.sax.ContentHandler) marshal(Object,ContentHandler)} - the Marshaller won't
+ * invoke {@link org.xml.sax.ContentHandler#startDocument()} and
+ * {@link org.xml.sax.ContentHandler#endDocument()}.</li>
+ * <li>{@link #marshal(Object,org.w3c.dom.Node) marshal(Object,Node)} - the property has no effect on this
+ * API.</li>
+ * <li>{@link #marshal(Object,java.io.OutputStream) marshal(Object,OutputStream)} - the Marshaller won't
+ * generate an xml declaration.</li>
+ * <li>{@link #marshal(Object,java.io.Writer) marshal(Object,Writer)} - the Marshaller won't
+ * generate an xml declaration.</li>
+ * <li>{@link #marshal(Object,javax.xml.transform.Result) marshal(Object,Result)} - depends on the kind of
+ * Result object, see semantics for Node, ContentHandler, and Stream APIs</li>
+ * <li>{@link #marshal(Object,javax.xml.stream.XMLEventWriter) marshal(Object,XMLEventWriter)} - the
+ * Marshaller will not generate {@link javax.xml.stream.events.XMLEvent#START_DOCUMENT} and
+ * {@link javax.xml.stream.events.XMLEvent#END_DOCUMENT} events.</li>
+ * <li>{@link #marshal(Object,javax.xml.stream.XMLStreamWriter) marshal(Object,XMLStreamWriter)} - the
+ * Marshaller will not generate {@link javax.xml.stream.events.XMLEvent#START_DOCUMENT} and
+ * {@link javax.xml.stream.events.XMLEvent#END_DOCUMENT} events.</li>
+ * </ul>
+ * </dd>
+ * </dl>
+ * </blockquote>
+ *
+ * <p>
+ * <a name="marshalEventCallback"></a>
+ * <b>Marshal Event Callbacks</b><br>
+ * <blockquote>
+ * "The {@link Marshaller} provides two styles of callback mechanisms
+ * that allow application specific processing during key points in the
+ * unmarshalling process. In 'class defined' event callbacks, application
+ * specific code placed in JAXB mapped classes is triggered during
+ * marshalling. 'External listeners' allow for centralized processing
+ * of marshal events in one callback method rather than by type event callbacks.
+ *
+ * <p>
+ * Class defined event callback methods allow any JAXB mapped class to specify
+ * its own specific callback methods by defining methods with the following method signatures:
+ * <blockquote>
+ * <pre>
+ * // Invoked by Marshaller after it has created an instance of this object.
+ * boolean beforeMarshal(Marshaller, Object parent);
+ *
+ * // Invoked by Marshaller after it has marshalled all properties of this object.
+ * void afterMmarshal(Marshaller, Object parent);
+ * </pre>
+ * </blockquote>
+ * The class defined event callback methods should be used when the callback method requires
+ * access to non-public methods and/or fields of the class.
+ * <p>
+ * The external listener callback mechanism enables the registration of a {@link Listener}
+ * instance with a {@link Marshaller#setListener(Listener)}. The external listener receives all callback events,
+ * allowing for more centralized processing than per class defined callback methods.
+ * <p>
+ * The 'class defined' and external listener event callback methods are independent of each other,
+ * both can be called for one event. The invocation ordering when both listener callback methods exist is
+ * defined in {@link Listener#beforeMarshal(Object)} and {@link Listener#afterMarshal(Object)}.
+ * <p>
+ * An event callback method throwing an exception terminates the current marshal process.
+ * </blockquote>
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$ $Date: 2006/03/08 16:54:42 $
+ * @see JAXBContext
+ * @see Validator
+ * @see Unmarshaller
+ * @since JAXB1.0
+ */
+public interface Marshaller {
+
+ /**
+ * The name of the property used to specify the output encoding in
+ * the marshalled XML data.
+ */
+ public static final String JAXB_ENCODING =
+ "jaxb.encoding";
+
+ /**
+ * The name of the property used to specify whether or not the marshalled
+ * XML data is formatted with linefeeds and indentation.
+ */
+ public static final String JAXB_FORMATTED_OUTPUT =
+ "jaxb.formatted.output";
+
+ /**
+ * The name of the property used to specify the xsi:schemaLocation
+ * attribute value to place in the marshalled XML output.
+ */
+ public static final String JAXB_SCHEMA_LOCATION =
+ "jaxb.schemaLocation";
+
+ /**
+ * The name of the property used to specify the
+ * xsi:noNamespaceSchemaLocation attribute value to place in the marshalled
+ * XML output.
+ */
+ public static final String JAXB_NO_NAMESPACE_SCHEMA_LOCATION =
+ "jaxb.noNamespaceSchemaLocation";
+
+ /**
+ * The name of the property used to specify whether or not the marshaller
+ * will generate document level events (ie calling startDocument or endDocument).
+ */
+ public static final String JAXB_FRAGMENT =
+ "jaxb.fragment";
+
+ /**
+ * Marshal the content tree rooted at <tt>jaxbElement</tt> into the specified
+ * <tt>javax.xml.transform.Result</tt>.
+ *
+ * <p>
+ * All JAXB Providers must at least support
+ * {@link javax.xml.transform.dom.DOMResult},
+ * {@link javax.xml.transform.sax.SAXResult}, and
+ * {@link javax.xml.transform.stream.StreamResult}. It can
+ * support other derived classes of <tt>Result</tt> as well.
+ *
+ * @param jaxbElement
+ * The root of content tree to be marshalled.
+ * @param result
+ * XML will be sent to this Result
+ *
+ * @throws JAXBException
+ * If any unexpected problem occurs during the marshalling.
+ * @throws MarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any
+ * object reachable from <tt>obj</tt>). See <a href="#elementMarshalling">
+ * Marshalling a JAXB element</a>.
+ * @throws IllegalArgumentException
+ * If any of the method parameters are null
+ */
+ public void marshal( Object jaxbElement, javax.xml.transform.Result result )
+ throws JAXBException;
+
+ /**
+ * Marshal the content tree rooted at <tt>jaxbElement</tt> into an output stream.
+ *
+ * @param jaxbElement
+ * The root of content tree to be marshalled.
+ * @param os
+ * XML will be added to this stream.
+ *
+ * @throws JAXBException
+ * If any unexpected problem occurs during the marshalling.
+ * @throws MarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any
+ * object reachable from <tt>obj</tt>). See <a href="#elementMarshalling">
+ * Marshalling a JAXB element</a>.
+ * @throws IllegalArgumentException
+ * If any of the method parameters are null
+ */
+ public void marshal( Object jaxbElement, java.io.OutputStream os )
+ throws JAXBException;
+
+ /**
+ * Marshal the content tree rooted at <tt>jaxbElement</tt> into a Writer.
+ *
+ * @param jaxbElement
+ * The root of content tree to be marshalled.
+ * @param writer
+ * XML will be sent to this writer.
+ *
+ * @throws JAXBException
+ * If any unexpected problem occurs during the marshalling.
+ * @throws MarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any
+ * object reachable from <tt>obj</tt>). See <a href="#elementMarshalling">
+ * Marshalling a JAXB element</a>.
+ * @throws IllegalArgumentException
+ * If any of the method parameters are null
+ */
+ public void marshal( Object jaxbElement, java.io.Writer writer )
+ throws JAXBException;
+
+ /**
+ * Marshal the content tree rooted at <tt>jaxbElement</tt> into SAX2 events.
+ *
+ * @param jaxbElement
+ * The root of content tree to be marshalled.
+ * @param handler
+ * XML will be sent to this handler as SAX2 events.
+ *
+ * @throws JAXBException
+ * If any unexpected problem occurs during the marshalling.
+ * @throws MarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any
+ * object reachable from <tt>obj</tt>). See <a href="#elementMarshalling">
+ * Marshalling a JAXB element</a>.
+ * @throws IllegalArgumentException
+ * If any of the method parameters are null
+ */
+ public void marshal( Object jaxbElement, org.xml.sax.ContentHandler handler )
+ throws JAXBException;
+
+ /**
+ * Marshal the content tree rooted at <tt>jaxbElement</tt> into a DOM tree.
+ *
+ * @param jaxbElement
+ * The content tree to be marshalled.
+ * @param node
+ * DOM nodes will be added as children of this node.
+ * This parameter must be a Node that accepts children
+ * ({@link org.w3c.dom.Document},
+ * {@link org.w3c.dom.DocumentFragment}, or
+ * {@link org.w3c.dom.Element})
+ *
+ * @throws JAXBException
+ * If any unexpected problem occurs during the marshalling.
+ * @throws MarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Marshaller</tt> is unable to marshal <tt>jaxbElement</tt> (or any
+ * object reachable from <tt>jaxbElement</tt>). See <a href="#elementMarshalling">
+ * Marshalling a JAXB element</a>.
+ * @throws IllegalArgumentException
+ * If any of the method parameters are null
+ */
+ public void marshal( Object jaxbElement, org.w3c.dom.Node node )
+ throws JAXBException;
+
+ /**
+ * Marshal the content tree rooted at <tt>jaxbElement</tt> into a
+ * {@link javax.xml.stream.XMLStreamWriter}.
+ *
+ * @param jaxbElement
+ * The content tree to be marshalled.
+ * @param writer
+ * XML will be sent to this writer.
+ *
+ * @throws JAXBException
+ * If any unexpected problem occurs during the marshalling.
+ * @throws MarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any
+ * object reachable from <tt>obj</tt>). See <a href="#elementMarshalling">
+ * Marshalling a JAXB element</a>.
+ * @throws IllegalArgumentException
+ * If any of the method parameters are null
+ * @since JAXB 2.0
+ */
+ public void marshal( Object jaxbElement, javax.xml.stream.XMLStreamWriter writer )
+ throws JAXBException;
+
+ /**
+ * Marshal the content tree rooted at <tt>jaxbElement</tt> into a
+ * {@link javax.xml.stream.XMLEventWriter}.
+ *
+ * @param jaxbElement
+ * The content tree rooted at jaxbElement to be marshalled.
+ * @param writer
+ * XML will be sent to this writer.
+ *
+ * @throws JAXBException
+ * If any unexpected problem occurs during the marshalling.
+ * @throws MarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Marshaller</tt> is unable to marshal <tt>obj</tt> (or any
+ * object reachable from <tt>obj</tt>). See <a href="#elementMarshalling">
+ * Marshalling a JAXB element</a>.
+ * @throws IllegalArgumentException
+ * If any of the method parameters are null
+ * @since JAXB 2.0
+ */
+ public void marshal( Object jaxbElement, javax.xml.stream.XMLEventWriter writer )
+ throws JAXBException;
+
+ /**
+ * Get a DOM tree view of the content tree(Optional).
+ *
+ * If the returned DOM tree is updated, these changes are also
+ * visible in the content tree.
+ * Use {@link #marshal(Object, org.w3c.dom.Node)} to force
+ * a deep copy of the content tree to a DOM representation.
+ *
+ * @param contentTree - JAXB Java representation of XML content
+ *
+ * @return the DOM tree view of the contentTree
+ *
+ * @throws UnsupportedOperationException
+ * If the JAXB provider implementation does not support a
+ * DOM view of the content tree
+ *
+ * @throws IllegalArgumentException
+ * If any of the method parameters are null
+ *
+ * @throws JAXBException
+ * If any unexpected problem occurs
+ *
+ */
+ public org.w3c.dom.Node getNode( java.lang.Object contentTree )
+ throws JAXBException;
+
+ /**
+ * Set the particular property in the underlying implementation of
+ * <tt>Marshaller</tt>. This method can only be used to set one of
+ * the standard JAXB defined properties above or a provider specific
+ * property. Attempting to set an undefined property will result in
+ * a PropertyException being thrown. See <a href="#supportedProps">
+ * Supported Properties</a>.
+ *
+ * @param name the name of the property to be set. This value can either
+ * be specified using one of the constant fields or a user
+ * supplied string.
+ * @param value the value of the property to be set
+ *
+ * @throws PropertyException when there is an error processing the given
+ * property or value
+ * @throws IllegalArgumentException
+ * If the name parameter is null
+ */
+ public void setProperty( String name, Object value )
+ throws PropertyException;
+
+ /**
+ * Get the particular property in the underlying implementation of
+ * <tt>Marshaller</tt>. This method can only be used to get one of
+ * the standard JAXB defined properties above or a provider specific
+ * property. Attempting to get an undefined property will result in
+ * a PropertyException being thrown. See <a href="#supportedProps">
+ * Supported Properties</a>.
+ *
+ * @param name the name of the property to retrieve
+ * @return the value of the requested property
+ *
+ * @throws PropertyException
+ * when there is an error retrieving the given property or value
+ * property name
+ * @throws IllegalArgumentException
+ * If the name parameter is null
+ */
+ public Object getProperty( String name ) throws PropertyException;
+
+ /**
+ * Allow an application to register a validation event handler.
+ * <p>
+ * The validation event handler will be called by the JAXB Provider if any
+ * validation errors are encountered during calls to any of the marshal
+ * API's. If the client application does not register a validation event
+ * handler before invoking one of the marshal methods, then validation
+ * events will be handled by the default event handler which will terminate
+ * the marshal operation after the first error or fatal error is encountered.
+ * <p>
+ * Calling this method with a null parameter will cause the Marshaller
+ * to revert back to the default default event handler.
+ *
+ * @param handler the validation event handler
+ * @throws JAXBException if an error was encountered while setting the
+ * event handler
+ */
+ public void setEventHandler( ValidationEventHandler handler )
+ throws JAXBException;
+
+ /**
+ * Return the current event handler or the default event handler if one
+ * hasn't been set.
+ *
+ * @return the current ValidationEventHandler or the default event handler
+ * if it hasn't been set
+ * @throws JAXBException if an error was encountered while getting the
+ * current event handler
+ */
+ public ValidationEventHandler getEventHandler()
+ throws JAXBException;
+
+
+
+ /**
+ * Associates a configured instance of {@link XmlAdapter} with this marshaller.
+ *
+ * <p>
+ * This is a convenience method that invokes <code>setAdapter(adapter.getClass(),adapter);</code>.
+ *
+ * @see #setAdapter(Class,XmlAdapter)
+ * @throws IllegalArgumentException
+ * if the adapter parameter is null.
+ * @throws UnsupportedOperationException
+ * if invoked agains a JAXB 1.0 implementation.
+ * @since JAXB 2.0
+ */
+ public void setAdapter( XmlAdapter adapter );
+
+ /**
+ * Associates a configured instance of {@link XmlAdapter} with this marshaller.
+ *
+ * <p>
+ * Every marshaller internally maintains a
+ * {@link java.util.Map}<{@link Class},{@link XmlAdapter}>,
+ * which it uses for marshalling classes whose fields/methods are annotated
+ * with {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter}.
+ *
+ * <p>
+ * This method allows applications to use a configured instance of {@link XmlAdapter}.
+ * When an instance of an adapter is not given, a marshaller will create
+ * one by invoking its default constructor.
+ *
+ * @param type
+ * The type of the adapter. The specified instance will be used when
+ * {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter#value()}
+ * refers to this type.
+ * @param adapter
+ * The instance of the adapter to be used. If null, it will un-register
+ * the current adapter set for this type.
+ * @throws IllegalArgumentException
+ * if the type parameter is null.
+ * @throws UnsupportedOperationException
+ * if invoked agains a JAXB 1.0 implementation.
+ * @since JAXB 2.0
+ */
+ public <A extends XmlAdapter> void setAdapter( Class<A> type, A adapter );
+
+ /**
+ * Gets the adapter associated with the specified type.
+ *
+ * This is the reverse operation of the {@link #setAdapter} method.
+ *
+ * @throws IllegalArgumentException
+ * if the type parameter is null.
+ * @throws UnsupportedOperationException
+ * if invoked agains a JAXB 1.0 implementation.
+ * @since JAXB 2.0
+ */
+ public <A extends XmlAdapter> A getAdapter( Class<A> type );
+
+
+ /**
+ * <p>Associate a context that enables binary data within an XML document
+ * to be transmitted as XML-binary optimized attachment.
+ * The attachment is referenced from the XML document content model
+ * by content-id URIs(cid) references stored within the xml document.
+ *
+ * @throws IllegalStateException if attempt to concurrently call this
+ * method during a marshal operation.
+ */
+ void setAttachmentMarshaller(AttachmentMarshaller am);
+
+ AttachmentMarshaller getAttachmentMarshaller();
+
+ /**
+ * Specify the JAXP 1.3 {@link javax.xml.validation.Schema Schema}
+ * object that should be used to validate subsequent marshal operations
+ * against. Passing null into this method will disable validation.
+ *
+ * <p>
+ * This method allows the caller to validate the marshalled XML as it's marshalled.
+ *
+ * <p>
+ * Initially this property is set to <tt>null</tt>.
+ *
+ * @param schema Schema object to validate marshal operations against or null to disable validation
+ * @throws UnsupportedOperationException could be thrown if this method is
+ * invoked on an Marshaller created from a JAXBContext referencing
+ * JAXB 1.0 mapped classes
+ * @since JAXB2.0
+ */
+ public void setSchema( Schema schema );
+
+ /**
+ * Get the JAXP 1.3 {@link javax.xml.validation.Schema Schema} object
+ * being used to perform marshal-time validation. If there is no
+ * Schema set on the marshaller, then this method will return null
+ * indicating that marshal-time validation will not be performed.
+ *
+ * @return the Schema object being used to perform marshal-time
+ * validation or null if not present.
+ * @throws UnsupportedOperationException could be thrown if this method is
+ * invoked on an Marshaller created from a JAXBContext referencing
+ * JAXB 1.0 mapped classes
+ * @since JAXB2.0
+ */
+ public Schema getSchema();
+
+ /**
+ * <p/>
+ * Register an instance of an implementation of this class with a {@link Marshaller} to externally listen
+ * for marshal events.
+ * <p/>
+ * <p/>
+ * This class enables pre and post processing of each marshalled object.
+ * The event callbacks are called when marshalling from an instance that maps to an xml element or
+ * complex type definition. The event callbacks are not called when marshalling from an instance of a
+ * Java datatype that represents a simple type definition.
+ * <p/>
+ * <p/>
+ * External listener is one of two different mechanisms for defining marshal event callbacks.
+ * See <a href="Marshaller.html#marshalEventCallback">Marshal Event Callbacks</a> for an overview.
+ *
+ * @see Marshaller#setListener(Listener)
+ * @see Marshaller#getListener()
+ * @since JAXB2.0
+ */
+ public static abstract class Listener {
+ /**
+ * <p/>
+ * Callback method invoked before marshalling from <tt>source</tt> to XML.
+ * <p/>
+ * <p/>
+ * This method is invoked just before marshalling process starts to marshal <tt>source</tt>.
+ * Note that if the class of <tt>source</tt> defines its own <tt>beforeMarshal</tt> method,
+ * the class specific callback method is invoked just before this method is invoked.
+ *
+ * @param source instance of JAXB mapped class prior to marshalling from it.
+ */
+ public void beforeMarshal(Object source) {
+ }
+
+ /**
+ * <p/>
+ * Callback method invoked after marshalling <tt>source</tt> to XML.
+ * <p/>
+ * <p/>
+ * This method is invoked after <tt>source</tt> and all its descendants have been marshalled.
+ * Note that if the class of <tt>source</tt> defines its own <tt>afterMarshal</tt> method,
+ * the class specific callback method is invoked just before this method is invoked.
+ *
+ * @param source instance of JAXB mapped class after marshalling it.
+ */
+ public void afterMarshal(Object source) {
+ }
+ }
+
+ /**
+ * <p>
+ * Register marshal event callback {@link Listener} with this {@link Marshaller}.
+ *
+ * <p>
+ * There is only one Listener per Marshaller. Setting a Listener replaces the previous set Listener.
+ * One can unregister current Listener by setting listener to <tt>null</tt>.
+ *
+ * @param listener an instance of a class that implements {@link Listener}
+ * @since JAXB2.0
+ */
+ public void setListener(Listener listener);
+
+ /**
+ * <p>Return {@link Listener} registered with this {@link Marshaller}.
+ *
+ * @return registered {@link Listener} or <code>null</code> if no Listener is registered with this Marshaller.
+ * @since JAXB2.0
+ */
+ public Listener getListener();
+}
+
+
+
+
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Marshaller.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Messages.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Messages.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Messages.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+import java.text.MessageFormat;
+import java.util.ResourceBundle;
+
+/**
+ * Formats error messages.
+ */
+class Messages
+{
+ static String format( String property ) {
+ return format( property, null );
+ }
+
+ static String format( String property, Object arg1 ) {
+ return format( property, new Object[]{arg1} );
+ }
+
+ static String format( String property, Object arg1, Object arg2 ) {
+ return format( property, new Object[]{arg1,arg2} );
+ }
+
+ static String format( String property, Object arg1, Object arg2, Object arg3 ) {
+ return format( property, new Object[]{arg1,arg2,arg3} );
+ }
+
+ // add more if necessary.
+
+ /** Loads a string resource and formats it with specified arguments. */
+ static String format( String property, Object[] args ) {
+ String text = ResourceBundle.getBundle(Messages.class.getName()).getString(property);
+ return MessageFormat.format(text,args);
+ }
+
+//
+//
+// Message resources
+//
+//
+ static final String PROVIDER_NOT_FOUND = // 1 arg
+ "ContextFinder.ProviderNotFound";
+
+ static final String COULD_NOT_INSTANTIATE = // 2 args
+ "ContextFinder.CouldNotInstantiate";
+
+ static final String CANT_FIND_PROPERTIES_FILE = // 1 arg
+ "ContextFinder.CantFindPropertiesFile";
+
+ static final String CANT_MIX_PROVIDERS = // 0 args
+ "ContextFinder.CantMixProviders";
+
+ static final String MISSING_PROPERTY = // 2 args
+ "ContextFinder.MissingProperty";
+
+ static final String NO_PACKAGE_IN_CONTEXTPATH = // 0 args
+ "ContextFinder.NoPackageInContextPath";
+
+ static final String NAME_VALUE = // 2 args
+ "PropertyException.NameValue";
+
+ static final String CONVERTER_MUST_NOT_BE_NULL = // 0 args
+ "DatatypeConverter.ConverterMustNotBeNull";
+
+ static final String ILLEGAL_CAST = // 2 args
+ "JAXBContext.IllegalCast";
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Messages.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/NotIdentifiableEvent.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/NotIdentifiableEvent.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/NotIdentifiableEvent.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+/**
+ * This event indicates that a problem was encountered resolving an ID/IDREF.
+ *
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$
+ * @see Validator
+ * @see ValidationEventHandler
+ * @since JAXB1.0
+ */
+public interface NotIdentifiableEvent extends ValidationEvent {
+
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/NotIdentifiableEvent.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ParseConversionEvent.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ParseConversionEvent.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ParseConversionEvent.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+/**
+ * This event indicates that a problem was encountered while converting a
+ * string from the XML data into a value of the target Java data type.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$
+ * @see ValidationEvent
+ * @see ValidationEventHandler
+ * @see Unmarshaller
+ * @since JAXB1.0
+ */
+public interface ParseConversionEvent extends ValidationEvent {
+
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ParseConversionEvent.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/PrintConversionEvent.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/PrintConversionEvent.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/PrintConversionEvent.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+/**
+ * This event indicates that a problem was encountered while converting data
+ * from the Java content tree into its lexical representation.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$
+ * @see ValidationEvent
+ * @see ValidationEventHandler
+ * @see Marshaller
+ * @since JAXB1.0
+ */
+public interface PrintConversionEvent extends ValidationEvent {
+
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/PrintConversionEvent.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/PropertyException.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/PropertyException.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/PropertyException.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+
+
+/**
+ * This exception indicates that an error was encountered while getting or
+ * setting a property.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$ $Date: 2004/12/14 21:50:40 $
+ * @see JAXBContext
+ * @see Validator
+ * @see Unmarshaller
+ * @since JAXB1.0
+ */
+public class PropertyException extends JAXBException {
+
+ /**
+ * Construct a PropertyException with the specified detail message. The
+ * errorCode and linkedException will default to null.
+ *
+ * @param message a description of the exception
+ */
+ public PropertyException(String message) {
+ super(message);
+ }
+
+ /**
+ * Construct a PropertyException with the specified detail message and
+ * vendor specific errorCode. The linkedException will default to null.
+ *
+ * @param message a description of the exception
+ * @param errorCode a string specifying the vendor specific error code
+ */
+ public PropertyException(String message, String errorCode) {
+ super(message, errorCode);
+ }
+
+ /**
+ * Construct a PropertyException with a linkedException. The detail
+ * message and vendor specific errorCode will default to null.
+ *
+ * @param exception the linked exception
+ */
+ public PropertyException(Throwable exception) {
+ super(exception);
+ }
+
+ /**
+ * Construct a PropertyException with the specified detail message and
+ * linkedException. The errorCode will default to null.
+ *
+ * @param message a description of the exception
+ * @param exception the linked exception
+ */
+ public PropertyException(String message, Throwable exception) {
+ super(message, exception);
+ }
+
+ /**
+ * Construct a PropertyException with the specified detail message, vendor
+ * specific errorCode, and linkedException.
+ *
+ * @param message a description of the exception
+ * @param errorCode a string specifying the vendor specific error code
+ * @param exception the linked exception
+ */
+ public PropertyException(
+ String message,
+ String errorCode,
+ Throwable exception) {
+ super(message, errorCode, exception);
+ }
+
+ /**
+ * Construct a PropertyException whose message field is set based on the
+ * name of the property and value.toString().
+ *
+ * @param name the name of the property related to this exception
+ * @param value the value of the property related to this exception
+ */
+ public PropertyException(String name, Object value) {
+ super( Messages.format( Messages.NAME_VALUE,
+ name,
+ value.toString() ) );
+ }
+
+
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/PropertyException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/SchemaOutputResolver.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/SchemaOutputResolver.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/SchemaOutputResolver.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,57 @@
+package javax.xml.bind;
+
+import javax.xml.transform.Result;
+import java.io.IOException;
+
+/**
+ * Controls where a JAXB implementation puts the generates
+ * schema files.
+ *
+ * <p>
+ * An implementation of this abstract class has to be provided by the calling
+ * application to generate schemas.
+ *
+ * <p>
+ * This is a class, not an interface so as to allow future versions to evolve
+ * without breaking the compatibility.
+ *
+ * @author
+ * Kohsuke Kawaguchi (kohsuke.kawaguchi at sun.com)
+ */
+public abstract class SchemaOutputResolver {
+ /**
+ * Decides where the schema file (of the given namespace URI)
+ * will be written, and return it as a {@link Result} object.
+ *
+ * <p>
+ * This method is called only once for any given namespace.
+ * IOW, all the components in one namespace is always written
+ * into the same schema document.
+ *
+ * @param namespaceUri
+ * The namespace URI that the schema declares.
+ * Can be the empty string, but never be null.
+ * @param suggestedFileName
+ * A JAXB implementation generates an unique file name (like "schema1.xsd")
+ * for the convenience of the callee. This name can be
+ * used for the file name of the schema, or the callee can just
+ * ignore this name and come up with its own name.
+ * This is just a hint.
+ *
+ * @return
+ * a {@link Result} object that encapsulates the actual destination
+ * of the schema.
+ *
+ * If the {@link Result} object has a system ID, it must be an
+ * absolute system ID. Those system IDs are relativized by the caller and used
+ * for <xs:import> statements.
+ *
+ * If the {@link Result} object does not have a system ID, a schema
+ * for the namespace URI is generated but it won't be explicitly
+ * <xs:import>ed from other schemas.
+ *
+ * If {@code null} is returned, the schema generation for this
+ * namespace URI will be skipped.
+ */
+ public abstract Result createOutput( String namespaceUri, String suggestedFileName ) throws IOException;
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/SchemaOutputResolver.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/TypeConstraintException.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/TypeConstraintException.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/TypeConstraintException.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,164 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+/**
+ * This exception indicates that a violation of a dynamically checked type
+ * constraint was detected.
+ *
+ * <p>
+ * This exception can be thrown by the generated setter methods of the schema
+ * derived Java content classes. However, since fail-fast validation is
+ * an optional feature for JAXB Providers to support, not all setter methods
+ * will throw this exception when a type constraint is violated.
+ *
+ * <p>
+ * If this exception is throw while invoking a fail-fast setter, the value of
+ * the property is guaranteed to remain unchanged, as if the setter were never
+ * called.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$
+ * @see ValidationEvent
+ * @since JAXB1.0
+ */
+
+public class TypeConstraintException extends java.lang.RuntimeException {
+
+ /**
+ * Vendor specific error code
+ *
+ */
+ private String errorCode;
+
+ /**
+ * Exception reference
+ *
+ */
+ private Throwable linkedException;
+
+
+ /**
+ * Construct a TypeConstraintException with the specified detail message. The
+ * errorCode and linkedException will default to null.
+ *
+ * @param message a description of the exception
+ */
+ public TypeConstraintException(String message) {
+ this( message, null, null );
+ }
+
+ /**
+ * Construct a TypeConstraintException with the specified detail message and vendor
+ * specific errorCode. The linkedException will default to null.
+ *
+ * @param message a description of the exception
+ * @param errorCode a string specifying the vendor specific error code
+ */
+ public TypeConstraintException(String message, String errorCode) {
+ this( message, errorCode, null );
+ }
+
+ /**
+ * Construct a TypeConstraintException with a linkedException. The detail message and
+ * vendor specific errorCode will default to null.
+ *
+ * @param exception the linked exception
+ */
+ public TypeConstraintException(Throwable exception) {
+ this( null, null, exception );
+ }
+
+ /**
+ * Construct a TypeConstraintException with the specified detail message and
+ * linkedException. The errorCode will default to null.
+ *
+ * @param message a description of the exception
+ * @param exception the linked exception
+ */
+ public TypeConstraintException(String message, Throwable exception) {
+ this( message, null, exception );
+ }
+
+ /**
+ * Construct a TypeConstraintException with the specified detail message,
+ * vendor specific errorCode, and linkedException.
+ *
+ * @param message a description of the exception
+ * @param errorCode a string specifying the vendor specific error code
+ * @param exception the linked exception
+ */
+ public TypeConstraintException(String message, String errorCode, Throwable exception) {
+ super( message );
+ this.errorCode = errorCode;
+ this.linkedException = exception;
+ }
+
+ /**
+ * Get the vendor specific error code
+ *
+ * @return a string specifying the vendor specific error code
+ */
+ public String getErrorCode() {
+ return this.errorCode;
+ }
+
+ /**
+ * Get the linked exception
+ *
+ * @return the linked Exception, null if none exists
+ */
+ public Throwable getLinkedException() {
+ return linkedException;
+ }
+
+ /**
+ * Add a linked Exception.
+ *
+ * @param exception the linked Exception (A null value is permitted and
+ * indicates that the linked exception does not exist or
+ * is unknown).
+ */
+ public synchronized void setLinkedException( Throwable exception ) {
+ this.linkedException = exception;
+ }
+
+ /**
+ * Returns a short description of this TypeConstraintException.
+ *
+ */
+ public String toString() {
+ return linkedException == null ?
+ super.toString() :
+ super.toString() + "\n - with linked exception:\n[" +
+ linkedException.toString()+ "]";
+ }
+
+ /**
+ * Prints this TypeConstraintException and its stack trace (including the stack trace
+ * of the linkedException if it is non-null) to the PrintStream.
+ *
+ * @param s PrintStream to use for output
+ */
+ public void printStackTrace( java.io.PrintStream s ) {
+ if( linkedException != null ) {
+ linkedException.printStackTrace(s);
+ s.println("--------------- linked to ------------------");
+ }
+
+ super.printStackTrace(s);
+ }
+
+ /**
+ * Prints this TypeConstraintException and its stack trace (including the stack trace
+ * of the linkedException if it is non-null) to <tt>System.err</tt>.
+ *
+ */
+ public void printStackTrace() {
+ printStackTrace(System.err);
+ }
+
+}
\ No newline at end of file
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/TypeConstraintException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/UnmarshalException.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/UnmarshalException.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/UnmarshalException.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+/**
+ * This exception indicates that an error has occurred while performing
+ * an unmarshal operation that prevents the JAXB Provider from completing
+ * the operation.
+ *
+ * <p>
+ * The <tt>ValidationEventHandler</tt> can cause this exception to be thrown
+ * during the unmarshal operations. See
+ * {@link ValidationEventHandler#handleEvent(ValidationEvent)
+ * ValidationEventHandler.handleEvent(ValidationEvent)}.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$
+ * @see JAXBException
+ * @see Unmarshaller
+ * @see ValidationEventHandler
+ * @since JAXB1.0
+ */
+public class UnmarshalException extends JAXBException {
+
+ /**
+ * Construct an UnmarshalException with the specified detail message. The
+ * errorCode and linkedException will default to null.
+ *
+ * @param message a description of the exception
+ */
+ public UnmarshalException( String message ) {
+ this( message, null, null );
+ }
+
+ /**
+ * Construct an UnmarshalException with the specified detail message and vendor
+ * specific errorCode. The linkedException will default to null.
+ *
+ * @param message a description of the exception
+ * @param errorCode a string specifying the vendor specific error code
+ */
+ public UnmarshalException( String message, String errorCode ) {
+ this( message, errorCode, null );
+ }
+
+ /**
+ * Construct an UnmarshalException with a linkedException. The detail message and
+ * vendor specific errorCode will default to null.
+ *
+ * @param exception the linked exception
+ */
+ public UnmarshalException( Throwable exception ) {
+ this( null, null, exception );
+ }
+
+ /**
+ * Construct an UnmarshalException with the specified detail message and
+ * linkedException. The errorCode will default to null.
+ *
+ * @param message a description of the exception
+ * @param exception the linked exception
+ */
+ public UnmarshalException( String message, Throwable exception ) {
+ this( message, null, exception );
+ }
+
+ /**
+ * Construct an UnmarshalException with the specified detail message, vendor
+ * specific errorCode, and linkedException.
+ *
+ * @param message a description of the exception
+ * @param errorCode a string specifying the vendor specific error code
+ * @param exception the linked exception
+ */
+ public UnmarshalException( String message, String errorCode, Throwable exception ) {
+ super( message, errorCode, exception );
+ }
+
+}
+
+
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/UnmarshalException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Unmarshaller.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Unmarshaller.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Unmarshaller.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,1124 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+import javax.xml.bind.attachment.AttachmentUnmarshaller;
+import javax.xml.validation.Schema;
+import java.io.Reader;
+
+/**
+ * The <tt>Unmarshaller</tt> class governs the process of deserializing XML
+ * data into newly created Java content trees, optionally validating the XML
+ * data as it is unmarshalled. It provides an overloading of unmarshal methods
+ * for many different input kinds.
+ *
+ * <p>
+ * Unmarshalling from a File:
+ * <blockquote>
+ * <pre>
+ * JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ * Unmarshaller u = jc.createUnmarshaller();
+ * Object o = u.unmarshal( new File( "nosferatu.xml" ) );
+ * </pre>
+ * </blockquote>
+ *
+ *
+ * <p>
+ * Unmarshalling from an InputStream:
+ * <blockquote>
+ * <pre>
+ * InputStream is = new FileInputStream( "nosferatu.xml" );
+ * JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ * Unmarshaller u = jc.createUnmarshaller();
+ * Object o = u.unmarshal( is );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Unmarshalling from a URL:
+ * <blockquote>
+ * <pre>
+ * JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ * Unmarshaller u = jc.createUnmarshaller();
+ * URL url = new URL( "http://beaker.east/nosferatu.xml" );
+ * Object o = u.unmarshal( url );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Unmarshalling from a StringBuffer using a
+ * <tt>javax.xml.transform.stream.StreamSource</tt>:
+ * <blockquote>
+ * <pre>
+ * JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ * Unmarshaller u = jc.createUnmarshaller();
+ * StringBuffer xmlStr = new StringBuffer( "<?xml version="1.0"?>..." );
+ * Object o = u.unmarshal( new StreamSource( new StringReader( xmlStr.toString() ) ) );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Unmarshalling from a <tt>org.w3c.dom.Node</tt>:
+ * <blockquote>
+ * <pre>
+ * JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ * Unmarshaller u = jc.createUnmarshaller();
+ *
+ * DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ * dbf.setNamespaceAware(true);
+ * DocumentBuilder db = dbf.newDocumentBuilder();
+ * Document doc = db.parse(new File( "nosferatu.xml"));
+
+ * Object o = u.unmarshal( doc );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Unmarshalling from a <tt>javax.xml.transform.sax.SAXSource</tt> using a
+ * client specified validating SAX2.0 parser:
+ * <blockquote>
+ * <pre>
+ * // configure a validating SAX2.0 parser (Xerces2)
+ * static final String JAXP_SCHEMA_LANGUAGE =
+ * "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+ * static final String JAXP_SCHEMA_LOCATION =
+ * "http://java.sun.com/xml/jaxp/properties/schemaSource";
+ * static final String W3C_XML_SCHEMA =
+ * "http://www.w3.org/2001/XMLSchema";
+ *
+ * System.setProperty( "javax.xml.parsers.SAXParserFactory",
+ * "org.apache.xerces.jaxp.SAXParserFactoryImpl" );
+ *
+ * SAXParserFactory spf = SAXParserFactory.newInstance();
+ * spf.setNamespaceAware(true);
+ * spf.setValidating(true);
+ * SAXParser saxParser = spf.newSAXParser();
+ *
+ * try {
+ * saxParser.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
+ * saxParser.setProperty(JAXP_SCHEMA_LOCATION, "http://....");
+ * } catch (SAXNotRecognizedException x) {
+ * // exception handling omitted
+ * }
+ *
+ * XMLReader xmlReader = saxParser.getXMLReader();
+ * SAXSource source =
+ * new SAXSource( xmlReader, new InputSource( "http://..." ) );
+ *
+ * // Setup JAXB to unmarshal
+ * JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ * Unmarshaller u = jc.createUnmarshaller();
+ * ValidationEventCollector vec = new ValidationEventCollector();
+ * u.setEventHandler( vec );
+ *
+ * // turn off the JAXB provider's default validation mechanism to
+ * // avoid duplicate validation
+ * u.setValidating( false )
+ *
+ * // unmarshal
+ * Object o = u.unmarshal( source );
+ *
+ * // check for events
+ * if( vec.hasEvents() ) {
+ * // iterate over events
+ * }
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Unmarshalling from a StAX XMLStreamReader:
+ * <blockquote>
+ * <pre>
+ * JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ * Unmarshaller u = jc.createUnmarshaller();
+ *
+ * javax.xml.stream.XMLStreamReader xmlStreamReader =
+ * javax.xml.stream.XMLInputFactory().newInstance().createXMLStreamReader( ... );
+ *
+ * Object o = u.unmarshal( xmlStreamReader );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * Unmarshalling from a StAX XMLEventReader:
+ * <blockquote>
+ * <pre>
+ * JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ * Unmarshaller u = jc.createUnmarshaller();
+ *
+ * javax.xml.stream.XMLEventReader xmlEventReader =
+ * javax.xml.stream.XMLInputFactory().newInstance().createXMLEventReader( ... );
+ *
+ * Object o = u.unmarshal( xmlEventReader );
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * <a name="unmarshalEx"></a>
+ * <b>Unmarshalling XML Data</b><br>
+ * <blockquote>
+ * Unmarshalling can deserialize XML data that represents either an entire XML document
+ * or a subtree of an XML document. Typically, it is sufficient to use the
+ * unmarshalling methods described by
+ * <a href="#unmarshalGlobal">Unmarshal root element that is declared globally</a>.
+ * These unmarshal methods utilize {@link JAXBContext}'s mapping of global XML element
+ * declarations and type definitions to JAXB mapped classes to initiate the
+ * unmarshalling of the root element of XML data. When the {@link JAXBContext}'s
+ * mappings are not sufficient to unmarshal the root element of XML data,
+ * the application can assist the unmarshalling process by using the
+ * <a href="#unmarshalByDeclaredType">unmarshal by declaredType methods</a>.
+ * These methods are useful for unmarshalling XML data where
+ * the root element corresponds to a local element declaration in the schema.
+ * </blockquote>
+ *
+ * <blockquote>
+ * An unmarshal method never returns null. If the unmarshal process is unable to unmarshal
+ * the root of XML content to a JAXB mapped object, a fatal error is reported that
+ * terminates processing by throwing JAXBException.
+ * </blockquote>
+ *
+ * <p>
+ * <a name="unmarshalGlobal"></a>
+ * <b>Unmarshal a root element that is globally declared</b><br>
+ * <blockquote>
+ * The unmarshal methods that do not have an <tt>declaredType</tt> parameter use
+ * {@link JAXBContext} to unmarshal the root element of an XML data. The {@link JAXBContext}
+ * instance is the one that was used to create this <tt>Unmarshaller</tt>. The {@link JAXBContext}
+ * instance maintains a mapping of globally declared XML element and type definition names to
+ * JAXB mapped classes. The unmarshal method checks if {@link JAXBContext} has a mapping
+ * from the root element's XML name and/or <tt>@xsi:type</tt> to a JAXB mapped class. If it does, it umarshalls the
+ * XML data using the appropriate JAXB mapped class. Note that when the root element name is unknown and the root
+ * element has an <tt>@xsi:type</tt>, the XML data is unmarshalled
+ * using that JAXB mapped class as the value of a {@link JAXBElement}.
+ * When the {@link JAXBContext} object does not have a mapping for the root element's name
+ * nor its <tt>@xsi:type</tt>, if it exists,
+ * then the unmarshal operation will abort immediately by throwing a {@link UnmarshalException
+ * UnmarshalException}. This exception scenario can be worked around by using the unmarshal by
+ * declaredType methods described in the next subsection.
+ * </blockquote>
+ *
+ * <p>
+ * <a name="unmarshalByDeclaredType"></a>
+ * <b>Unmarshal by Declared Type</b><br>
+ * <blockquote>
+ * The unmarshal methods with a <code>declaredType</code> parameter enable an
+ * application to deserialize a root element of XML data, even when
+ * there is no mapping in {@link JAXBContext} of the root element's XML name.
+ * The unmarshaller unmarshals the root element using the application provided
+ * mapping specified as the <tt>declaredType</tt> parameter.
+ * Note that even when the root element's element name is mapped by {@link JAXBContext},
+ * the <code>declaredType</code> parameter overrides that mapping for
+ * deserializing the root element when using these unmarshal methods.
+ * Additionally, when the root element of XML data has an <tt>xsi:type</tt> attribute and
+ * that attribute's value references a type definition that is mapped
+ * to a JAXB mapped class by {@link JAXBContext}, that the root
+ * element's <tt>xsi:type</tt> attribute takes
+ * precedence over the unmarshal methods <tt>declaredType</tt> parameter.
+ * These methods always return a <tt>JAXBElement<declaredType></tt>
+ * instance. The table below shows how the properties of the returned JAXBElement
+ * instance are set.
+ *
+ * <a name="unmarshalDeclaredTypeReturn"></a>
+ * <p>
+ * <table border="2" rules="all" cellpadding="4">
+ * <thead>
+ * <tr>
+ * <th align="center" colspan="2">
+ * Unmarshal By Declared Type returned JAXBElement
+ * </tr>
+ * <tr>
+ * <th>JAXBElement Property</th>
+ * <th>Value</th>
+ * </tr>
+ * </tr>
+ * <tr>
+ * <td>name</td>
+ * <td><code>xml element name</code></td>
+ * </tr>
+ * </thead>
+ * <tbody>
+ * <tr>
+ * <td>value</td>
+ * <td><code>instanceof declaredType</code></td>
+ * </tr>
+ * <tr>
+ * <td>declaredType</td>
+ * <td>unmarshal method <code>declaredType</code> parameter</td>
+ * </tr>
+ * <tr>
+ * <td>scope</td>
+ * <td><code>null</code> <i>(actual scope is unknown)</td>
+ * </tr>
+ * </tbody>
+ * </table>
+ * </blockquote>
+ *
+ * <p>
+ * The following is an example of
+ * <a href="#unmarshalByDeclaredType">unmarshal by declaredType method</a>.
+ * <p>
+ * Unmarshal by declaredType from a <tt>org.w3c.dom.Node</tt>:
+ * <blockquote>
+ * <pre>
+ * Schema fragment for example
+ * <xs:schema>
+ * <xs:complexType name="FooType">...<\xs:complexType>
+ * <!-- global element declaration "PurchaseOrder" -->
+ * <xs:element name="PurchaseOrder">
+ * <xs:complexType>
+ * <xs:sequence>
+ * <!-- local element declaration "foo" -->
+ * <xs:element name="foo" type="FooType"/>
+ * ...
+ * </xs:sequence>
+ * </xs:complexType>
+ * </xs:element>
+ * </xs:schema>
+ *
+ * JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
+ * Unmarshaller u = jc.createUnmarshaller();
+ *
+ * DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ * dbf.setNamespaceAware(true);
+ * DocumentBuilder db = dbf.newDocumentBuilder();
+ * Document doc = db.parse(new File( "nosferatu.xml"));
+ * Element fooSubtree = ...; // traverse DOM till reach xml element foo, constrained by a
+ * // local element declaration in schema.
+ *
+ * // FooType is the JAXB mapping of the type of local element declaration foo.
+ * JAXBElement<FooType> foo = u.unmarshal( fooSubtree, FooType.class);
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * <b>Support for SAX2.0 Compliant Parsers</b><br>
+ * <blockquote>
+ * A client application has the ability to select the SAX2.0 compliant parser
+ * of their choice. If a SAX parser is not selected, then the JAXB Provider's
+ * default parser will be used. Even though the JAXB Provider's default parser
+ * is not required to be SAX2.0 compliant, all providers are required to allow
+ * a client application to specify their own SAX2.0 parser. Some providers may
+ * require the client application to specify the SAX2.0 parser at schema compile
+ * time. See {@link #unmarshal(javax.xml.transform.Source) unmarshal(Source)}
+ * for more detail.
+ * </blockquote>
+ *
+ * <p>
+ * <b>Validation and Well-Formedness</b><br>
+ * <blockquote>
+ * <p>
+ * A client application can enable or disable JAXP 1.3 validation
+ * mechanism via the <tt>setSchema(javax.xml.validation.Schema)</tt> API.
+ * Sophisticated clients can specify their own validating SAX 2.0 compliant
+ * parser and bypass the JAXP 1.3 validation mechanism using the
+ * {@link #unmarshal(javax.xml.transform.Source) unmarshal(Source)} API.
+ *
+ * <p>
+ * Since unmarshalling invalid XML content is defined in JAXB 2.0,
+ * the Unmarshaller default validation event handler was made more lenient
+ * than in JAXB 1.0. When schema-derived code generated
+ * by JAXB 1.0 binding compiler is registered with {@link JAXBContext},
+ * the default unmarshal validation handler is
+ * {@link javax.xml.bind.helpers.DefaultValidationEventHandler} and it
+ * terminates the marshal operation after encountering either a fatal error or an error.
+ * For a JAXB 2.0 client application, there is no explicitly defined default
+ * validation handler and the default event handling only
+ * terminates the marshal operation after encountering a fatal error.
+ *
+ * </blockquote>
+ *
+ * <p>
+ * <a name="supportedProps"></a>
+ * <b>Supported Properties</b><br>
+ * <blockquote>
+ * <p>
+ * There currently are not any properties required to be supported by all
+ * JAXB Providers on Unmarshaller. However, some providers may support
+ * their own set of provider specific properties.
+ * </blockquote>
+ *
+ * <p>
+ * <a name="unmarshalEventCallback"></a>
+ * <b>Unmarshal Event Callbacks</b><br>
+ * <blockquote>
+ * The {@link Unmarshaller} provides two styles of callback mechanisms
+ * that allow application specific processing during key points in the
+ * unmarshalling process. In 'class defined' event callbacks, application
+ * specific code placed in JAXB mapped classes is triggered during
+ * unmarshalling. 'External listeners' allow for centralized processing
+ * of unmarshal events in one callback method rather than by type event callbacks.
+ * <p>
+ * 'Class defined' event callback methods allow any JAXB mapped class to specify
+ * its own specific callback methods by defining methods with the following method signature:
+ * <blockquote>
+ * <pre>
+ * // This method is called immediately after the object is created and before the unmarshalling of this
+ * // object begins. The callback provides an opportunity to initialize JavaBean properties prior to unmarshalling.
+ * void beforeUnmarshal(Unmarshaller, Object parent);
+ *
+ * //This method is called after all the properties (except IDREF) are unmarshalled for this object,
+ * //but before this object is set to the parent object.
+ * void afterUnmarshal(Unmarshaller, Object parent);
+ * </pre>
+ * </blockquote>
+ * The class defined callback methods should be used when the callback method requires
+ * access to non-public methods and/or fields of the class.
+ * <p>
+ * The external listener callback mechanism enables the registration of a {@link Listener}
+ * instance with an {@link Unmarshaller#setListener(Listener)}. The external listener receives all callback events,
+ * allowing for more centralized processing than per class defined callback methods. The external listener
+ * receives events when unmarshalling proces is marshalling to a JAXB element or to JAXB mapped class.
+ * <p>
+ * The 'class defined' and external listener event callback methods are independent of each other,
+ * both can be called for one event. The invocation ordering when both listener callback methods exist is
+ * defined in {@link Listener#beforeUnmarshal(Object, Object)} and {@link Listener#afterUnmarshal(Object, Object)}.
+* <p>
+ * An event callback method throwing an exception terminates the current unmarshal process.
+ *
+ * </blockquote>
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$ $Date: 2005/08/18 15:18:26 $
+ * @see JAXBContext
+ * @see Marshaller
+ * @see Validator
+ * @since JAXB1.0
+ */
+public interface Unmarshaller {
+
+ /**
+ * Unmarshal XML data from the specified file and return the resulting
+ * content tree.
+ *
+ * <p>
+ * Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>.
+ *
+ * @param f the file to unmarshal XML data from
+ * @return the newly created root object of the java content tree
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Unmarshaller</tt> is unable to perform the XML to Java
+ * binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+ * @throws IllegalArgumentException
+ * If the file parameter is null
+ */
+ public Object unmarshal( java.io.File f ) throws JAXBException;
+
+ /**
+ * Unmarshal XML data from the specified InputStream and return the
+ * resulting content tree. Validation event location information may
+ * be incomplete when using this form of the unmarshal API.
+ *
+ * <p>
+ * Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>.
+ *
+ * @param is the InputStream to unmarshal XML data from
+ * @return the newly created root object of the java content tree
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Unmarshaller</tt> is unable to perform the XML to Java
+ * binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+ * @throws IllegalArgumentException
+ * If the InputStream parameter is null
+ */
+ public Object unmarshal( java.io.InputStream is ) throws JAXBException;
+
+ /**
+ * Unmarshal XML data from the specified Reader and return the
+ * resulting content tree. Validation event location information may
+ * be incomplete when using this form of the unmarshal API,
+ * because a Reader does not provide the system ID.
+ *
+ * <p>
+ * Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>.
+ *
+ * @param reader the Reader to unmarshal XML data from
+ * @return the newly created root object of the java content tree
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Unmarshaller</tt> is unable to perform the XML to Java
+ * binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+ * @throws IllegalArgumentException
+ * If the InputStream parameter is null
+ * @since JAXB2.0
+ */
+ public Object unmarshal( Reader reader ) throws JAXBException;
+
+ /**
+ * Unmarshal XML data from the specified URL and return the resulting
+ * content tree.
+ *
+ * <p>
+ * Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>.
+ *
+ * @param url the url to unmarshal XML data from
+ * @return the newly created root object of the java content tree
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Unmarshaller</tt> is unable to perform the XML to Java
+ * binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+ * @throws IllegalArgumentException
+ * If the URL parameter is null
+ */
+ public Object unmarshal( java.net.URL url ) throws JAXBException;
+
+ /**
+ * Unmarshal XML data from the specified SAX InputSource and return the
+ * resulting content tree.
+ *
+ * <p>
+ * Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>.
+ *
+ * @param source the input source to unmarshal XML data from
+ * @return the newly created root object of the java content tree
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Unmarshaller</tt> is unable to perform the XML to Java
+ * binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+ * @throws IllegalArgumentException
+ * If the InputSource parameter is null
+ */
+ public Object unmarshal( org.xml.sax.InputSource source ) throws JAXBException;
+
+ /**
+ * Unmarshal global XML data from the specified DOM tree and return the resulting
+ * content tree.
+ *
+ * <p>
+ * Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>.
+ *
+ * @param node
+ * the document/element to unmarshal XML data from.
+ * The caller must support at least Document and Element.
+ * @return the newly created root object of the java content tree
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Unmarshaller</tt> is unable to perform the XML to Java
+ * binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+ * @throws IllegalArgumentException
+ * If the Node parameter is null
+ * @see #unmarshal(org.w3c.dom.Node, Class)
+ */
+ public Object unmarshal( org.w3c.dom.Node node ) throws JAXBException;
+
+ /**
+ * Unmarshal XML data by JAXB mapped <tt>declaredType</tt>
+ * and return the resulting content tree.
+ *
+ * <p>
+ * Implements <a href="#unmarshalByDeclaredType">Unmarshal by Declared Type</a>
+ *
+ * @param node
+ * the document/element to unmarshal XML data from.
+ * The caller must support at least Document and Element.
+ * @param declaredType
+ * appropriate JAXB mapped class to hold <tt>node</tt>'s XML data.
+ *
+ * @return <a href="#unmarshalDeclaredTypeReturn">JAXB Element</a> representation of <tt>node</tt>
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Unmarshaller</tt> is unable to perform the XML to Java
+ * binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+ * @throws IllegalArgumentException
+ * If any parameter is null
+ * @since JAXB2.0
+ */
+ public <T> JAXBElement<T> unmarshal( org.w3c.dom.Node node, Class<T> declaredType ) throws JAXBException;
+
+ /**
+ * Unmarshal XML data from the specified XML Source and return the
+ * resulting content tree.
+ *
+ * <p>
+ * Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>.
+ *
+ * <p>
+ * <a name="saxParserPlugable"></a>
+ * <b>SAX 2.0 Parser Pluggability</b>
+ * <p>
+ * A client application can choose not to use the default parser mechanism
+ * supplied with their JAXB provider. Any SAX 2.0 compliant parser can be
+ * substituted for the JAXB provider's default mechanism. To do so, the
+ * client application must properly configure a <tt>SAXSource</tt> containing
+ * an <tt>XMLReader</tt> implemented by the SAX 2.0 parser provider. If the
+ * <tt>XMLReader</tt> has an <tt>org.xml.sax.ErrorHandler</tt> registered
+ * on it, it will be replaced by the JAXB Provider so that validation errors
+ * can be reported via the <tt>ValidationEventHandler</tt> mechanism of
+ * JAXB. If the <tt>SAXSource</tt> does not contain an <tt>XMLReader</tt>,
+ * then the JAXB provider's default parser mechanism will be used.
+ * <p>
+ * This parser replacement mechanism can also be used to replace the JAXB
+ * provider's unmarshal-time validation engine. The client application
+ * must properly configure their SAX 2.0 compliant parser to perform
+ * validation (as shown in the example above). Any <tt>SAXParserExceptions
+ * </tt> encountered by the parser during the unmarshal operation will be
+ * processed by the JAXB provider and converted into JAXB
+ * <tt>ValidationEvent</tt> objects which will be reported back to the
+ * client via the <tt>ValidationEventHandler</tt> registered with the
+ * <tt>Unmarshaller</tt>. <i>Note:</i> specifying a substitute validating
+ * SAX 2.0 parser for unmarshalling does not necessarily replace the
+ * validation engine used by the JAXB provider for performing on-demand
+ * validation.
+ * <p>
+ * The only way for a client application to specify an alternate parser
+ * mechanism to be used during unmarshal is via the
+ * <tt>unmarshal(SAXSource)</tt> API. All other forms of the unmarshal
+ * method (File, URL, Node, etc) will use the JAXB provider's default
+ * parser and validator mechanisms.
+ *
+ * @param source the XML Source to unmarshal XML data from (providers are
+ * only required to support SAXSource, DOMSource, and StreamSource)
+ * @return the newly created root object of the java content tree
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Unmarshaller</tt> is unable to perform the XML to Java
+ * binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+ * @throws IllegalArgumentException
+ * If the Source parameter is null
+ * @see #unmarshal(javax.xml.transform.Source, Class)
+ */
+ public Object unmarshal( javax.xml.transform.Source source )
+ throws JAXBException;
+
+
+ /**
+ * Unmarshal XML data from the specified XML Source by <tt>declaredType</tt> and return the
+ * resulting content tree.
+ *
+ * <p>
+ * Implements <a href="#unmarshalByDeclaredType">Unmarshal by Declared Type</a>
+ *
+ * <p>
+ * See <a href="#saxParserPlugable">SAX 2.0 Parser Pluggability</a>
+ *
+ * @param source the XML Source to unmarshal XML data from (providers are
+ * only required to support SAXSource, DOMSource, and StreamSource)
+ * @param declaredType
+ * appropriate JAXB mapped class to hold <tt>source</tt>'s xml root element
+ * @return Java content rooted by <a href="#unmarshalDeclaredTypeReturn">JAXB Element</a>
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Unmarshaller</tt> is unable to perform the XML to Java
+ * binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+ * @throws IllegalArgumentException
+ * If any parameter is null
+ * @since JAXB2.0
+ */
+ public <T> JAXBElement<T> unmarshal( javax.xml.transform.Source source, Class<T> declaredType )
+ throws JAXBException;
+
+ /**
+ * Unmarshal XML data from the specified pull parser and return the
+ * resulting content tree.
+ *
+ * <p>
+ * Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>.
+ *
+ * <p>
+ * This method assumes that the parser is on a START_DOCUMENT or
+ * START_ELEMENT event. Unmarshalling will be done from this
+ * start event to the corresponding end event. If this method
+ * returns successfully, the <tt>reader</tt> will be pointing at
+ * the token right after the end event.
+ *
+ * @param reader
+ * The parser to be read.
+ * @return
+ * the newly created root object of the java content tree.
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Unmarshaller</tt> is unable to perform the XML to Java
+ * binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+ * @throws IllegalArgumentException
+ * If the <tt>reader</tt> parameter is null
+ * @throws IllegalStateException
+ * If <tt>reader</tt> is not pointing to a START_DOCUMENT or
+ * START_ELEMENT event.
+ * @since JAXB2.0
+ * @see #unmarshal(javax.xml.stream.XMLStreamReader, Class)
+ */
+ public Object unmarshal( javax.xml.stream.XMLStreamReader reader )
+ throws JAXBException;
+
+ /**
+ * Unmarshal root element to JAXB mapped <tt>declaredType</tt>
+ * and return the resulting content tree.
+ *
+ * <p>
+ * This method implements <a href="unmarshalByDeclaredType">unmarshal by declaredType</a>.
+ * <p>
+ * This method assumes that the parser is on a START_DOCUMENT or
+ * START_ELEMENT event. Unmarshalling will be done from this
+ * start event to the corresponding end event. If this method
+ * returns successfully, the <tt>reader</tt> will be pointing at
+ * the token right after the end event.
+ *
+ * @param reader
+ * The parser to be read.
+ * @param declaredType
+ * appropriate JAXB mapped class to hold <tt>reader</tt>'s START_ELEMENT XML data.
+ *
+ * @return content tree rooted by <a href="#unmarshalDeclaredTypeReturn">JAXB Element representation</a>
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Unmarshaller</tt> is unable to perform the XML to Java
+ * binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+ * @throws IllegalArgumentException
+ * If any parameter is null
+ * @since JAXB2.0
+ */
+ public <T> JAXBElement<T> unmarshal( javax.xml.stream.XMLStreamReader reader, Class<T> declaredType ) throws JAXBException;
+
+ /**
+ * Unmarshal XML data from the specified pull parser and return the
+ * resulting content tree.
+ *
+ * <p>
+ * This method is an <a href="#unmarshalGlobal">Unmarshal Global Root method</a>.
+ *
+ * <p>
+ * This method assumes that the parser is on a START_DOCUMENT or
+ * START_ELEMENT event. Unmarshalling will be done from this
+ * start event to the corresponding end event. If this method
+ * returns successfully, the <tt>reader</tt> will be pointing at
+ * the token right after the end event.
+ *
+ * @param reader
+ * The parser to be read.
+ * @return
+ * the newly created root object of the java content tree.
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Unmarshaller</tt> is unable to perform the XML to Java
+ * binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+ * @throws IllegalArgumentException
+ * If the <tt>reader</tt> parameter is null
+ * @throws IllegalStateException
+ * If <tt>reader</tt> is not pointing to a START_DOCUMENT or
+ * START_ELEMENT event.
+ * @since JAXB2.0
+ * @see #unmarshal(javax.xml.stream.XMLEventReader, Class)
+ */
+ public Object unmarshal( javax.xml.stream.XMLEventReader reader )
+ throws JAXBException;
+
+ /**
+ * Unmarshal root element to JAXB mapped <tt>declaredType</tt>
+ * and return the resulting content tree.
+ *
+ * <p>
+ * This method implements <a href="unmarshalByDeclaredType">unmarshal by declaredType</a>.
+ *
+ * <p>
+ * This method assumes that the parser is on a START_DOCUMENT or
+ * START_ELEMENT event. Unmarshalling will be done from this
+ * start event to the corresponding end event. If this method
+ * returns successfully, the <tt>reader</tt> will be pointing at
+ * the token right after the end event.
+ *
+ * @param reader
+ * The parser to be read.
+ * @param declaredType
+ * appropriate JAXB mapped class to hold <tt>reader</tt>'s START_ELEMENT XML data.
+ *
+ * @return content tree rooted by <a href="#unmarshalDeclaredTypeReturn">JAXB Element representation</a>
+ *
+ * @throws JAXBException
+ * If any unexpected errors occur while unmarshalling
+ * @throws UnmarshalException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Unmarshaller</tt> is unable to perform the XML to Java
+ * binding. See <a href="#unmarshalEx">Unmarshalling XML Data</a>
+ * @throws IllegalArgumentException
+ * If any parameter is null
+ * @since JAXB2.0
+ */
+ public <T> JAXBElement<T> unmarshal( javax.xml.stream.XMLEventReader reader, Class<T> declaredType ) throws JAXBException;
+
+ /**
+ * Get an unmarshaller handler object that can be used as a component in
+ * an XML pipeline.
+ *
+ * <p>
+ * The JAXB Provider can return the same handler object for multiple
+ * invocations of this method. In other words, this method does not
+ * necessarily create a new instance of <tt>UnmarshallerHandler</tt>. If the
+ * application needs to use more than one <tt>UnmarshallerHandler</tt>, it
+ * should create more than one <tt>Unmarshaller</tt>.
+ *
+ * @return the unmarshaller handler object
+ * @see UnmarshallerHandler
+ */
+ public UnmarshallerHandler getUnmarshallerHandler();
+
+ /**
+ * Specifies whether or not the default validation mechanism of the
+ * <tt>Unmarshaller</tt> should validate during unmarshal operations.
+ * By default, the <tt>Unmarshaller</tt> does not validate.
+ * <p>
+ * This method may only be invoked before or after calling one of the
+ * unmarshal methods.
+ * <p>
+ * This method only controls the JAXB Provider's default unmarshal-time
+ * validation mechanism - it has no impact on clients that specify their
+ * own validating SAX 2.0 compliant parser. Clients that specify their
+ * own unmarshal-time validation mechanism may wish to turn off the JAXB
+ * Provider's default validation mechanism via this API to avoid "double
+ * validation".
+ * <p>
+ * This method is deprecated as of JAXB 2.0 - please use the new
+ * {@link #setSchema(javax.xml.validation.Schema)} API.
+ *
+ * @param validating true if the Unmarshaller should validate during
+ * unmarshal, false otherwise
+ * @throws JAXBException if an error occurred while enabling or disabling
+ * validation at unmarshal time
+ * @throws UnsupportedOperationException could be thrown if this method is
+ * invoked on an Unmarshaller created from a JAXBContext referencing
+ * JAXB 2.0 mapped classes
+ * @deprecated since JAXB2.0, please see {@link #setSchema(javax.xml.validation.Schema)}
+ */
+ public void setValidating( boolean validating )
+ throws JAXBException;
+
+ /**
+ * Indicates whether or not the <tt>Unmarshaller</tt> is configured to
+ * validate during unmarshal operations.
+ * <p>
+ * This API returns the state of the JAXB Provider's default unmarshal-time
+ * validation mechanism.
+ * <p>
+ * This method is deprecated as of JAXB 2.0 - please use the new
+ * {@link #getSchema()} API.
+ *
+ * @return true if the Unmarshaller is configured to validate during
+ * unmarshal operations, false otherwise
+ * @throws JAXBException if an error occurs while retrieving the validating
+ * flag
+ * @throws UnsupportedOperationException could be thrown if this method is
+ * invoked on an Unmarshaller created from a JAXBContext referencing
+ * JAXB 2.0 mapped classes
+ * @deprecated since JAXB2.0, please see {@link #getSchema()}
+ */
+ public boolean isValidating()
+ throws JAXBException;
+
+ /**
+ * Allow an application to register a <tt>ValidationEventHandler</tt>.
+ * <p>
+ * The <tt>ValidationEventHandler</tt> will be called by the JAXB Provider
+ * if any validation errors are encountered during calls to any of the
+ * unmarshal methods. If the client application does not register a
+ * <tt>ValidationEventHandler</tt> before invoking the unmarshal methods,
+ * then <tt>ValidationEvents</tt> will be handled by the default event
+ * handler which will terminate the unmarshal operation after the first
+ * error or fatal error is encountered.
+ * <p>
+ * Calling this method with a null parameter will cause the Unmarshaller
+ * to revert back to the default event handler.
+ *
+ * @param handler the validation event handler
+ * @throws JAXBException if an error was encountered while setting the
+ * event handler
+ */
+ public void setEventHandler( ValidationEventHandler handler )
+ throws JAXBException;
+
+ /**
+ * Return the current event handler or the default event handler if one
+ * hasn't been set.
+ *
+ * @return the current ValidationEventHandler or the default event handler
+ * if it hasn't been set
+ * @throws JAXBException if an error was encountered while getting the
+ * current event handler
+ */
+ public ValidationEventHandler getEventHandler()
+ throws JAXBException;
+
+ /**
+ * Set the particular property in the underlying implementation of
+ * <tt>Unmarshaller</tt>. This method can only be used to set one of
+ * the standard JAXB defined properties above or a provider specific
+ * property. Attempting to set an undefined property will result in
+ * a PropertyException being thrown. See <a href="#supportedProps">
+ * Supported Properties</a>.
+ *
+ * @param name the name of the property to be set. This value can either
+ * be specified using one of the constant fields or a user
+ * supplied string.
+ * @param value the value of the property to be set
+ *
+ * @throws PropertyException when there is an error processing the given
+ * property or value
+ * @throws IllegalArgumentException
+ * If the name parameter is null
+ */
+ public void setProperty( String name, Object value )
+ throws PropertyException;
+
+ /**
+ * Get the particular property in the underlying implementation of
+ * <tt>Unmarshaller</tt>. This method can only be used to get one of
+ * the standard JAXB defined properties above or a provider specific
+ * property. Attempting to get an undefined property will result in
+ * a PropertyException being thrown. See <a href="#supportedProps">
+ * Supported Properties</a>.
+ *
+ * @param name the name of the property to retrieve
+ * @return the value of the requested property
+ *
+ * @throws PropertyException
+ * when there is an error retrieving the given property or value
+ * property name
+ * @throws IllegalArgumentException
+ * If the name parameter is null
+ */
+ public Object getProperty( String name ) throws PropertyException;
+
+ /**
+ * Specify the JAXP 1.3 {@link javax.xml.validation.Schema Schema}
+ * object that should be used to validate subsequent unmarshal operations
+ * against. Passing null into this method will disable validation.
+ * <p>
+ * This method replaces the deprecated {@link #setValidating(boolean) setValidating(boolean)}
+ * API.
+ *
+ * <p>
+ * Initially this property is set to <tt>null</tt>.
+ *
+ * @param schema Schema object to validate unmarshal operations against or null to disable validation
+ * @throws UnsupportedOperationException could be thrown if this method is
+ * invoked on an Unmarshaller created from a JAXBContext referencing
+ * JAXB 1.0 mapped classes
+ * @since JAXB2.0
+ */
+ public void setSchema( javax.xml.validation.Schema schema );
+
+ /**
+ * Get the JAXP 1.3 {@link javax.xml.validation.Schema Schema} object
+ * being used to perform unmarshal-time validation. If there is no
+ * Schema set on the unmarshaller, then this method will return null
+ * indicating that unmarshal-time validation will not be performed.
+ * <p>
+ * This method provides replacement functionality for the deprecated
+ * {@link #isValidating()} API as well as access to the Schema object.
+ * To determine if the Unmarshaller has validation enabled, simply
+ * test the return type for null:
+ * <p>
+ * <code>
+ * boolean isValidating = u.getSchema()!=null;
+ * </code>
+ *
+ * @return the Schema object being used to perform unmarshal-time
+ * validation or null if not present
+ * @throws UnsupportedOperationException could be thrown if this method is
+ * invoked on an Unmarshaller created from a JAXBContext referencing
+ * JAXB 1.0 mapped classes
+ * @since JAXB2.0
+ */
+ public javax.xml.validation.Schema getSchema();
+
+ /**
+ * Associates a configured instance of {@link XmlAdapter} with this unmarshaller.
+ *
+ * <p>
+ * This is a convenience method that invokes <code>setAdapter(adapter.getClass(),adapter);</code>.
+ *
+ * @see #setAdapter(Class,XmlAdapter)
+ * @throws IllegalArgumentException
+ * if the adapter parameter is null.
+ * @throws UnsupportedOperationException
+ * if invoked agains a JAXB 1.0 implementation.
+ * @since JAXB2.0
+ */
+ public void setAdapter( XmlAdapter adapter );
+
+ /**
+ * Associates a configured instance of {@link XmlAdapter} with this unmarshaller.
+ *
+ * <p>
+ * Every unmarshaller internally maintains a
+ * {@link java.util.Map}<{@link Class},{@link XmlAdapter}>,
+ * which it uses for unmarshalling classes whose fields/methods are annotated
+ * with {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter}.
+ *
+ * <p>
+ * This method allows applications to use a configured instance of {@link XmlAdapter}.
+ * When an instance of an adapter is not given, an unmarshaller will create
+ * one by invoking its default constructor.
+ *
+ * @param type
+ * The type of the adapter. The specified instance will be used when
+ * {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter#value()}
+ * refers to this type.
+ * @param adapter
+ * The instance of the adapter to be used. If null, it will un-register
+ * the current adapter set for this type.
+ * @throws IllegalArgumentException
+ * if the type parameter is null.
+ * @throws UnsupportedOperationException
+ * if invoked agains a JAXB 1.0 implementation.
+ * @since JAXB2.0
+ */
+ public <A extends XmlAdapter> void setAdapter( Class<A> type, A adapter );
+
+ /**
+ * Gets the adapter associated with the specified type.
+ *
+ * This is the reverse operation of the {@link #setAdapter} method.
+ *
+ * @throws IllegalArgumentException
+ * if the type parameter is null.
+ * @throws UnsupportedOperationException
+ * if invoked agains a JAXB 1.0 implementation.
+ * @since JAXB2.0
+ */
+ public <A extends XmlAdapter> A getAdapter( Class<A> type );
+
+ /**
+ * <p>Associate a context that resolves cid's, content-id URIs, to
+ * binary data passed as attachments.</p>
+ * <p/>
+ * <p>Unmarshal time validation, enabled via {@link #setSchema(Schema)},
+ * must be supported even when unmarshaller is performing XOP processing.
+ * </p>
+ *
+ * @throws IllegalStateException if attempt to concurrently call this
+ * method during a unmarshal operation.
+ */
+ void setAttachmentUnmarshaller(AttachmentUnmarshaller au);
+
+ AttachmentUnmarshaller getAttachmentUnmarshaller();
+
+ /**
+ * <p/>
+ * Register an instance of an implementation of this class with {@link Unmarshaller} to externally listen
+ * for unmarshal events.
+ * <p/>
+ * <p/>
+ * This class enables pre and post processing of an instance of a JAXB mapped class
+ * as XML data is unmarshalled into it. The event callbacks are called when unmarshalling
+ * XML content into a JAXBElement instance or a JAXB mapped class that represents a complex type definition.
+ * The event callbacks are not called when unmarshalling to an instance of a
+ * Java datatype that represents a simple type definition.
+ * <p/>
+ * <p/>
+ * External listener is one of two different mechanisms for defining unmarshal event callbacks.
+ * See <a href="Unmarshaller.html#unmarshalEventCallback">Unmarshal Event Callbacks</a> for an overview.
+ * <p/>
+ * (@link #setListener(Listener)}
+ * (@link #getListener()}
+ *
+ * @since JAXB2.0
+ */
+ public static abstract class Listener {
+ /**
+ * <p/>
+ * Callback method invoked before unmarshalling into <tt>target</tt>.
+ * <p/>
+ * <p/>
+ * This method is invoked immediately after <tt>target</tt> was created and
+ * before the unmarshalling of this object begins. Note that
+ * if the class of <tt>target</tt> defines its own <tt>beforeUnmarshal</tt> method,
+ * the class specific callback method is invoked before this method is invoked.
+ *
+ * @param target non-null instance of JAXB mapped class prior to unmarshalling into it.
+ * @param parent instance of JAXB mapped class that will eventually reference <tt>target</tt>.
+ * <tt>null</tt> when <tt>target</tt> is root element.
+ */
+ public void beforeUnmarshal(Object target, Object parent) {
+ }
+
+ /**
+ * <p/>
+ * Callback method invoked after unmarshalling XML data into <tt>target</tt>.
+ * <p/>
+ * <p/>
+ * This method is invoked after all the properties (except IDREF) are unmarshalled into <tt>target</tt>,
+ * but before <tt>target</tt> is set into its <tt>parent</tt> object.
+ * Note that if the class of <tt>target</tt> defines its own <tt>afterUnmarshal</tt> method,
+ * the class specific callback method is invoked before this method is invoked.
+ *
+ * @param target non-null instance of JAXB mapped class prior to unmarshalling into it.
+ * @param parent instance of JAXB mapped class that will reference <tt>target</tt>.
+ * <tt>null</tt> when <tt>target</tt> is root element.
+ */
+ public void afterUnmarshal(Object target, Object parent) {
+ }
+ }
+
+ /**
+ * <p>
+ * Register unmarshal event callback {@link Listener} with this {@link Unmarshaller}.
+ *
+ * <p>
+ * There is only one Listener per Unmarshaller. Setting a Listener replaces the previous set Listener.
+ * One can unregister current Listener by setting listener to <tt>null</tt>.
+ *
+ * @param listener provides unmarshal event callbacks for this {@link Unmarshaller}
+ * @since JAXB2.0
+ */
+ public void setListener(Listener listener);
+
+ /**
+ * <p>Return {@link Listener} registered with this {@link Unmarshaller}.
+ *
+ * @return registered {@link Listener} or <code>null</code> if no Listener is registered with this Unmarshaller.
+ * @since JAXB2.0
+ */
+ public Listener getListener();
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Unmarshaller.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/UnmarshallerHandler.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/UnmarshallerHandler.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/UnmarshallerHandler.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+package javax.xml.bind;
+
+import org.xml.sax.ContentHandler;
+
+/**
+ * Unmarshaller implemented as SAX ContentHandler.
+ *
+ * <p>
+ * Applications can use this interface to use their JAXB provider as a component
+ * in an XML pipeline. For example:
+ *
+ * <pre>
+ * JAXBContext context = JAXBContext.newInstance( "org.acme.foo" );
+ *
+ * Unmarshaller unmarshaller = context.createUnmarshaller();
+ *
+ * UnmarshallerHandler unmarshallerHandler = unmarshaller.getUnmarshallerHandler();
+ *
+ * SAXParserFactory spf = SAXParserFactory.newInstance();
+ * spf.setNamespaceAware( true );
+ *
+ * XMLReader xmlReader = spf.newSAXParser().getXMLReader();
+ * xmlReader.setContentHandler( unmarshallerHandler );
+ * xmlReader.parse(new InputSource( new FileInputStream( XML_FILE ) ) );
+ *
+ * MyObject myObject= (MyObject)unmarshallerHandler.getResult();
+ * </pre>
+ *
+ * <p>
+ * This interface is reusable: even if the user fails to unmarshal
+ * an object, s/he can still start a new round of unmarshalling.
+ *
+ * @author <ul><li>Kohsuke KAWAGUCHI, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$ $Date: 2006/03/08 16:55:17 $
+ * @see Unmarshaller#getUnmarshallerHandler()
+ * @since JAXB1.0
+ */
+public interface UnmarshallerHandler extends ContentHandler
+{
+ /**
+ * Obtains the unmarshalled result.
+ *
+ * This method can be called only after this handler
+ * receives the endDocument SAX event.
+ *
+ * @exception IllegalStateException
+ * if this method is called before this handler
+ * receives the endDocument event.
+ *
+ * @exception JAXBException
+ * if there is any unmarshalling error.
+ * Note that the implementation is allowed to throw SAXException
+ * during the parsing when it finds an error.
+ *
+ * @return
+ * always return a non-null valid object which was unmarshalled.
+ */
+ Object getResult() throws JAXBException, IllegalStateException;
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/UnmarshallerHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ValidationEvent.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ValidationEvent.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ValidationEvent.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+/**
+ * This event indicates that a problem was encountered while validating the
+ * incoming XML data during an unmarshal operation, while performing
+ * on-demand validation of the Java content tree, or while marshalling the
+ * Java content tree back to XML data.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$
+ * @see Validator
+ * @see ValidationEventHandler
+ * @since JAXB1.0
+ */
+public interface ValidationEvent {
+
+ /**
+ * Conditions that are not errors or fatal errors as defined by the
+ * XML 1.0 recommendation
+ */
+ public static final int WARNING = 0;
+
+ /**
+ * Conditions that correspond to the definition of "error" in section
+ * 1.2 of the W3C XML 1.0 Recommendation
+ */
+ public static final int ERROR = 1;
+
+ /**
+ * Conditions that correspond to the definition of "fatal error" in section
+ * 1.2 of the W3C XML 1.0 Recommendation
+ */
+ public static final int FATAL_ERROR = 2;
+
+ /**
+ * Retrieve the severity code for this warning/error.
+ *
+ * <p>
+ * Must be one of <tt>ValidationError.WARNING</tt>,
+ * <tt>ValidationError.ERROR</tt>, or <tt>ValidationError.FATAL_ERROR</tt>.
+ *
+ * @return the severity code for this warning/error
+ */
+ public int getSeverity();
+
+ /**
+ * Retrieve the text message for this warning/error.
+ *
+ * @return the text message for this warning/error or null if one wasn't set
+ */
+ public String getMessage();
+
+ /**
+ * Retrieve the linked exception for this warning/error.
+ *
+ * @return the linked exception for this warning/error or null if one
+ * wasn't set
+ */
+ public Throwable getLinkedException();
+
+ /**
+ * Retrieve the locator for this warning/error.
+ *
+ * @return the locator that indicates where the warning/error occurred
+ */
+ public ValidationEventLocator getLocator();
+
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ValidationEvent.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ValidationEventHandler.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ValidationEventHandler.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ValidationEventHandler.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+/**
+ * A basic event handler interface for validation errors.
+ *
+ * <p>
+ * If an application needs to implement customized event handling, it must
+ * implement this interface and then register it with either the
+ * {@link Unmarshaller#setEventHandler(ValidationEventHandler) Unmarshaller},
+ * the {@link Validator#setEventHandler(ValidationEventHandler) Validator}, or
+ * the {@link Marshaller#setEventHandler(ValidationEventHandler) Marshaller}.
+ * The JAXB Provider will then report validation errors and warnings encountered
+ * during the unmarshal, marshal, and validate operations to these event
+ * handlers.
+ *
+ * <p>
+ * If the <tt>handleEvent</tt> method throws an unchecked runtime exception,
+ * the JAXB Provider must treat that as if the method returned false, effectively
+ * terminating whatever operation was in progress at the time (unmarshal,
+ * validate, or marshal).
+ *
+ * <p>
+ * Modifying the Java content tree within your event handler is undefined
+ * by the specification and may result in unexpected behaviour.
+ *
+ * <p>
+ * Failing to return false from the <tt>handleEvent</tt> method after
+ * encountering a fatal error is undefined by the specification and may result
+ * in unexpected behavior.
+ *
+ * <p>
+ * <b>Default Event Handler</b>
+ * <blockquote>
+ * See: <a href="Validator.html#defaulthandler">Validator javadocs</a>
+ * </blockquote>
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$
+ * @see Unmarshaller
+ * @see Validator
+ * @see Marshaller
+ * @see ValidationEvent
+ * @see javax.xml.bind.util.ValidationEventCollector
+ * @since JAXB1.0
+ */
+public interface ValidationEventHandler {
+ /**
+ * Receive notification of a validation warning or error.
+ *
+ * The ValidationEvent will have a
+ * {@link ValidationEventLocator ValidationEventLocator} embedded in it that
+ * indicates where the error or warning occurred.
+ *
+ * <p>
+ * If an unchecked runtime exception is thrown from this method, the JAXB
+ * provider will treat it as if the method returned false and interrupt
+ * the current unmarshal, validate, or marshal operation.
+ *
+ * @param event the encapsulated validation event information. It is a
+ * provider error if this parameter is null.
+ * @return true if the JAXB Provider should attempt to continue the current
+ * unmarshal, validate, or marshal operation after handling this
+ * warning/error, false if the provider should terminate the current
+ * operation with the appropriate <tt>UnmarshalException</tt>,
+ * <tt>ValidationException</tt>, or <tt>MarshalException</tt>.
+ * @throws IllegalArgumentException if the event object is null.
+ */
+ public boolean handleEvent( ValidationEvent event );
+
+}
+
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ValidationEventHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ValidationEventLocator.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ValidationEventLocator.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ValidationEventLocator.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+/**
+ * Encapsulate the location of a ValidationEvent.
+ *
+ * <p>
+ * The <tt>ValidationEventLocator</tt> indicates where the <tt>ValidationEvent
+ * </tt> occurred. Different fields will be set depending on the type of
+ * validation that was being performed when the error or warning was detected.
+ * For example, on-demand validation would produce locators that contained
+ * references to objects in the Java content tree while unmarshal-time
+ * validation would produce locators containing information appropriate to the
+ * source of the XML data (file, url, Node, etc).
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$
+ * @see Validator
+ * @see ValidationEvent
+ * @since JAXB1.0
+ */
+public interface ValidationEventLocator {
+
+ /**
+ * Return the name of the XML source as a URL if available
+ *
+ * @return the name of the XML source as a URL or null if unavailable
+ */
+ public java.net.URL getURL();
+
+ /**
+ * Return the byte offset if available
+ *
+ * @return the byte offset into the input source or -1 if unavailable
+ */
+ public int getOffset();
+
+ /**
+ * Return the line number if available
+ *
+ * @return the line number or -1 if unavailable
+ */
+ public int getLineNumber();
+
+ /**
+ * Return the column number if available
+ *
+ * @return the column number or -1 if unavailable
+ */
+ public int getColumnNumber();
+
+ /**
+ * Return a reference to the object in the Java content tree if available
+ *
+ * @return a reference to the object in the Java content tree or null if
+ * unavailable
+ */
+ public java.lang.Object getObject();
+
+ /**
+ * Return a reference to the DOM Node if available
+ *
+ * @return a reference to the DOM Node or null if unavailable
+ */
+ public org.w3c.dom.Node getNode();
+
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ValidationEventLocator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ValidationException.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ValidationException.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ValidationException.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+/**
+ * This exception indicates that an error has occurred while performing
+ * a validate operation.
+ *
+ * <p>
+ * The <tt>ValidationEventHandler</tt> can cause this exception to be thrown
+ * during the validate operations. See
+ * {@link ValidationEventHandler#handleEvent(ValidationEvent)
+ * ValidationEventHandler.handleEvent(ValidationEvent)}.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$
+ * @see JAXBException
+ * @see Validator
+ * @since JAXB1.0
+ */
+public class ValidationException extends JAXBException {
+
+ /**
+ * Construct an ValidationException with the specified detail message. The
+ * errorCode and linkedException will default to null.
+ *
+ * @param message a description of the exception
+ */
+ public ValidationException(String message) {
+ this( message, null, null );
+ }
+
+ /**
+ * Construct an ValidationException with the specified detail message and vendor
+ * specific errorCode. The linkedException will default to null.
+ *
+ * @param message a description of the exception
+ * @param errorCode a string specifying the vendor specific error code
+ */
+ public ValidationException(String message, String errorCode) {
+ this( message, errorCode, null );
+ }
+
+ /**
+ * Construct an ValidationException with a linkedException. The detail message and
+ * vendor specific errorCode will default to null.
+ *
+ * @param exception the linked exception
+ */
+ public ValidationException(Throwable exception) {
+ this( null, null, exception );
+ }
+
+ /**
+ * Construct an ValidationException with the specified detail message and
+ * linkedException. The errorCode will default to null.
+ *
+ * @param message a description of the exception
+ * @param exception the linked exception
+ */
+ public ValidationException(String message, Throwable exception) {
+ this( message, null, exception );
+ }
+
+ /**
+ * Construct an ValidationException with the specified detail message, vendor
+ * specific errorCode, and linkedException.
+ *
+ * @param message a description of the exception
+ * @param errorCode a string specifying the vendor specific error code
+ * @param exception the linked exception
+ */
+ public ValidationException(String message, String errorCode, Throwable exception) {
+ super( message, errorCode, exception );
+ }
+
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/ValidationException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Validator.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Validator.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Validator.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,266 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind;
+
+/**
+ * As of JAXB 2.0, this class is deprecated and optional.
+ * <p>
+ * The <tt>Validator</tt> class is responsible for controlling the validation
+ * of content trees during runtime.
+ *
+ * <p>
+ * <a name="validationtypes"></a>
+ * <b>Three Forms of Validation</b><br>
+ * <blockquote>
+ * <dl>
+ * <dt><b>Unmarshal-Time Validation</b></dt>
+ * <dd>This form of validation enables a client application to receive
+ * information about validation errors and warnings detected while
+ * unmarshalling XML data into a Java content tree and is completely
+ * orthogonal to the other types of validation. To enable or disable
+ * it, see the javadoc for
+ * {@link Unmarshaller#setValidating(boolean) Unmarshaller.setValidating}.
+ * All JAXB 1.0 Providers are required to support this operation.
+ * </dd>
+ *
+ * <dt><b>On-Demand Validation</b></dt>
+ * <dd> This form of validation enables a client application to receive
+ * information about validation errors and warnings detected in the
+ * Java content tree. At any point, client applications can call
+ * the {@link Validator#validate(Object) Validator.validate} method
+ * on the Java content tree (or any sub-tree of it). All JAXB 1.0
+ * Providers are required to support this operation.
+ * </dd>
+ *
+ * <dt><b>Fail-Fast Validation</b></dt>
+ * <dd> This form of validation enables a client application to receive
+ * immediate feedback about modifications to the Java content tree
+ * that violate type constraints on Java Properties as defined in
+ * the specification. JAXB Providers are not required support
+ * this type of validation. Of the JAXB Providers that do support
+ * this type of validation, some may require you to decide at schema
+ * compile time whether or not a client application will be allowed
+ * to request fail-fast validation at runtime.
+ * </dd>
+ * </dl>
+ * </blockquote>
+ *
+ * <p>
+ * The <tt>Validator</tt> class is responsible for managing On-Demand Validation.
+ * The <tt>Unmarshaller</tt> class is responsible for managing Unmarshal-Time
+ * Validation during the unmarshal operations. Although there is no formal
+ * method of enabling validation during the marshal operations, the
+ * <tt>Marshaller</tt> may detect errors, which will be reported to the
+ * <tt>ValidationEventHandler</tt> registered on it.
+ *
+ * <p>
+ * <a name="defaulthandler"></a>
+ * <b>Using the Default EventHandler</b><br>
+ * <blockquote>
+ * If the client application does not set an event handler on their
+ * <tt>Validator</tt>, <tt>Unmarshaller</tt>, or <tt>Marshaller</tt> prior to
+ * calling the validate, unmarshal, or marshal methods, then a default event
+ * handler will receive notification of any errors or warnings encountered.
+ * The default event handler will cause the current operation to halt after
+ * encountering the first error or fatal error (but will attempt to continue
+ * after receiving warnings).
+ * </blockquote>
+ *
+ * <p>
+ * <a name="handlingevents"></a>
+ * <b>Handling Validation Events</b><br>
+ * <blockquote>
+ * There are three ways to handle events encountered during the unmarshal,
+ * validate, and marshal operations:
+ * <dl>
+ * <dt>Use the default event handler</dt>
+ * <dd>The default event handler will be used if you do not specify one
+ * via the <tt>setEventHandler</tt> API's on <tt>Validator</tt>,
+ * <tt>Unmarshaller</tt>, or <tt>Marshaller</tt>.
+ * </dd>
+ *
+ * <dt>Implement and register a custom event handler</dt>
+ * <dd>Client applications that require sophisticated event processing
+ * can implement the <tt>ValidationEventHandler</tt> interface and
+ * register it with the <tt>Unmarshaller</tt> and/or
+ * <tt>Validator</tt>.
+ * </dd>
+ *
+ * <dt>Use the {@link javax.xml.bind.util.ValidationEventCollector ValidationEventCollector}
+ * utility</dt>
+ * <dd>For convenience, a specialized event handler is provided that
+ * simply collects any <tt>ValidationEvent</tt> objects created
+ * during the unmarshal, validate, and marshal operations and
+ * returns them to the client application as a
+ * <tt>java.util.Collection</tt>.
+ * </dd>
+ * </dl>
+ * </blockquote>
+ *
+ * <p>
+ * <b>Validation and Well-Formedness</b><br>
+ * <blockquote>
+ * <p>
+ * Validation events are handled differently depending on how the client
+ * application is configured to process them as described in the previous
+ * section. However, there are certain cases where a JAXB Provider indicates
+ * that it is no longer able to reliably detect and report errors. In these
+ * cases, the JAXB Provider will set the severity of the ValidationEvent to
+ * FATAL_ERROR to indicate that the unmarshal, validate, or marshal operations
+ * should be terminated. The default event handler and
+ * <tt>ValidationEventCollector</tt> utility class must terminate processing
+ * after being notified of a fatal error. Client applications that supply their
+ * own <tt>ValidationEventHandler</tt> should also terminate processing after
+ * being notified of a fatal error. If not, unexpected behaviour may occur.
+ * </blockquote>
+ *
+ * <p>
+ * <a name="supportedProps"></a>
+ * <b>Supported Properties</b><br>
+ * <blockquote>
+ * <p>
+ * There currently are not any properties required to be supported by all
+ * JAXB Providers on Validator. However, some providers may support
+ * their own set of provider specific properties.
+ * </blockquote>
+ *
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$ $Date: 2005/07/29 20:56:02 $
+ * @see JAXBContext
+ * @see Unmarshaller
+ * @see ValidationEventHandler
+ * @see ValidationEvent
+ * @see javax.xml.bind.util.ValidationEventCollector
+ * @since JAXB1.0
+ * @deprecated since JAXB 2.0
+ */
+public interface Validator {
+
+ /**
+ * Allow an application to register a validation event handler.
+ * <p>
+ * The validation event handler will be called by the JAXB Provider if any
+ * validation errors are encountered during calls to
+ * {@link #validate(Object) validate}. If the client application does not
+ * register a validation event handler before invoking the validate method,
+ * then validation events will be handled by the default event handler which
+ * will terminate the validate operation after the first error or fatal error
+ * is encountered.
+ * <p>
+ * Calling this method with a null parameter will cause the Validator
+ * to revert back to the default default event handler.
+ *
+ * @param handler the validation event handler
+ * @throws JAXBException if an error was encountered while setting the
+ * event handler
+ * @deprecated since JAXB2.0
+ */
+ public void setEventHandler( ValidationEventHandler handler )
+ throws JAXBException;
+
+ /**
+ * Return the current event handler or the default event handler if one
+ * hasn't been set.
+ *
+ * @return the current ValidationEventHandler or the default event handler
+ * if it hasn't been set
+ * @throws JAXBException if an error was encountered while getting the
+ * current event handler
+ * @deprecated since JAXB2.0
+ */
+ public ValidationEventHandler getEventHandler()
+ throws JAXBException;
+
+ /**
+ * Validate the Java content tree starting at <tt>subrootObj</tt>.
+ * <p>
+ * Client applications can use this method to validate Java content trees
+ * on-demand at runtime. This method can be used to validate any arbitrary
+ * subtree of the Java content tree. Global constraint checking <b>will not
+ * </b> be performed as part of this operation (i.e. ID/IDREF constraints).
+ *
+ * @param subrootObj the obj to begin validation at
+ * @throws JAXBException if any unexpected problem occurs during validation
+ * @throws ValidationException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Validator</tt> is unable to validate the content tree rooted
+ * at <tt>subrootObj</tt>
+ * @throws IllegalArgumentException
+ * If the subrootObj parameter is null
+ * @return true if the subtree rooted at <tt>subrootObj</tt> is valid, false
+ * otherwise
+ * @deprecated since JAXB2.0
+ */
+ public boolean validate( Object subrootObj ) throws JAXBException;
+
+ /**
+ * Validate the Java content tree rooted at <tt>rootObj</tt>.
+ * <p>
+ * Client applications can use this method to validate Java content trees
+ * on-demand at runtime. This method is used to validate an entire Java
+ * content tree. Global constraint checking <b>will</b> be performed as
+ * part of this operation (i.e. ID/IDREF constraints).
+ *
+ * @param rootObj the root obj to begin validation at
+ * @throws JAXBException if any unexpected problem occurs during validation
+ * @throws ValidationException
+ * If the {@link ValidationEventHandler ValidationEventHandler}
+ * returns false from its <tt>handleEvent</tt> method or the
+ * <tt>Validator</tt> is unable to validate the content tree rooted
+ * at <tt>rootObj</tt>
+ * @throws IllegalArgumentException
+ * If the rootObj parameter is null
+ * @return true if the tree rooted at <tt>rootObj</tt> is valid, false
+ * otherwise
+ * @deprecated since JAXB2.0
+ */
+ public boolean validateRoot( Object rootObj ) throws JAXBException;
+
+ /**
+ * Set the particular property in the underlying implementation of
+ * <tt>Validator</tt>. This method can only be used to set one of
+ * the standard JAXB defined properties above or a provider specific
+ * property. Attempting to set an undefined property will result in
+ * a PropertyException being thrown. See <a href="#supportedProps">
+ * Supported Properties</a>.
+ *
+ * @param name the name of the property to be set. This value can either
+ * be specified using one of the constant fields or a user
+ * supplied string.
+ * @param value the value of the property to be set
+ *
+ * @throws PropertyException when there is an error processing the given
+ * property or value
+ * @throws IllegalArgumentException
+ * If the name parameter is null
+ * @deprecated since JAXB2.0
+ */
+ public void setProperty( String name, Object value )
+ throws PropertyException;
+
+ /**
+ * Get the particular property in the underlying implementation of
+ * <tt>Validator</tt>. This method can only be used to get one of
+ * the standard JAXB defined properties above or a provider specific
+ * property. Attempting to get an undefined property will result in
+ * a PropertyException being thrown. See <a href="#supportedProps">
+ * Supported Properties</a>.
+ *
+ * @param name the name of the property to retrieve
+ * @return the value of the requested property
+ *
+ * @throws PropertyException
+ * when there is an error retrieving the given property or value
+ * property name
+ * @throws IllegalArgumentException
+ * If the name parameter is null
+ * @deprecated since JAXB2.0
+ */
+ public Object getProperty( String name ) throws PropertyException;
+
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/Validator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/DomHandler.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/DomHandler.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/DomHandler.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import javax.xml.bind.ValidationEventHandler;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+
+/**
+ * Converts an element (and its descendants)
+ * from/to DOM (or similar) representation.
+ *
+ * <p>
+ * Implementations of this interface will be used in conjunction with
+ * {@link XmlAnyElement} annotation to map an element of XML into a representation
+ * of infoset such as W3C DOM.
+ *
+ * <p>
+ * Implementations hide how a portion of XML is converted into/from such
+ * DOM-like representation, allowing JAXB providers to work with arbitrary
+ * such library.
+ *
+ * <P>
+ * This interface is intended to be implemented by library writers
+ * and consumed by JAXB providers. None of those methods are intended to
+ * be called from applications.
+ *
+ * @author Kohsuke Kawaguchi
+ * @since JAXB2.0
+ */
+public interface DomHandler<ElementT,ResultT extends Result> {
+ /**
+ * When a JAXB provider needs to unmarshal a part of a document into an
+ * infoset representation, it first calls this method to create a
+ * {@link Result} object.
+ *
+ * <p>
+ * A JAXB provider will then send a portion of the XML
+ * into the given result. Such a portion always form a subtree
+ * of the whole XML document rooted at an element.
+ *
+ * @param errorHandler
+ * if any error happens between the invocation of this method
+ * and the invocation of {@link #getElement(Result)}, they
+ * must be reported to this handler.
+ *
+ * The caller must provide a non-null error handler.
+ *
+ * The {@link Result} object created from this method
+ * may hold a reference to this error handler.
+ *
+ * @return
+ * null if the operation fails. The error must have been reported
+ * to the error handler.
+ */
+ ResultT createUnmarshaller( ValidationEventHandler errorHandler );
+
+ /**
+ * Once the portion is sent to the {@link Result}. This method is called
+ * by a JAXB provider to obtain the unmarshalled element representation.
+ *
+ * <p>
+ * Multiple invocations of this method may return different objects.
+ * This method can be invoked only when the whole sub-tree are fed
+ * to the {@link Result} object.
+ *
+ * @param rt
+ * The {@link Result} object created by {@link #createUnmarshaller(ValidationEventHandler)}.
+ *
+ * @return
+ * null if the operation fails. The error must have been reported
+ * to the error handler.
+ */
+ ElementT getElement(ResultT rt);
+
+ /**
+ * This method is called when a JAXB provider needs to marshal an element
+ * to XML.
+ *
+ * <p>
+ * If non-null, the returned {@link Source} must contain a whole document
+ * rooted at one element, which will then be weaved into a bigger document
+ * that the JAXB provider is marshalling.
+ *
+ * @param errorHandler
+ * Receives any errors happened during the process of converting
+ * an element into a {@link Source}.
+ *
+ * The caller must provide a non-null error handler.
+ *
+ * @return
+ * null if there was an error. The error should have been reported
+ * to the handler.
+ */
+ Source marshal( ElementT n, ValidationEventHandler errorHandler );
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/DomHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/W3CDomHandler.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/W3CDomHandler.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/W3CDomHandler.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+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;
+
+/**
+ * {@link DomHandler} implementation for W3C DOM (<code>org.w3c.dom</code> package.)
+ *
+ * @author Kohsuke Kawaguchi
+ * @since JAXB2.0
+ */
+public class W3CDomHandler implements DomHandler<Element,DOMResult> {
+
+ private DocumentBuilder builder;
+
+ /**
+ * Default constructor.
+ *
+ * It is up to a JAXB provider to decide which DOM implementation
+ * to use or how that is configured.
+ */
+ public W3CDomHandler() {
+ this.builder = null;
+ }
+
+ /**
+ * Constructor that allows applications to specify which DOM implementation
+ * to be used.
+ *
+ * @param builder
+ * must not be null. JAXB uses this {@link DocumentBuilder} to create
+ * a new element.
+ */
+ public W3CDomHandler(DocumentBuilder builder) {
+ if(builder==null)
+ throw new IllegalArgumentException();
+ this.builder = builder;
+ }
+
+ public DocumentBuilder getBuilder() {
+ return builder;
+ }
+
+ public void setBuilder(DocumentBuilder builder) {
+ this.builder = builder;
+ }
+
+ public DOMResult createUnmarshaller(ValidationEventHandler errorHandler) {
+ if(builder==null)
+ return new DOMResult();
+ else
+ return new DOMResult(builder.newDocument());
+ }
+
+ public Element getElement(DOMResult r) {
+ // JAXP spec is ambiguous about what really happens in this case,
+ // so work defensively
+ Node n = r.getNode();
+ if( n instanceof Document ) {
+ return ((Document)n).getDocumentElement();
+ }
+ if( n instanceof Element )
+ return (Element)n;
+ if( n instanceof DocumentFragment )
+ return (Element)n.getChildNodes().item(0);
+
+ // if the result object contains something strange,
+ // it is not a user problem, but it is a JAXB provider's problem.
+ // That's why we throw a runtime exception.
+ throw new IllegalStateException(n.toString());
+ }
+
+ public Source marshal(Element element, ValidationEventHandler errorHandler) {
+ return new DOMSource(element);
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/W3CDomHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAccessOrder.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAccessOrder.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAccessOrder.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+/**
+ * Used by XmlAccessorOrder to control the ordering of properties and
+ * fields in a JAXB bound class.
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since JAXB2.0
+ * @version $Revision$
+ * @see XmlAccessorOrder
+ */
+
+public enum XmlAccessOrder {
+ /**
+ * The ordering of fields and properties in a class is undefined.
+ */
+ UNDEFINED,
+ /**
+ * The ordering of fields and properties in a class is in
+ * alphabetical order as determined by the
+ * method java.lang.String.compareTo(String anotherString).
+ */
+ ALPHABETICAL
+}
+
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAccessOrder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAccessType.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAccessType.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAccessType.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+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$
+ * @see XmlAccessorType
+ */
+
+public enum XmlAccessType {
+ /**
+ * Every getter/setter pair in a JAXB-bound class will be automatically
+ * bound to XML, unless annotated by {@link XmlTransient}.
+ *
+ * Fields are bound to XML only when they are explicitly annotated
+ * by some of the JAXB annotations.
+ */
+ PROPERTY,
+ /**
+ * Every non static, non transient field in a JAXB-bound class will be automatically
+ * bound to XML, unless annotated by {@link XmlTransient}.
+ *
+ * Getter/setter pairs are bound to XML only when they are explicitly annotated
+ * by some of the JAXB annotations.
+ */
+ FIELD,
+ /**
+ * Every public getter/setter pair and every public field will be
+ * automatically bound to XML, unless annotated by {@link XmlTransient}.
+ *
+ * Fields or getter/setter pairs that are private, protected, or
+ * defaulted to package-only access are bound to XML only when they are
+ * explicitly annotated by the appropriate JAXB annotations.
+ */
+ PUBLIC_MEMBER,
+ /**
+ * None of the fields or properties is bound to XML unless they
+ * are specifically annotated with some of the JAXB annotations.
+ */
+ NONE
+}
+
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAccessType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAccessorOrder.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAccessorOrder.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAccessorOrder.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Inherited;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * <p> Controls the ordering of fields and properties in a class. </p>
+ *
+ * <p> <b> Usage </b> </p>
+ *
+ * <p> <tt> @XmlAccessorOrder </tt> annotation can be used with the following
+ * program elements:</p>
+ *
+ * <ul>
+ * <li> package</li>
+ * <li> a top level class </li>
+ * </ul>
+ *
+ * <p> See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <p>The annotation <tt> @XmlAccessorOrder </tt> on a package applies to
+ * all classes in a package. The following inheritance semantics apply:
+ *
+ * <ul>
+ * <li> If there is a <tt>@XmlAccessorOrder</tt> on a class, then
+ * it is used. </li>
+ * <li> Otherwise, if a <tt>@XmlAccessorOrder </tt> exists on one of
+ * its super classes, then it is inherited.
+ * <li> Otherwise, the <tt>@XmlAccessorOrder </tt> on a package is
+ * inherited.
+ * </ul>
+ * <p> <b> Defaulting Rules: </b> </p>
+ *
+ * <p>By default, if <tt>@XmlAccessorOrder </tt> on a package is absent,
+ * then the following package level annotation is assumed.</p>
+ *<pre>
+ * @XmlAccessorType(XmlAccessOrder.UNDEFINED)
+ *</pre>
+ * <p> By default, if <tt>@XmlAccessorOrder</tt> on a class is absent
+ * and none of super classes is annotated with <tt> XmlAccessorOrder
+ * </tt>, then the following default on the class is assumed: </p>
+ *<pre>
+ * @XmlAccessorType(XmlAccessOrder.UNDEFINED)
+ *</pre>
+ * <p>This annotation can be used with the following annotations:
+ * {@link XmlType}, {@link XmlRootElement}, {@link XmlAccessorType},
+ * {@link XmlSchema}, {@link XmlSchemaType}, {@link XmlSchemaTypes},
+ * , {@link XmlJavaTypeAdapter}. It can also be used with the
+ * following annotations at the package level: {@link XmlJavaTypeAdapter}.
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since JAXB2.0
+ * @version $Revision$
+ * @see XmlAccessOrder
+ */
+
+ at Inherited @Retention(RUNTIME) @Target({PACKAGE, TYPE})
+public @interface XmlAccessorOrder {
+ XmlAccessOrder value() default XmlAccessOrder.UNDEFINED;
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAccessorOrder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Inherited;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * <p> Controls whether fields or Javabean properties are serialized by default. </p>
+ *
+ * <p> <b> Usage </b> </p>
+ *
+ * <p> <tt>@XmlAccessorType</tt> annotation can be used with the following program elements:</p>
+ *
+ * <ul>
+ * <li> package</li>
+ * <li> a top level class </li>
+ * </ul>
+ *
+ * <p> See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <p>This annotation provides control over the default serialization
+ * of properties and fields in a class.
+ *
+ * <p>The annotation <tt> @XmlAccessorType </tt> on a package applies to
+ * all classes in the package. The following inheritance
+ * semantics apply:
+ *
+ * <ul>
+ * <li> If there is a <tt>@XmlAccessorType</tt> on a class, then it
+ * is used. </li>
+ * <li> Otherwise, if a <tt>@XmlAccessorType</tt> exists on one of
+ * its super classes, then it is inherited.
+ * <li> Otherwise, the <tt>@XmlAccessorType </tt> on a package is
+ * inherited.
+ * </ul>
+ * <p> <b> Defaulting Rules: </b> </p>
+ *
+ * <p>By default, if <tt>@XmlAccessorType </tt> on a package is absent,
+ * then the following package level annotation is assumed.</p>
+ * <pre>
+ * @XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
+ * </pre>
+ * <p> By default, if <tt>@XmlAccessorType</tt> on a class is absent,
+ * and none of its super classes is annotated with
+ * <tt>@XmlAccessorType</tt>, then the following default on the class
+ * is assumed: </p>
+ * <pre>
+ * @XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
+ * </pre>
+ * <p>This annotation can be used with the following annotations:
+ * {@link XmlType}, {@link XmlRootElement}, {@link XmlAccessorOrder},
+ * {@link XmlSchema}, {@link XmlSchemaType}, {@link XmlSchemaTypes},
+ * , {@link XmlJavaTypeAdapter}. It can also be used with the
+ * following annotations at the package level: {@link XmlJavaTypeAdapter}.
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since JAXB2.0
+ * @see XmlAccessType
+ * @version $Revision$
+ */
+
+ at Inherited @Retention(RUNTIME) @Target({PACKAGE, TYPE})
+public @interface XmlAccessorType {
+
+ /**
+ * Specifies whether fields or properties are serialized.
+ *
+ * @see XmlAccessType
+ */
+ XmlAccessType value() default XmlAccessType.PUBLIC_MEMBER;
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAccessorType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import javax.xml.namespace.QName;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import java.util.Map;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+
+/**
+ * <p>
+ * Maps a JavaBean property to a map of wildcard attributes.
+ *
+ * <p> <b>Usage</b> </p>
+ * <p>
+ * The <tt>@XmlAnyAttribute</tt> annotation can be used with the
+ * following program elements:
+ * <ul>
+ * <li> JavaBean property </li>
+ * <li> non static, non transient field </li>
+ * </ul>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * The usage is subject to the following constraints:
+ * <ul>
+ * <li> At most one field or property in a class can be annotated
+ * with <tt>@XmlAnyAttribute</tt>. </li>
+ * <li> The type of the property or the field must <tt>java.util.Map</tt> </li>
+ * </ul>
+ *
+ * <p>
+ * While processing attributes to be unmarshalled into a value class,
+ * each attribute that is not statically associated with another
+ * JavaBean property, via {@link XmlAttribute}, is entered into the
+ * wildcard attribute map represented by
+ * {@link Map}<{@link QName},{@link Object}>. The attribute QName is the
+ * map's key. The key's value is the String value of the attribute.
+ *
+ * @author Kohsuke Kawaguchi, Sun Microsystems, Inc.
+ * @since JAXB2.0
+ */
+ at Retention(RUNTIME)
+ at Target({FIELD,METHOD})
+public @interface XmlAnyAttribute {
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAnyAttribute.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,270 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import org.w3c.dom.Element;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import javax.xml.bind.annotation.*;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import java.util.List;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Maps a JavaBean property to XML infoset representation and/or JAXB element.
+ *
+ * <p>
+ * This annotation serves as a "catch-all" property while unmarshalling
+ * xml content into a instance of a JAXB annotated class. It typically
+ * annotates a multi-valued JavaBean property, but it can occur on
+ * single value JavaBean property. During unmarshalling, each xml element
+ * that does not match a static @XmlElement or @XmlElementRef
+ * annotation for the other JavaBean properties on the class, is added to this
+ * "catch-all" property.
+ *
+ * <p>
+ * <h2>Usages:</h2>
+ * <pre>
+ * @XmlAnyElement
+ * public {@link Element}[] others;
+ *
+ * // Collection of {@link Element} or JAXB elements.
+ * @XmlAnyElement(lax="true")
+ * public {@link Object}[] others;
+ *
+ * @XmlAnyElement
+ * private List<{@link Element}> nodes;
+ *
+ * @XmlAnyElement
+ * private {@link Element} node;
+ * </pre>
+ *
+ * <h2>Restriction usage constraints</h2>
+ * <p>
+ * This annotation is mutually exclusive with
+ * {@link XmlElement}, {@link XmlAttribute}, {@link XmlValue},
+ * {@link XmlElements}, {@link XmlID}, and {@link XmlIDREF}.
+ *
+ * <p>
+ * There can be only one {@link XmlAnyElement} annotated JavaBean property
+ * in a class and its super classes.
+ *
+ * <h2>Relationship to other annotations</h2>
+ * <p>
+ * This annotation can be used with {@link XmlJavaTypeAdapter}, so that users
+ * can map their own data structure to DOM, which in turn can be composed
+ * into XML.
+ *
+ * <p>
+ * This annotation can be used with {@link XmlMixed} like this:
+ * <pre>
+ * // List of java.lang.String or DOM nodes.
+ * @XmlAnyElement @XmlMixed
+ * List<Object> others;
+ * </pre>
+ *
+ *
+ * <h2>Schema To Java example</h2>
+ *
+ * The following schema would produce the following Java class:
+ * <pre><xmp>
+ * <xs:complexType name="foo">
+ * <xs:sequence>
+ * <xs:element name="a" type="xs:int" />
+ * <xs:element name="b" type="xs:int" />
+ * <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ * </xs:sequence>
+ * </xs:complexType>
+ * </xmp></pre>
+ *
+ * <pre>
+ * class Foo {
+ * int a;
+ * int b;
+ * @{@link XmlAnyElement}
+ * List<Element> any;
+ * }
+ * </pre>
+ *
+ * It can unmarshal instances like
+ *
+ * <pre><xmp>
+ * <foo xmlns:e="extra">
+ * <a>1</a>
+ * <e:other /> // this will be bound to DOM, because unmarshalling is orderless
+ * <b>3</b>
+ * <e:other />
+ * <c>5</c> // this will be bound to DOM, because the annotation doesn't remember namespaces.
+ * </foo>
+ * </xmp></pre>
+ *
+ *
+ *
+ * The following schema would produce the following Java class:
+ * <pre><xmp>
+ * <xs:complexType name="bar">
+ * <xs:complexContent>
+ * <xs:extension base="foo">
+ * <xs:sequence>
+ * <xs:element name="c" type="xs:int" />
+ * <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+ * </xs:sequence>
+ * </xs:extension>
+ * </xs:complexType>
+ * </xmp></pre>
+ *
+ * <pre><xmp>
+ * class Bar extends Foo {
+ * int c;
+ * // Foo.getAny() also represents wildcard content for type definition bar.
+ * }
+ * </xmp></pre>
+ *
+ *
+ * It can unmarshal instances like
+ *
+ * <pre><xmp>
+ * <bar xmlns:e="extra">
+ * <a>1</a>
+ * <e:other /> // this will be bound to DOM, because unmarshalling is orderless
+ * <b>3</b>
+ * <e:other />
+ * <c>5</c> // this now goes to Bar.c
+ * <e:other /> // this will go to Foo.any
+ * </bar>
+ * </xmp></pre>
+ *
+ *
+ *
+ *
+ * <h2>Using {@link XmlAnyElement} with {@link XmlElementRef}</h2>
+ * <p>
+ * The {@link XmlAnyElement} annotation can be used with {@link XmlElementRef}s to
+ * designate additional elements that can participate in the content tree.
+ *
+ * <p>
+ * The following schema would produce the following Java class:
+ * <pre><xmp>
+ * <xs:complexType name="foo">
+ * <xs:choice maxOccurs="unbounded" minOccurs="0">
+ * <xs:element name="a" type="xs:int" />
+ * <xs:element name="b" type="xs:int" />
+ * <xs:any namespace="##other" processContents="lax" />
+ * </xs:choice>
+ * </xs:complexType>
+ * </xmp></pre>
+ *
+ * <pre>
+ * class Foo {
+ * @{@link XmlAnyElement}(lax="true")
+ * @{@link XmlElementRefs}({
+ * @{@link XmlElementRef}(name="a", type="JAXBElement.class")
+ * @{@link XmlElementRef}(name="b", type="JAXBElement.class")
+ * })
+ * {@link List}<{@link Object}> others;
+ * }
+ *
+ * @XmlRegistry
+ * class ObjectFactory {
+ * ...
+ * @XmlElementDecl(name = "a", namespace = "", scope = Foo.class)
+ * {@link JAXBElement}<Integer> createFooA( Integer i ) { ... }
+ *
+ * @XmlElementDecl(name = "b", namespace = "", scope = Foo.class)
+ * {@link JAXBElement}<Integer> createFooB( Integer i ) { ... }
+ * </pre>
+ *
+ * It can unmarshal instances like
+ *
+ * <pre><xmp>
+ * <foo xmlns:e="extra">
+ * <a>1</a> // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
+ * <e:other /> // this will unmarshal to a DOM {@link Element}.
+ * <b>3</b> // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
+ * </foo>
+ * </xmp></pre>
+ *
+ *
+ *
+ *
+ * <h2>W3C XML Schema "lax" wildcard emulation</h2>
+ * The lax element of the annotation enables the emulation of the "lax" wildcard semantics.
+ * For example, when the Java source code is annotated like this:
+ * <pre>
+ * @{@link XmlRootElement}
+ * class Foo {
+ * @XmlAnyElement(lax=true)
+ * public {@link Object}[] others;
+ * }
+ * </pre>
+ * then the following document will unmarshal like this:
+ * <pre><xmp>
+ * <foo>
+ * <unknown />
+ * <foo />
+ * </foo>
+ *
+ * Foo foo = unmarshal();
+ * // 1 for 'unknown', another for 'foo'
+ * assert foo.others.length==2;
+ * // 'unknown' unmarshals to a DOM element
+ * assert foo.others[0] instanceof Element;
+ * // because of lax=true, the 'foo' element eagerly
+ * // unmarshals to a Foo object.
+ * assert foo.others[1] instanceof Foo;
+ * </xmp></pre>
+ *
+ *
+ * @author Kohsuke Kawaguchi
+ * @since JAXB2.0
+ */
+ at Retention(RUNTIME)
+ at Target({FIELD,METHOD})
+public @interface XmlAnyElement {
+
+ /**
+ * Controls the unmarshaller behavior when it sees elements
+ * known to the current {@link JAXBContext}.
+ *
+ * <h3>When false</h3>
+ * <p>
+ * If false, all the elements that match the property will be unmarshalled
+ * to DOM, and the property will only contain DOM elements.
+ *
+ * <h3>When true</h3>
+ * <p>
+ * If true, when an element matches a property marked with {@link XmlAnyElement}
+ * is known to {@link JAXBContext} (for example, there's a class with
+ * {@link XmlRootElement} that has the same tag name, or there's
+ * {@link XmlElementDecl} that has the same tag name),
+ * the unmarshaller will eagerly unmarshal this element to the JAXB object,
+ * instead of unmarshalling it to DOM. Additionally, if the element is
+ * unknown but it has a known xsi:type, the unmarshaller eagerly unmarshals
+ * the element to a {@link JAXBElement}, with the unknown element name and
+ * the JAXBElement value is set to an instance of the JAXB mapping of the
+ * known xsi:type.
+ *
+ * <p>
+ * As a result, after the unmarshalling, the property can become heterogeneous;
+ * it can have both DOM nodes and some JAXB objects at the same time.
+ *
+ * <p>
+ * This can be used to emulate the "lax" wildcard semantics of the W3C XML Schema.
+ */
+ 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;
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAnyElement.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+
+package javax.xml.bind.annotation;
+
+import javax.activation.DataHandler;
+import static java.lang.annotation.ElementType.*;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Marks a field/property that its XML form is a uri reference to mime content.
+ * The mime content is optimally stored out-of-line as an attachment.
+ *
+ * A field/property must always map to the {@link DataHandler} class.
+ *
+ * <h2>Usage</h2>
+ * <pre>
+ * @{@link XmlRootElement}
+ * class Foo {
+ * @{@link XmlAttachmentRef}
+ * @{@link XmlAttribute}
+ * {@link DataHandler} data;
+ *
+ * @{@link XmlAttachmentRef}
+ * @{@link XmlElement}
+ * {@link DataHandler} body;
+ * }
+ * </pre>
+ * The above code maps to the following XML:
+ * <pre><xmp>
+ * <xs:element name="foo" xmlns:ref="http://ws-i.org/profiles/basic/1.1/xsd">
+ * <xs:complexType>
+ * <xs:sequence>
+ * <xs:element name="body" type="ref:swaRef" minOccurs="0" />
+ * </xs:sequence>
+ * <xs:attribute name="data" type="ref:swaRef" use="optional" />
+ * </xs:complexType>
+ * </xs:element>
+ * </xmp></pre>
+ *
+ * <p>
+ * The above binding supports WS-I AP 1.0 <a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html#Referencing_Attachments_from_the_SOAP_Envelope">WS-I Attachments Profile Version 1.0.</a>
+ *
+ * @author Kohsuke Kawaguchi
+ * @since JAXB2.0
+ */
+ at Retention(RUNTIME)
+ at Target({FIELD,METHOD,PARAMETER})
+public @interface XmlAttachmentRef {
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAttachmentRef.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAttribute.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAttribute.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAttribute.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,133 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+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.*;
+
+/**
+ * <p>
+ * Maps a JavaBean property to a XML attribute.
+ *
+ * <p> <b>Usage</b> </p>
+ * <p>
+ * The <tt>@XmlAttribute</tt> annotation can be used with the
+ * following program elements:
+ * <ul>
+ * <li> JavaBean property </li>
+ * <li> field </li>
+ * </ul>
+ *
+ * <p> A static final field is mapped to a XML fixed attribute.
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * The usage is subject to the following constraints:
+ * <ul>
+ * <li> If type of the field or the property is a collection
+ * type, then the collection item type must be mapped to schema
+ * simple type.
+ * <pre>
+ * // Examples
+ * @XmlAttribute List<Integer> items; //legal
+ * @XmlAttribute List<Bar> foo; // illegal if Bar does not map to a schema simple type
+ * </pre>
+ * </li>
+ * <li> If the type of the field or the property is a non
+ * collection type, then the type of the property or field
+ * must map to a simple schema type.
+ * <pre>
+ * // Examples
+ * @XmlAttribute int foo; // legal
+ * @XmlAttribute Foo foo; // illegal if Foo does not map to a schema simple type
+ * </pre>
+ * </li>
+ * <li> This annotation can be used with the following annotations:
+ * {@link XmlID},
+ * {@link XmlIDREF},
+ * {@link XmlList},
+ * {@link XmlSchemaType},
+ * {@link XmlValue},
+ * {@link XmlAttachmentRef},
+ * {@link XmlMimeType},
+ * {@link XmlInlineBinaryData},
+ * {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter}</li>.
+ * </ul>
+ * </p>
+ *
+ * <p> <b>Example 1: </b>Map a JavaBean property to an XML attribute.</p>
+ * <pre>
+ * //Example: Code fragment
+ * public class USPrice {
+ * @XmlAttribute
+ * public java.math.BigDecimal getPrice() {...} ;
+ * public void setPrice(java.math.BigDecimal ) {...};
+ * }
+ *
+ * <!-- Example: XML Schema fragment -->
+ * <xs:complexType name="USPrice">
+ * <xs:sequence>
+ * </xs:sequence>
+ * <xs:attribute name="price" type="xs:decimal"/>
+ * </xs:complexType>
+ * </pre>
+ *
+ * <p> <b>Example 2: </b>Map a JavaBean property to an XML attribute with anonymous type.</p>
+ * See Example 7 in @{@link XmlType}.
+ *
+ * <p> <b>Example 3: </b>Map a JavaBean collection property to an XML attribute.</p>
+ * <pre>
+ * // Example: Code fragment
+ * class Foo {
+ * ...
+ * @XmlAttribute List<Integer> items;
+ * }
+ *
+ * <!-- Example: XML Schema fragment -->
+ * <xs:complexType name="foo">
+ * ...
+ * <xs:attribute name="items">
+ * <xs:simpleType>
+ * <xs:list itemType="xs:int"/>
+ * </xs:simpleType>
+ * </xs:complexType>
+ *
+ * </pre>
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @version $Revision$
+ * @see XmlType
+ * @since JAXB2.0
+ */
+
+ at Retention(RUNTIME) @Target({FIELD, METHOD})
+public @interface XmlAttribute {
+ /**
+ * Name of the XML Schema attribute. By default, the XML Schema
+ * attribute name is derived from the JavaBean property name.
+ *
+ */
+ String name() default "##default";
+
+ /**
+ * Specifies if the XML Schema attribute is optional or
+ * required. If true, then the JavaBean property is mapped to a
+ * XML Schema attribute that is required. Otherwise it is mapped
+ * to a XML Schema attribute that is optional.
+ *
+ */
+ boolean required() default false;
+
+ /**
+ * Specifies the XML target namespace of the XML Schema
+ * attribute.
+ *
+ */
+ String namespace() default "##default" ;
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlAttribute.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElement.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElement.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElement.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,192 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * Maps a JavaBean property to a XML element derived from property name.
+ *
+ * <p> <b>Usage</b> </p>
+ * <p>
+ * </tt>@XmlElement</tt> annotation can be used with the following program
+ * elements:
+ * <ul>
+ * <li> a JavaBean property </li>
+ * <li> non static, non transient field </li>
+ * <li> within {@link XmlElements}
+ * <p>
+ *
+ * </ul>
+ *
+ * The usage is subject to the following constraints:
+ * <ul>
+ * <li> This annotation can be used with following annotations:
+ * {@link XmlID},
+ * {@link XmlIDREF},
+ * {@link XmlList},
+ * {@link XmlSchemaType},
+ * {@link XmlValue},
+ * {@link XmlAttachmentRef},
+ * {@link XmlMimeType},
+ * {@link XmlInlineBinaryData},
+ * {@link XmlElementWrapper},
+ * {@link XmlJavaTypeAdapter}</li>
+ * <li> if the type of JavaBean property is a collection type of
+ * array, an indexed property, or a parameterized list, and
+ * this annotation is used with {@link XmlElements} then,
+ * <tt>@XmlElement.type()</tt> must be DEFAULT.class since the
+ * collection item type is already known. </li>
+ * </ul>
+ *
+ * <p>
+ * A JavaBean property, when annotated with @XmlElement annotation
+ * is mapped to a local element in the XML Schema complex type to
+ * which the containing class is mapped.
+ *
+ * <p>
+ * <b>Example 1: </b> Map a public non static non final field to local
+ * element
+ * <pre>
+ * //Example: Code fragment
+ * public class USPrice {
+ * @XmlElement(name="itemprice")
+ * public java.math.BigDecimal price;
+ * }
+ *
+ * <!-- Example: Local XML Schema element -->
+ * <xs:complexType name="USPrice"/>
+ * <xs:sequence>
+ * <xs:element name="itemprice" type="xs:decimal" minOccurs="0"/>
+ * </sequence>
+ * </xs:complexType>
+ * </pre>
+ * <p>
+ *
+ * <b> Example 2: </b> Map a field to a nillable element.
+ * <pre>
+ *
+ * //Example: Code fragment
+ * public class USPrice {
+ * @XmlElement(nillable=true)
+ * public java.math.BigDecimal price;
+ * }
+ *
+ * <!-- Example: Local XML Schema element -->
+ * <xs:complexType name="USPrice">
+ * <xs:sequence>
+ * <xs:element name="price" type="xs:decimal" nillable="true" minOccurs="0"/>
+ * </sequence>
+ * </xs:complexType>
+ * </pre>
+ * <p>
+ * <b> Example 3: </b> Map a field to a nillable, required element.
+ * <pre>
+ *
+ * //Example: Code fragment
+ * public class USPrice {
+ * @XmlElement(nillable=true, required=true)
+ * public java.math.BigDecimal price;
+ * }
+ *
+ * <!-- Example: Local XML Schema element -->
+ * <xs:complexType name="USPrice">
+ * <xs:sequence>
+ * <xs:element name="price" type="xs:decimal" nillable="true" minOccurs="1"/>
+ * </sequence>
+ * </xs:complexType>
+ * </pre>
+ * <p>
+ *
+ * <p> <b>Example 4: </b>Map a JavaBean property to an XML element
+ * with anonymous type.</p>
+ * <p>
+ * See Example 6 in @{@link XmlType}.
+ *
+ * <p>
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since JAXB2.0
+ * @version $Revision$
+ */
+
+ at Retention(RUNTIME) @Target({FIELD, METHOD})
+public @interface XmlElement {
+ /**
+ * Name of the XML Schema element.
+ * <p> If the value is "##default", then element name is derived from the
+ * JavaBean property name.
+ */
+ String name() default "##default";
+
+ /**
+ * Customize the element declaration to be nillable.
+ * <p>If nillable() is true, then the JavaBean property is
+ * mapped to a XML Schema nillable element declaration.
+ */
+ boolean nillable() default false;
+
+ /**
+ * Customize the element declaration to be required.
+ * <p>If required() is true, then Javabean property is mapped to
+ * an XML schema element declaration with minOccurs="1".
+ * maxOccurs is "1" for a single valued property and "unbounded"
+ * for a multivalued property.
+ * <p>If required() is false, then the Javabean property is mapped
+ * to XML Schema element declaration with minOccurs="0".
+ * maxOccurs is "1" for a single valued property and "unbounded"
+ * for a multivalued property.
+ */
+
+ boolean required() default false;
+
+ /**
+ * XML target namespace of the XML Schema element.
+ * <p>
+ * If the value is "##default", then the namespace is determined
+ * as follows:
+ * <ol>
+ * <li>
+ * If the enclosing package has {@link XmlSchema} annotation,
+ * and its {@link XmlSchema#elementFormDefault() elementFormDefault}
+ * is {@link XmlNsForm#QUALIFIED QUALIFIED}, then the namespace of
+ * the enclosing class.
+ *
+ * <li>
+ * Otherwise "" (which produces unqualified element in the default
+ * namespace.
+ * </ol>
+ */
+ String namespace() default "##default";
+
+ /**
+ * Default value of this element.
+ *
+ * <p>
+ * The '\u0000' value specified as a default of this annotation element
+ * is used as a poor-man's substitute for null to allow implementations
+ * to recognize the 'no default value' state.
+ */
+ String defaultValue() default "\u0000";
+
+ /**
+ * The Java class being referenced.
+ */
+ Class type() default DEFAULT.class;
+
+ /**
+ * Used in {@link XmlElement#type()} to
+ * signal that the type be inferred from the signature
+ * of the property.
+ */
+ static final class DEFAULT {}
+}
+
+
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElement.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,196 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+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;
+
+/**
+ * Maps a factory method to a XML element.
+ *
+ * <p> <b>Usage</b> </p>
+ *
+ * The annotation creates a mapping between an XML schema element
+ * declaration and a <i> element factory method </i> that returns a
+ * JAXBElement instance representing the element
+ * declaration. Typically, the element factory method is generated
+ * (and annotated) from a schema into the ObjectFactory class in a
+ * Java package that represents the binding of the element
+ * declaration's target namespace. Thus, while the annotation syntax
+ * allows @XmlElementDecl to be used on any method, semantically
+ * its use is restricted to annotation of element factory method.
+ *
+ * The usage is subject to the following constraints:
+ *
+ * <ul>
+ * <li> The class containing the element factory method annotated
+ * with @XmlElementDecl must be marked with {@link
+ * XmlRegistry}. </li>
+ * <li> The element factory method must take one parameter
+ * assignable to {@link Object}.</li>
+ * </ul>
+ *
+ * <p><b>Example 1: </b>Annotation on a factory method
+ * <pre>
+ * // Example: code fragment
+ * @XmlRegistry
+ * class ObjectFactory {
+ * @XmlElementDecl(name="foo")
+ * JAXBElement<String> createFoo(String s) { ... }
+ * }
+ * </pre>
+ * <pre><xmp>
+ * <!-- XML input -->
+ * <foo>string</foo>
+ *
+ * // Example: code fragment corresponding to XML input
+ * JAXBElement<String> o =
+ * (JAXBElement<String>)unmarshaller.unmarshal(aboveDocument);
+ * // print JAXBElement instance to show values
+ * System.out.println(o.getName()); // prints "{}foo"
+ * System.out.println(o.getValue()); // prints "string"
+ * System.out.println(o.getValue().getClass()); // prints "java.lang.String"
+ *
+ * <!-- Example: XML schema definition -->
+ * <xs:element name="foo" type="xs:string"/>
+ * </xmp></pre>
+ *
+ * <p><b>Example 2: </b> Element declaration with non local scope
+ * <p>
+ * The following example illustrates the use of scope annotation
+ * parameter in binding of element declaration in schema derived
+ * code.
+ * <p>
+ * The following example may be replaced in a future revision of
+ * this javadoc.
+ *
+ * <pre><xmp>
+ * <!-- Example: XML schema definition -->
+ * <xs:schema>
+ * <xs:complexType name="pea">
+ * <xs:choice maxOccurs="unbounded">
+ * <xs:element name="foo" type="xs:string"/>
+ * <xs:element name="bar" type="xs:string"/>
+ * </xs:choice>
+ * </xs:complexType>
+ * <xs:element name="foo" type="xs:int"/>
+ * </xs:schema>
+ * </xmp></pre>
+ * <pre>
+ * // Example: expected default binding
+ * class Pea {
+ * @XmlElementRefs({
+ * @XmlElementRef(name="foo",type=JAXBElement.class)
+ * @XmlElementRef(name="bar",type=JAXBElement.class)
+ * })
+ * List<JAXBElement<String>> fooOrBar;
+ * }
+ *
+ * @XmlRegistry
+ * class ObjectFactory {
+ * @XmlElementDecl(scope=Pea.class,name="foo")
+ * JAXBElement<String> createPeaFoo(String s);
+ *
+ * @XmlElementDecl(scope=Pea.class,name="bar")
+ * JAXBElement<String> createPeaBar(String s);
+ *
+ * @XmlElementDecl(name="foo")
+ * JAXBElement<Integer> createFoo(Integer i);
+ * }
+ *
+ * </pre>
+ * Without scope createFoo and createPeaFoo would become ambiguous
+ * since both of them map to a XML schema element with the same local
+ * name "foo".
+ *
+ * @see XmlRegistry
+ * @since JAXB 2.0
+ */
+ at Retention(RUNTIME)
+ at Target({METHOD})
+public @interface XmlElementDecl {
+ /**
+ * scope of the mapping.
+ *
+ * <p>
+ * If this is not {@link XmlElementDecl.GLOBAL}, then this element
+ * declaration mapping is only active within the specified class.
+ */
+ Class scope() default GLOBAL.class;
+
+ /**
+ * namespace name of the XML element.
+ * <p>
+ * If the value is "##default", then the value is the namespace
+ * name for the package of the class containing this factory method.
+ *
+ * @see #name()
+ */
+ String namespace() default "##default";
+
+ /**
+ * local name of the XML element.
+ *
+ * <p>
+ * <b> Note to reviewers: </b> There is no default name; since
+ * the annotation is on a factory method, it is not clear that the
+ * method name can be derived from the factory method name.
+ * @see #namespace()
+ */
+ String name();
+
+ /**
+ * namespace name of a substitution group's head XML element.
+ * <p>
+ * This specifies the namespace name of the XML element whose local
+ * name is specified by <tt>substitutionHeadName()</tt>.
+ * <p>
+ * If <tt>susbtitutionHeadName()</tt> is "", then this
+ * value can only be "##default". But the value is ignored since
+ * since this element is not part of susbtitution group when the
+ * value of <tt>susbstitutionHeadName()</tt> is "".
+ * <p>
+ * If <tt>susbtitutionHeadName()</tt> is not "" and the value is
+ * "##default", then the namespace name is the namespace name to
+ * which the package of the containing class, marked with {@link
+ * XmlRegistry }, is mapped.
+ * <p>
+ * If <tt>susbtitutionHeadName()</tt> is not "" and the value is
+ * not "##default", then the value is the namespace name.
+ *
+ * @see #substitutionHeadName()
+ */
+ String substitutionHeadNamespace() default "##default";
+
+ /**
+ * XML local name of a substitution group's head element.
+ * <p>
+ * If the value is "", then this element is not part of any
+ * substitution group.
+ *
+ * @see #substitutionHeadNamespace()
+ */
+ String substitutionHeadName() default "";
+
+ /**
+ * Default value of this element.
+ *
+ * <p>
+ * The '\u0000' value specified as a default of this annotation element
+ * is used as a poor-man's substitute for null to allow implementations
+ * to recognize the 'no default value' state.
+ */
+ String defaultValue() default "\u0000";
+
+ /**
+ * Used in {@link XmlElementDecl#scope()} to
+ * signal that the declaration is in the global scope.
+ */
+ public final class GLOBAL {}
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElementDecl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElementRef.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElementRef.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElementRef.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,248 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+
+/**
+ * <p>
+ * Maps a JavaBean property to a XML element derived from property's type.
+ * <p>
+ * <b>Usage</b>
+ * <p>
+ * <tt>@XmlElementRef</tt> annotation can be used with a
+ * JavaBean property or from within {@link XmlElementRefs}
+ * <p>
+ * This annotation dynamically associates an XML element name with the JavaBean
+ * property. When a JavaBean property is annotated with {@link
+ * XmlElement}, the XML element name is statically derived from the
+ * JavaBean property name. However, when this annotation is used, the
+ * XML element name is derived from the instance of the type of the
+ * JavaBean property at runtime.
+ *
+ * <h3> XML Schema substitution group support </h3>
+ * XML Schema allows a XML document author to use XML element names
+ * that were not statically specified in the content model of a
+ * schema using substitution groups. Schema derived code provides
+ * support for substitution groups using an <i>element property</i>,
+ * (section 5.5.5, "Element Property" of JAXB 2.0 specification). An
+ * element property method signature is of the form:
+ * <pre><xmp>
+ * public void setTerm(JAXBElement<? extends Operator>);
+ * public JAXBElement<? extends Operator> getTerm();
+ * </xmp></pre>
+ * <p>
+ * An element factory method annotated with {@link XmlElementDecl} is
+ * used to create a <tt>JAXBElement</tt> instance, containing an XML
+ * element name. The presence of @XmlElementRef annotation on an
+ * element property indicates that the element name from <tt>JAXBElement</tt>
+ * instance be used instead of deriving an XML element name from the
+ * JavaBean property name.
+ *
+ * <p>
+ * The usage is subject to the following constraints:
+ * <ul>
+ * <li> If the collection item type (for collection property) or
+ * property type (for single valued property) is
+ * {@link javax.xml.bind.JAXBElement}, then
+ * <tt>@XmlElementRef}.name()</tt> and <tt>@XmlElementRef.namespace()</tt> must
+ * point an element factory method with an @XmlElementDecl
+ * annotation in a class annotated with @XmlRegistry (usually
+ * ObjectFactory class generated by the schema compiler) :
+ * <ul>
+ * <li> @XmlElementDecl.name() must equal @XmlElementRef.name() </li>
+ * <li> @XmlElementDecl.namespace() must equal @XmlElementRef.namespace(). </li>
+ * </ul>
+ * </li>
+ * <li> If the collection item type (for collection property) or
+ * property type (for single valued property) is not
+ * {@link javax.xml.bind.JAXBElement}, then the type referenced by the
+ * property or field must be annotated with {@link XmlRootElement}. </li>
+ * <li> This annotation can be used with the following annotations:
+ * {@link XmlElementWrapper}, {@link XmlJavaTypeAdapter}.
+ * </ul>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <p><b>Example 1: </b>Ant Task Example</b></p>
+ * The following Java class hierarchy models an Ant build
+ * script. An Ant task corresponds to a class in the class
+ * hierarchy. The XML element name of an Ant task is indicated by the
+ * @XmlRootElement annotation on its corresponding class.
+ * <pre>
+ * @XmlRootElement(name="target")
+ * class Target {
+ * // The presence of @XmlElementRef indicates that the XML
+ * // element name will be derived from the @XmlRootElement
+ * // annotation on the type (for e.g. "jar" for JarTask).
+ * @XmlElementRef
+ * List<Task> tasks;
+ * }
+ *
+ * abstract class Task {
+ * }
+ *
+ * @XmlRootElement(name="jar")
+ * class JarTask extends Task {
+ * ...
+ * }
+ *
+ * @XmlRootElement(name="javac")
+ * class JavacTask extends Task {
+ * ...
+ * }
+ *
+ * <!-- XML Schema fragment -->
+ * <xs:element name="target" type="Target">
+ * <xs:complexType name="Target">
+ * <xs:sequence>
+ * <xs:choice maxOccurs="unbounded">
+ * <xs:element ref="jar">
+ * <xs:element ref="javac">
+ * </xs:choice>
+ * </xs:sequence>
+ * </xs:complexType>
+ *
+ * </pre>
+ * <p>
+ * Thus the following code fragment:
+ * <pre>
+ * Target target = new Target();
+ * target.tasks.add(new JarTask());
+ * target.tasks.add(new JavacTask());
+ * marshal(target);
+ * </pre>
+ * will produce the following XML output:
+ * <pre><xmp>
+ * <target>
+ * <jar>
+ * ....
+ * </jar>
+ * <javac>
+ * ....
+ * </javac>
+ * </target>
+ * </xmp></pre>
+ * <p>
+ * It is not an error to have a class that extends <tt>Task</tt>
+ * that doesn't have {@link XmlRootElement}. But they can't show up in an
+ * XML instance (because they don't have XML element names).
+ *
+ * <p><b>Example 2: XML Schema Susbstitution group support</b>
+ * <p> The following example shows the annotations for XML Schema
+ * substitution groups. The annotations and the ObjectFactory are
+ * derived from the schema.
+ *
+ * <pre>
+ * @XmlElement
+ * class Math {
+ * // The value of {@link #type()}is
+ * // JAXBElement.class , which indicates the XML
+ * // element name ObjectFactory - in general a class marked
+ * // with @XmlRegistry. (See ObjectFactory below)
+ * //
+ * // The {@link #name()} is "operator", a pointer to a
+ * // factory method annotated with a
+ * // {@link XmlElementDecl} with the name "operator". Since
+ * // "operator" is the head of a substitution group that
+ * // contains elements "add" and "sub" elements, "operator"
+ * // element can be substituted in an instance document by
+ * // elements "add" or "sub". At runtime, JAXBElement
+ * // instance contains the element name that has been
+ * // substituted in the XML document.
+ * //
+ * @XmlElementRef(type=JAXBElement.class,name="operator")
+ * JAXBElement<? extends Operator> term;
+ * }
+ *
+ * @XmlRegistry
+ * class ObjectFactory {
+ * @XmlElementDecl(name="operator")
+ * JAXBElement<Operator> createOperator(Operator o) {...}
+ * @XmlElementDecl(name="add",substitutionHeadName="operator")
+ * JAXBElement<Operator> createAdd(Operator o) {...}
+ * @XmlElementDecl(name="sub",substitutionHeadName="operator")
+ * JAXBElement<Operator> createSub(Operator o) {...}
+ * }
+ *
+ * class Operator {
+ * ...
+ * }
+ * </pre>
+ * <p>
+ * Thus, the following code fragment
+ * <pre>
+ * Math m = new Math();
+ * m.term = new ObjectFactory().createAdd(new Operator());
+ * marshal(m);
+ * </pre>
+ * will produce the following XML output:
+ * <pre>
+ * <math>
+ * <add>...</add>
+ * </math>
+ * </pre>
+ *
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems,Inc. </li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+ * @see XmlElementRefs
+ * @since JAXB2.0
+ */
+ at Retention(RUNTIME)
+ at Target({FIELD,METHOD})
+public @interface XmlElementRef {
+ /**
+ * The Java type being referenced.
+ * <p>
+ * If the value is DEFAULT.class, the type is inferred from the
+ * the type of the JavaBean property.
+ */
+ Class type() default DEFAULT.class;
+
+ /**
+ * This parameter and {@link #name()} are used to determine the
+ * XML element for the JavaBean property.
+ *
+ * <p> If <tt>type()</tt> is <tt>JAXBElement.class</tt> , then
+ * <tt>namespace()</tt> and <tt>name()</tt>
+ * point to a factory method with {@link XmlElementDecl}. The XML
+ * element name is the element name from the factory method's
+ * {@link XmlElementDecl} annotation or if an element from its
+ * substitution group (of which it is a head element) has been
+ * substituted in the XML document, then the element name is from the
+ * {@link XmlElementDecl} on the substituted element.
+ *
+ * <p> If {@link #type()} is not <tt>JAXBElement.class</tt>, then
+ * the XML element name is the XML element name statically
+ * associated with the type using the annotation {@link
+ * XmlRootElement} on the type. If the type is not annotated with
+ * an {@link XmlElementDecl}, then it is an error.
+ *
+ * <p> If <tt>type()</tt> is not <tt>JAXBElement.class</tt>, then
+ * this value must be "".
+ *
+ */
+ String namespace() default "";
+ /**
+ *
+ * @see #namespace()
+ */
+ String name() default "##default";
+
+ /**
+ * Used in {@link XmlElementRef#type()} to
+ * signal that the type be inferred from the signature
+ * of the property.
+ */
+ static final class DEFAULT {}
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElementRef.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElementRefs.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElementRefs.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElementRefs.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+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.
+ *
+ * <p>
+ * Compared to an element property (property with {@link XmlElement}
+ * annotation), a reference property has a different substitution semantics.
+ * When a sub-class is assigned to a property, an element property produces
+ * the same tag name with @xsi:type, whereas a reference property produces
+ * a different tag name (the tag name that's on the the sub-class.)
+ *
+ * <p> This annotation can be used with the following annotations:
+ * {@link XmlJavaTypeAdapter}, {@link XmlElementWrapper}.
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+ *
+ * @see XmlElementWrapper
+ * @see XmlElementRef
+ * @since JAXB2.0
+ */
+ at Retention(RUNTIME)
+ at Target({FIELD,METHOD})
+public @interface XmlElementRefs {
+ XmlElementRef[] value();
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElementRefs.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElementWrapper.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElementWrapper.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElementWrapper.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,102 @@
+package javax.xml.bind.annotation;
+
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Generates a wrapper element around XML representation.
+ *
+ * This is primarily intended to be used to produce a wrapper
+ * XML element around collections. The annotation therefore supports
+ * two forms of serialization shown below.
+ *
+ * <pre>
+ * //Example: code fragment
+ * int[] names;
+ *
+ * // XML Serialization Form 1 (Unwrapped collection)
+ * <names> ... </names>
+ * <names> ... </names>
+ *
+ * // XML Serialization Form 2 ( Wrapped collection )
+ * <wrapperElement>
+ * <names> value-of-item </names>
+ * <names> value-of-item </names>
+ * ....
+ * </wrapperElement>
+ * </pre>
+ *
+ * <p> The two serialized XML forms allow a null collection to be
+ * represented either by absence or presence of an element with a
+ * nillable attribute.
+ *
+ * <p> <b>Usage</b> </p>
+ * <p>
+ * The <tt>@XmlElementWrapper</tt> annotation can be used with the
+ * following program elements:
+ * <ul>
+ * <li> JavaBean property </li>
+ * <li> non static, non transient field </li>
+ * </ul>
+ *
+ * <p>The usage is subject to the following constraints:
+ * <ul>
+ * <li> The property must be a collection property </li>
+ * <li> This annotation can be used with the following annotations:
+ * {@link XmlElement},
+ * {@link XmlElements},
+ * {@link XmlElementRef},
+ * {@link XmlElementRefs},
+ * {@link XmlJavaTypeAdapter}</li>.
+ * </ul>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+ * @see XmlElement
+ * @see XmlElements
+ * @see XmlElementRef
+ * @see XmlElementRefs
+ * @since JAXB2.0
+ *
+ */
+
+ at Retention(RUNTIME) @Target({FIELD, METHOD})
+public @interface XmlElementWrapper {
+ /**
+ * Name of the XML wrapper element. By default, the XML wrapper
+ * element name is derived from the JavaBean property name.
+ */
+ String name() default "##default";
+
+ /**
+ * XML target namespace of the XML wrapper element.
+ * <p>
+ * If the value is "##default", then the namespace is determined
+ * as follows:
+ * <ol>
+ * <li>
+ * If the enclosing package has {@link XmlSchema} annotation,
+ * and its {@link XmlSchema#elementFormDefault() elementFormDefault}
+ * is {@link XmlNsForm#QUALIFIED QUALIFIED}, then the namespace of
+ * the enclosing class.
+ *
+ * <li>
+ * Otherwise "" (which produces unqualified element in the default
+ * namespace.
+ * </ol>
+ */
+ String namespace() default "##default";
+
+ /**
+ * If true, the absence of the collection is represented by
+ * using <tt>xsi:nil='true'</tt>. Otherwise, it is represented by
+ * the absence of the element.
+ */
+ boolean nillable() default false;
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElementWrapper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElements.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElements.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElements.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,157 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * <p>
+ * A container for multiple @{@link XmlElement} annotations.
+ *
+ * Multiple annotations of the same type are not allowed on a program
+ * element. This annotation therefore serves as a container annotation
+ * for multiple @XmlElements as follows:
+ *
+ * <pre>
+ * @XmlElements({ @XmlElement(...), at XmlElement(...) })
+ * </pre>
+ *
+ * <p>The <tt>@XmlElements</tt> annnotation can be used with the
+ * following program elements: </p>
+ * <ul>
+ * <li> a JavaBean property </li>
+ * <li> non static, non transient field </li>
+ * </ul>
+ *
+ * This annotation is intended for annotation a JavaBean collection
+ * property (e.g. List).
+ *
+ * <p><b>Usage</b></p>
+ *
+ * <p>The usage is subject to the following constraints:
+ * <ul>
+ * <li> This annotation can be used with the following
+ * annotations: @{@link XmlIDREF}, @{@link XmlElementWrapper}. </li>
+ * <li> If @XmlIDREF is also specified on the JavaBean property,
+ * then each @XmlElement.type() must contain a JavaBean
+ * property annotated with <tt>@XmlID</tt>.</li>
+ * </ul>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <hr>
+ *
+ * <p><b>Example 1:</b> Map to a list of elements</p>
+ * <pre>
+ *
+ * // Mapped code fragment
+ * public class Foo {
+ * @XmlElements(
+ * @XmlElement(name="A", type=Integer.class),
+ * @XmlElement(name="B", type=Float.class)
+ * }
+ * public List items;
+ * }
+ *
+ * <!-- XML Representation for a List of {1,2.5}
+ * XML output is not wrapped using another element -->
+ * ...
+ * <A> 1 </A>
+ * <B> 2.5 </B>
+ * ...
+ *
+ * <!-- XML Schema fragment -->
+ * <xs:complexType name="Foo">
+ * <xs:sequence>
+ * <xs:choice minOccurs="0" maxOccurs="unbounded">
+ * <xs:element name="A" type="xs:int"/>
+ * <xs:element name="B" type="xs:float"/>
+ * <xs:choice>
+ * </xs:sequence>
+ * </xs:complexType>
+ *
+ * </pre>
+ *
+ * <p><b>Example 2:</b> Map to a list of elements wrapped with another element
+ * </p>
+ * <pre>
+ *
+ * // Mapped code fragment
+ * public class Foo {
+ * @XmlElementWrapper(name="bar")
+ * @XmlElements(
+ * @XmlElement(name="A", type=Integer.class),
+ * @XmlElement(name="B", type=Float.class)
+ * }
+ * public List items;
+ * }
+ *
+ * <!-- XML Schema fragment -->
+ * <xs:complexType name="Foo">
+ * <xs:sequence>
+ * <xs:element name="bar">
+ * <xs:complexType>
+ * <xs:choice minOccurs="0" maxOccurs="unbounded">
+ * <xs:element name="A" type="xs:int"/>
+ * <xs:element name="B" type="xs:float"/>
+ * </xs:choice>
+ * </xs:complexType>
+ * </xs:element>
+ * </xs:sequence>
+ * </xs:complexType>
+ * </pre>
+ *
+ * <p><b>Example 3:</b> Change element name based on type using an adapter.
+ * </p>
+ * <pre>
+ * class Foo {
+ * @XmlJavaTypeAdapter(QtoPAdapter.class)
+ * @XmlElements({
+ * @XmlElement(name="A",type=PX.class),
+ * @XmlElement(name="B",type=PY.class)
+ * })
+ * Q bar;
+ * }
+ *
+ * @XmlType abstract class P {...}
+ * @XmlType(name="PX") class PX extends P {...}
+ * @XmlType(name="PY") class PY extends P {...}
+ *
+ * <!-- XML Schema fragment -->
+ * <xs:complexType name="Foo">
+ * <xs:sequence>
+ * <xs:element name="bar">
+ * <xs:complexType>
+ * <xs:choice minOccurs="0" maxOccurs="unbounded">
+ * <xs:element name="A" type="PX"/>
+ * <xs:element name="B" type="PY"/>
+ * </xs:choice>
+ * </xs:complexType>
+ * </xs:element>
+ * </xs:sequence>
+ * </xs:complexType>
+ * </pre>
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+ * @see XmlElement
+ * @see XmlElementRef
+ * @see XmlElementRefs
+ * @see XmlJavaTypeAdapter
+ * @since JAXB2.0
+ */
+ at Retention(RUNTIME) @Target({FIELD,METHOD})
+public @interface XmlElements {
+ /**
+ * Collection of @{@link XmlElement} annotations
+ */
+ XmlElement[] value();
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlElements.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlEnum.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlEnum.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlEnum.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * <p>
+ * Maps an enum type {@link Enum} to XML representation.
+ *
+ * <p>This annotation, together with {@link XmlEnumValue} provides a
+ * mapping of enum type to XML representation.
+ *
+ * <p> <b>Usage</b> </p>
+ * <p>
+ * The <tt>@XmlEnum</tt> annotation can be used with the
+ * following program elements:
+ * <ul>
+ * <li>enum type</li>
+ * </ul>
+ *
+ * <p> The usage is subject to the following constraints:
+ * <ul>
+ * <li> This annotation can be used the following other annotations:
+ * {@link XmlType},
+ * {@link XmlRootElement} </li>
+ * </ul>
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information </p>
+ *
+ * <p>An enum type is mapped to a schema simple type with enumeration
+ * facets. The schema type is derived from the Java type to which
+ * <tt>@XmlEnum.value()</tt>. Each enum constant <tt>@XmlEnumValue</tt>
+ * must have a valid lexical representation for the type
+ * <tt>@XmlEnum.value()</tt> .
+ *
+ * <p><b>Examples:</b> See examples in {@link XmlEnumValue}
+ *
+ * @since JAXB2.0
+ */
+
+ at Retention(RUNTIME) @Target({TYPE})
+public @interface XmlEnum {
+ /**
+ * Java type that is mapped to a XML simple type.
+ *
+ */
+ Class<?> value() default String.class;
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlEnum.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+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.FIELD;
+
+/**
+ * Maps an enum constant in {@link Enum} type to XML representation.
+ *
+ * <p> <b>Usage</b> </p>
+ *
+ * <p> The <tt>@XmlEnumValue</tt> annotation can be used with the
+ * following program elements:
+ * <ul>
+ * <li>enum constant</li>
+ * </ul>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <p>This annotation, together with {@link XmlEnum} provides a
+ * mapping of enum type to XML representation.
+ *
+ * <p>An enum type is mapped to a schema simple type with enumeration
+ * facets. The schema type is derived from the Java type specified in
+ * <tt>@XmlEnum.value()</tt>. Each enum constant <tt>@XmlEnumValue</tt>
+ * must have a valid lexical representation for the type
+ * <tt>@XmlEnum.value()</tt>
+ *
+ * <p> In the absence of this annotation, {@link Enum#name()} is used
+ * as the XML representation.
+ *
+ * <p> <b>Example 1: </b>Map enum constant name -> enumeration facet</p>
+ * <pre>
+ * //Example: Code fragment
+ * @XmlEnum(String.class)
+ * public enum Card { CLUBS, DIAMONDS, HEARTS, SPADES }
+ *
+ * <!-- Example: XML Schema fragment -->
+ * <xs:simpleType name="Card">
+ * <xs:restriction base="xs:string"/>
+ * <xs:enumeration value="CLUBS"/>
+ * <xs:enumeration value="DIAMONDS"/>
+ * <xs:enumeration value="HEARTS"/>
+ * <xs:enumeration value="SPADES"/>
+ * </xs:simpleType>
+ * </pre>
+ *
+ * <p><b>Example 2: </b>Map enum constant name(value) -> enumeration facet </p>
+ * <pre>
+ * //Example: code fragment
+ * @XmlType
+ * @XmlEnum(Integer.class)
+ * public enum Coin {
+ * @XmlEnumValue("1") PENNY(1),
+ * @XmlEnumValue("5") NICKEL(5),
+ * @XmlEnumValue("10") DIME(10),
+ * @XmlEnumValue("25") QUARTER(25) }
+ *
+ * <!-- Example: XML Schema fragment -->
+ * <xs:simpleType name="Coin">
+ * <xs:restriction base="xs:int">
+ * <xs:enumeration value="1"/>
+ * <xs:enumeration value="5"/>
+ * <xs:enumeration value="10"/>
+ * <xs:enumeration value="25"/>
+ * </xs:restriction>
+ * </xs:simpleType>
+ * </pre>
+ *
+ * <p><b>Example 3: </b>Map enum constant name -> enumeration facet </p>
+ *
+ * <pre>
+ * //Code fragment
+ * @XmlType
+ * @XmlEnum(Integer.class)
+ * public enum Code {
+ * @XmlEnumValue("1") ONE,
+ * @XmlEnumValue("2") TWO;
+ * }
+ *
+ * <!-- Example: XML Schema fragment -->
+ * <xs:simpleType name="Code">
+ * <xs:restriction base="xs:int">
+ * <xs:enumeration value="1"/>
+ * <xs:enumeration value="2"/>
+ * </xs:restriction>
+ * </xs:simpleType>
+ * </pre>
+ *
+ * @since JAXB 2.0
+ */
+ at Retention(RUNTIME)
+ at Target({FIELD})
+public @interface XmlEnumValue {
+ String value();
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlEnumValue.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlID.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlID.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlID.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * <p>
+ * Maps a JavaBean property to XML ID.
+ *
+ * <p>
+ * To preserve referential integrity of an object graph across XML
+ * serialization followed by a XML deserialization, requires an object
+ * reference to be marshalled by reference or containment
+ * appropriately. Annotations <tt>@XmlID</tt> and <tt>@XmlIDREF</tt>
+ * together allow a customized mapping of a JavaBean property's
+ * type by containment or reference.
+ *
+ * <p><b>Usage</b> </p>
+ * The <tt>@XmlID</tt> annotation can be used with the following
+ * program elements:
+ * <ul>
+ * <li> a JavaBean property </li>
+ * <li> non static, non transient field </li>
+ * </ul>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * The usage is subject to the following constraints:
+ * <ul>
+ * <li> At most one field or property in a class can be annotated
+ * with <tt>@XmlID</tt>. </li>
+ * <li> The JavaBean property's type must be <tt>java.lang.String</tt>.</li>
+ * <li> The only other mapping annotations that can be used
+ * with <tt>@XmlID</tt>
+ * are:<tt>@XmlElement</tt> and <tt>@XmlAttribute</tt>.</li>
+ * </ul>
+ *
+ * <p><b>Example</b>: Map a JavaBean property's type to <tt>xs:ID</tt></p>
+ * <pre>
+ * // Example: code fragment
+ * public class Customer {
+ * @XmlAttribute
+ * @XmlID
+ * public String getCustomerID();
+ * public void setCustomerID(String id);
+ * .... other properties not shown
+ * }
+ *
+ * <!-- Example: XML Schema fragment -->
+ * <xs:complexType name="Customer">
+ * <xs:complexContent>
+ * <xs:sequence>
+ * ....
+ * </xs:sequence>
+ * <xs:attribute name="customerID" type="xs:ID"/>
+ * </xs:complexContent>
+ * </xs:complexType>
+ * </pre>
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @see XmlIDREF
+ * @since JAXB2.0
+ * @version $Revision$
+ */
+
+ at Retention(RUNTIME) @Target({FIELD, METHOD})
+public @interface XmlID { }
+
+
+
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlID.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlIDREF.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlIDREF.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlIDREF.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,231 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * <p>
+ * Maps a JavaBean property to XML IDREF.
+ *
+ * <p>
+ * To preserve referential integrity of an object graph across XML
+ * serialization followed by a XML deserialization, requires an object
+ * reference to be marshalled by reference or containment
+ * appropriately. Annotations <tt>@XmlID</tt> and <tt>@XmlIDREF</tt>
+ * together allow a customized mapping of a JavaBean property's
+ * type by containment or reference.
+ *
+ * <p><b>Usage</b> </p>
+ * The <tt>@XmlIDREF</tt> annotation can be used with the following
+ * program elements:
+ * <ul>
+ * <li> a JavaBean property </li>
+ * <li> non static, non transient field </li>
+ * </ul>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <p> The usage is subject to the following constraints:
+ * <ul>
+ *
+ * <li> If the type of the field or property is a collection type,
+ * then the collection item type must contain a property or
+ * field annotated with <tt>@XmlID</tt>. </li>
+ * <li> If the field or property is single valued, then the type of
+ * the property or field must contain a property or field
+ * annotated with <tt>@XmlID</tt>.
+ * <p>Note: If the collection item type or the type of the
+ * property (for non collection type) is java.lang.Object, then
+ * the instance must contain a property/field annotated with
+ * <tt>@XmlID</tt> attribute.
+ * </li>
+ * <li> This annotation can be used with the following annotations:
+ * {@link XmlElement}, {@link XmlAttribute}, {@link XmlList},
+ * and {@link XmlElements}.</li>
+ *
+ * </ul>
+ * <p><b>Example:</b> Map a JavaBean property to <tt>xs:IDREF</tt>
+ * (i.e. by reference rather than by containment)</p>
+ * <pre>
+ *
+ * //EXAMPLE: Code fragment
+ * public class Shipping {
+ * @XmlIDREF public Customer getCustomer();
+ * public void setCustomer(Customer customer);
+ * ....
+ * }
+ *
+ * <!-- Example: XML Schema fragment -->
+ * <xs:complexType name="Shipping">
+ * <xs:complexContent>
+ * <xs:sequence>
+ * <xs:element name="customer" type="xs:IDREF"/>
+ * ....
+ * </xs:sequence>
+ * </xs:complexContent>
+ * </xs:complexType>
+ *
+ * </pre>
+ *
+ *
+ * <p><b>Example 2: </b> The following is a complete example of
+ * containment versus reference.
+ *
+ * <pre>
+ * // By default, Customer maps to complex type <tt>xs:Customer</tt>
+ * public class Customer {
+ *
+ * // map JavaBean property type to <tt>xs:ID</tt>
+ * @XmlID public String getCustomerID();
+ * public void setCustomerID(String id);
+ *
+ * // .... other properties not shown
+ * }
+ *
+ *
+ * // By default, Invoice maps to a complex type <tt>xs:Invoice</tt>
+ * public class Invoice {
+ *
+ * // map by reference
+ * @XmlIDREF public Customer getCustomer();
+ * public void setCustomer(Customer customer);
+ *
+ * // .... other properties not shown here
+ * }
+ *
+ * // By default, Shipping maps to complex type <tt>xs:Shipping</tt>
+ * public class Shipping {
+ *
+ * // map by reference
+ * @XmlIDREF public Customer getCustomer();
+ * public void setCustomer(Customer customer);
+ * }
+ *
+ * // at least one class must reference Customer by containment;
+ * // Customer instances won't be marshalled.
+ * @XmlElement(name="CustomerData")
+ * public class CustomerData {
+ * // map reference to Customer by containment by default.
+ * public Customer getCustomer();
+ *
+ * // maps reference to Shipping by containment by default.
+ * public Shipping getShipping();
+ *
+ * // maps reference to Invoice by containment by default.
+ * public Invoice getInvoice();
+ * }
+ *
+ * <!-- XML Schema mapping for above code frament -->
+ *
+ * <xs:complexType name="Invoice">
+ * <xs:complexContent>
+ * <xs:sequence>
+ * <xs:element name="customer" type="xs:IDREF"/>
+ * ....
+ * </xs:sequence>
+ * </xs:complexContent>
+ * </xs:complexType>
+ *
+ * <xs:complexType name="Shipping">
+ * <xs:complexContent>
+ * <xs:sequence>
+ * <xs:element name="customer" type="xs:IDREF"/>
+ * ....
+ * </xs:sequence>
+ * </xs:complexContent>
+ * </xs:complexType>
+ *
+ * <xs:complexType name="Customer">
+ * <xs:complexContent>
+ * <xs:sequence>
+ * ....
+ * </xs:sequence>
+ * <xs:attribute name="CustomerID" type="xs:ID"/>
+ * </xs:complexContent>
+ * </xs:complexType>
+ *
+ * <xs:complexType name="CustomerData">
+ * <xs:complexContent>
+ * <xs:sequence>
+ * <xs:element name="customer" type="xs:Customer"/>
+ * <xs:element name="shipping" type="xs:Shipping"/>
+ * <xs:element name="invoice" type="xs:Invoice"/>
+ * </xs:sequence>
+ * </xs:complexContent>
+ * </xs:complexType>
+ *
+ * <xs:element name"customerData" type="xs:CustomerData"/>
+ *
+ * <!-- Instance document conforming to the above XML Schema -->
+ * <customerData>
+ * <customer customerID="Alice">
+ * ....
+ * </customer>
+ *
+ * <shipping customer="Alice">
+ * ....
+ * </shipping>
+ *
+ * <invoice customer="Alice">
+ * ....
+ * </invoice>
+ * </customerData>
+ *
+ * </pre>
+ *
+ * <p><b>Example 3: </b> Mapping List to repeating element of type IDREF
+ * <pre>
+ * // Code fragment
+ * public class Shipping {
+ * @XmlIDREF
+ * @XmlElement(name="Alice")
+ * public List customers;
+ * }
+ *
+ * <!-- XML schema fragment -->
+ * <xs:complexType name="Shipping">
+ * <xs:sequence>
+ * <xs:choice minOccurs="0" maxOccurs="unbounded">
+ * <xs:element name="Alice" type="xs:IDREF"/>
+ * </xs:choice>
+ * </xs:sequence>
+ * </xs:complexType>
+ * </pre>
+ *
+ * <p><b>Example 4: </b> Mapping a List to a list of elements of type IDREF.
+ * <pre>
+ * //Code fragment
+ * public class Shipping {
+ * @XmlIDREF
+ * @XmlElements(
+ * @XmlElement(name="Alice", type="Customer.class")
+ * @XmlElement(name="John", type="InternationalCustomer.class")
+ * public List customers;
+ * }
+ *
+ * <!-- XML Schema fragment -->
+ * <xs:complexType name="Shipping">
+ * <xs:sequence>
+ * <xs:choice minOccurs="0" maxOccurs="unbounded">
+ * <xs:element name="Alice" type="xs:IDREF"/>
+ * <xs:element name="John" type="xs:IDREF"/>
+ * </xs:choice>
+ * </xs:sequence>
+ * </xs:complexType>
+ * </pre>
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @see XmlID
+ * @since JAXB2.0
+ * @version $Revision$
+ */
+
+ at Retention(RUNTIME) @Target({FIELD, METHOD})
+public @interface XmlIDREF {}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlIDREF.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlInlineBinaryData.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlInlineBinaryData.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlInlineBinaryData.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import java.awt.*;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+
+import javax.xml.transform.Source;
+import javax.xml.bind.attachment.AttachmentMarshaller;
+import javax.activation.DataHandler;
+
+/**
+ * Disable consideration of XOP encoding for datatypes that are bound to
+ * base64-encoded binary data in XML.
+ *
+ * <p>
+ * When XOP encoding is enabled as described in {@link AttachmentMarshaller#isXOPPackage()}, this annotation disables datatypes such as {@link Image} or {@link Source} or <tt>byte[]</tt> that are bound to base64-encoded binary from being considered for
+ * XOP encoding. If a JAXB property is annotated with this annotation or if
+ * the JAXB property's base type is annotated with this annotation,
+ * neither
+ * {@link AttachmentMarshaller#addMtomAttachment(DataHandler, String, String)}
+ * nor
+ * {@link AttachmentMarshaller#addMtomAttachment(byte[], int, int, String, String, String)} is
+ * ever called for the property. The binary data will always be inlined.
+ *
+ * @author Joseph Fialli
+ * @since JAXB2.0
+ */
+ at Retention(RUNTIME)
+ at Target({FIELD,METHOD,TYPE})
+public @interface XmlInlineBinaryData {
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlInlineBinaryData.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlList.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlList.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlList.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,86 @@
+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.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+
+/**
+ * Used to map a property to a list simple type.
+ *
+ * <p><b>Usage</b> </p>
+ * <p>
+ * The <tt>@XmlList</tt> annotation can be used with the
+ * following program elements:
+ * <ul>
+ * <li> JavaBean property </li>
+ * <li> field </li>
+ * </ul>
+ *
+ * <p>
+ * When a collection property is annotated just with @XmlElement,
+ * each item in the collection will be wrapped by an element.
+ * For example,
+ *
+ * <pre>
+ * @XmlRootElement
+ * class Foo {
+ * @XmlElement
+ * List<String> data;
+ * }
+ * </pre>
+ *
+ * would produce XML like this:
+ *
+ * <pre><xmp>
+ * <foo>
+ * <data>abc</data>
+ * <data>def</data>
+ * </foo>
+ * </xmp></pre>
+ *
+ * @XmlList annotation, on the other hand, allows multiple values to be
+ * represented as whitespace-separated tokens in a single element. For example,
+ *
+ * <pre>
+ * @XmlRootElement
+ * class Foo {
+ * @XmlElement
+ * @XmlList
+ * List<String> data;
+ * }
+ * </pre>
+ *
+ * the above code will produce XML like this:
+ *
+ * <pre><xmp>
+ * <foo>
+ * <data>abc def</data>
+ * </foo>
+ * </xmp></pre>
+ *
+ * <p>This annotation can be used with the following annotations:
+ * {@link XmlElement},
+ * {@link XmlAttribute},
+ * {@link XmlValue},
+ * {@link XmlIDREF}.
+ * <ul>
+ * <li> The use of <tt>@XmlList</tt> with {@link XmlValue} while
+ * allowed, is redundant since {@link XmlList} maps a
+ * collection type to a simple schema type that derives by
+ * list just as {@link XmlValue} would. </li>
+ *
+ * <li> The use of <tt>@XmlList</tt> with {@link XmlAttribute} while
+ * allowed, is redundant since {@link XmlList} maps a
+ * collection type to a simple schema type that derives by
+ * list just as {@link XmlAttribute} would. </li>
+ * </ul>
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+ * @since JAXB2.0
+ */
+ at Retention(RUNTIME) @Target({FIELD,METHOD,PARAMETER})
+public @interface XmlList {
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlList.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlMimeType.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlMimeType.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlMimeType.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import java.awt.*;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+
+import javax.xml.transform.Source;
+
+/**
+ * Associates the MIME type that controls the XML representation of the property.
+ *
+ * <p>
+ * This annotation is used in conjunction with datatypes such as
+ * {@link Image} or {@link Source} that are bound to base64-encoded binary in XML.
+ *
+ * <p>
+ * If a property that has this annotation has a sibling property bound to
+ * the xmime:contentType attribute, and if in the instance the property has a value,
+ * the value of the attribute takes precedence and that will control the marshalling.
+ *
+ * @author Kohsuke Kawaguchi
+ * @since JAXB2.0
+ */
+ at Retention(RUNTIME)
+ at Target({FIELD,METHOD,PARAMETER})
+public @interface XmlMimeType {
+ /**
+ * The textual representation of the MIME type,
+ * such as "image/jpeg" "image/*", "text/xml; charset=iso-8859-1" and so on.
+ */
+ String value();
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlMimeType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlMixed.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlMixed.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlMixed.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+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.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+
+import org.w3c.dom.Element;
+import javax.xml.bind.JAXBElement;
+
+/**
+ * <p>
+ * Annotate a JavaBean multi-valued property to support mixed content.
+ *
+ * <p>
+ * The usage is subject to the following constraints:
+ * <ul>
+ * <li> can be used with @XmlElementRef, @XmlElementRefs or @XmlAnyElement</li>
+ * </ul>
+ * <p>
+ * The following can be inserted into @XmlMixed annotated multi-valued property
+ * <ul>
+ * <li>XML text information items are added as values of java.lang.String.</li>
+ * <li>Children element information items are added as instances of
+ * {@link JAXBElement} or instances with a class that is annotated with
+ * @XmlRootElement.</li>
+ * <li>Unknown content that is not be bound to a JAXB mapped class is inserted
+ * as {@link Element}. (Assumes property annotated with @XmlAnyElement)</li>
+ * </ul>
+ *
+ * Below is an example of binding and creation of mixed content.
+ * <pre><xmp>
+ * <!-- schema fragment having mixed content -->
+ * <xs:complexType name="letterBody" mixed="true">
+ * <xs:sequence>
+ * <xs:element name="name" type="xs:string"/>
+ * <xs:element name="quantity" type="xs:positiveInteger"/>
+ * <xs:element name="productName" type="xs:string"/>
+ * <!-- etc. -->
+ * </xs:sequence>
+ * </xs:complexType>
+ * <xs:element name="letterBody" type="letterBody"/>
+ *
+ * // Schema-derived Java code:
+ * // (Only annotations relevant to mixed content are shown below,
+ * // others are ommitted.)
+ * import java.math.BigInteger;
+ * public class ObjectFactory {
+ * // element instance factories
+ * JAXBElement<LetterBody> createLetterBody(LetterBody value);
+ * JAXBElement<String> createLetterBodyName(String value);
+ * JAXBElement<BigInteger> createLetterBodyQuantity(BigInteger value);
+ * JAXBElement<String> createLetterBodyProductName(String value);
+ * // type instance factory
+ * LetterBody> createLetterBody();
+ * }
+ * </xmp></pre>
+ * <pre>
+ * public class LetterBody {
+ * // Mixed content can contain instances of Element classes
+ * // Name, Quantity and ProductName. Text data is represented as
+ * // java.util.String for text.
+ * @XmlMixed
+ * @XmlElementRefs({
+ * @XmlElementRef(name="productName", type=JAXBElement.class),
+ * @XmlElementRef(name="quantity", type=JAXBElement.class),
+ * @XmlElementRef(name="name", type=JAXBElement.class)})
+ * List getContent(){...}
+ * }
+ * </pre>
+ * The following is an XML instance document with mixed content
+ * <pre><xmp>
+ * <letterBody>
+ * Dear Mr.<name>Robert Smith</name>
+ * Your order of <quantity>1</quantity> <productName>Baby
+ * Monitor</productName> shipped from our warehouse. ....
+ * </letterBody>
+ * </xmp></pre>
+ * that can be constructed using following JAXB API calls.
+ * <pre><xmp>
+ * LetterBody lb = ObjectFactory.createLetterBody();
+ * JAXBElement<LetterBody> lbe = ObjectFactory.createLetterBody(lb);
+ * List gcl = lb.getContent(); //add mixed content to general content property.
+ * gcl.add("Dear Mr."); // add text information item as a String.
+ *
+ * // add child element information item
+ * gcl.add(ObjectFactory.createLetterBodyName("Robert Smith"));
+ * gcl.add("Your order of "); // add text information item as a String
+ *
+ * // add children element information items
+ * gcl.add(ObjectFactory.
+ * createLetterBodyQuantity(new BigInteger("1")));
+ * gcl.add(ObjectFactory.createLetterBodyProductName("Baby Monitor"));
+ * gcl.add("shipped from our warehouse"); // add text information item
+ * </xmp></pre>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ * @author Kohsuke Kawaguchi
+ * @since JAXB2.0
+ */
+ at Retention(RUNTIME)
+ at Target({FIELD,METHOD})
+public @interface XmlMixed {
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlMixed.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlNs.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlNs.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlNs.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * <p>
+ * Associates a namespace prefix with a XML namespace URI.
+ *
+ * <p><b>Usage</b></p>
+ * <p><tt>@XmlNs</tt> annotation is intended for use from other
+ * program annotations.
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <p><b>Example:</b>See <tt>XmlSchema</tt> annotation type for an example.
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since JAXB2.0
+ * @version $Revision$
+ */
+
+ at Retention(RUNTIME) @Target({})
+public @interface XmlNs {
+ /**
+ * Namespace prefix
+ */
+ String prefix();
+
+ /**
+ * Namespace URI
+ */
+ String namespaceURI();
+}
+
+
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlNs.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlNsForm.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlNsForm.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlNsForm.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+/**
+ * Enumeration of XML Schema namespace qualifications.
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <p><b>Usage</b>
+ * <p>
+ * The namespace qualification values are used in the annotations
+ * defined in this packge. The enumeration values are mapped as follows:
+ *
+ * <p>
+ * <table border="1" cellpadding="4" cellspacing="3">
+ * <tbody>
+ * <tr>
+ * <td><b>Enum Value<b></td>
+ * <td><b>XML Schema Value<b></td>
+ * </tr>
+ *
+ * <tr valign="top">
+ * <td>UNQUALIFIED</td>
+ * <td>unqualified</td>
+ * </tr>
+ * <tr valign="top">
+ * <td>QUALIFIED</td>
+ * <td>qualified</td>
+ * </tr>
+ * <tr valign="top">
+ * <td>UNSET</td>
+ * <td>namespace qualification attribute is absent from the
+ * XML Schema fragment</td>
+ * </tr>
+ * </tbody>
+ * </table>
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since JAXB2.0
+ * @version $Revision$
+ */
+public enum XmlNsForm {UNQUALIFIED, QUALIFIED, UNSET}
+
+
+
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlNsForm.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlRegistry.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlRegistry.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlRegistry.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Marks a class that has {@link XmlElementDecl}s.
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+ * @since JAXB 2.0
+ * @see XmlElementDecl
+ */
+ at Retention(RUNTIME)
+ at Target({TYPE})
+public @interface XmlRegistry {
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlRegistry.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlRootElement.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlRootElement.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlRootElement.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,162 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+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.TYPE;
+
+/**
+ * Maps a class or an enum type to an XML element.
+ *
+ * <p> <b>Usage</b> </p>
+ * <p>
+ * The @XmlRootElement annotation can be used with the following program
+ * elements:
+ * <ul>
+ * <li> a top level class </li>
+ * <li> an enum type </li>
+ * </ul>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <p>
+ * When a top level class or an enum type is annotated with the
+ * @XmlRootElement annotation, then its value is represented
+ * as XML element in an XML document.
+ *
+ * <p> This annotation can be used with the following annotations:
+ * {@link XmlType}, {@link XmlEnum}, {@link XmlAccessorType},
+ * {@link XmlAccessorOrder}.
+ * <p>
+
+ * <p>
+ * <b>Example 1: </b> Associate an element with XML Schema type
+ * <pre>
+ * // Example: Code fragment
+ * @XmlRootElement
+ * class Point {
+ * int x;
+ * int y;
+ * Point(int _x,int _y) {x=_x;y=_y;}
+ * }
+ * </pre>
+ *
+ * <pre>
+ * //Example: Code fragment corresponding to XML output
+ * marshal( new Point(3,5), System.out);
+ * </pre>
+ *
+ * <pre><xmp>
+ * <!-- Example: XML output -->
+ * <point>
+ * <x> 3 </x>
+ * <y> 5 </y>
+ * </point>
+ * </xmp></pre>
+ *
+ * The annotation causes an global element declaration to be produced
+ * in the schema. The global element declaration is associated with
+ * the XML schema type to which the class is mapped.
+ *
+ * <pre><xmp>
+ * <!-- Example: XML schema definition -->
+ * <xs:element name="point" type="point"/>
+ * <xs:complexType name="point">
+ * <xs:sequence>
+ * <xs:element name="x" type="xs:int"/>
+ * <xs:element name="y" type="xs:int"/>
+ * </xs:sequence>
+ * </xs:complexType>
+ * </xmp></pre>
+ *
+ * <p>
+ *
+ * <b>Example 2: Orthogonality to type inheritance </b>
+ *
+ * <p>
+ * An element declaration annotated on a type is not inherited by its
+ * derived types. The following example shows this.
+ * <pre>
+ * // Example: Code fragment
+ * @XmlRootElement
+ * class Point3D extends Point {
+ * int z;
+ * Point3D(int _x,int _y,int _z) {super(_x,_y);z=_z;}
+ * }
+ *
+ * //Example: Code fragment corresponding to XML output *
+ * marshal( new Point3D(3,5,0), System.out );
+ *
+ * <!-- Example: XML output -->
+ * <!-- The element name is point3D not point -->
+ * <point3D>
+ * <x>3</x>
+ * <y>5</y>
+ * <z>0</z>
+ * </point3D>
+ *
+ * <!-- Example: XML schema definition -->
+ * <xs:element name="point3D" type="point3D"/>
+ * <xs:complexType name="point3D">
+ * <xs:complexContent>
+ * <xs:extension base="point">
+ * <xs:sequence>
+ * <xs:element name="z" type="xs:int"/>
+ * </xs:sequence>
+ * </xs:extension>
+ * </xs:complexContent>
+ * </xs:complexType>
+ * </pre>
+ *
+ * <b>Example 3: </b> Associate a global element with XML Schema type
+ * to which the class is mapped.
+ * <pre>
+ * //Example: Code fragment
+ * @XmlRootElement(name="PriceElement")
+ * public class USPrice {
+ * @XmlElement
+ * public java.math.BigDecimal price;
+ * }
+ *
+ * <!-- Example: XML schema definition -->
+ * <xs:element name="PriceElement" type="USPrice"/>
+ * <xs:complexType name="USPrice">
+ * <xs:sequence>
+ * <xs:element name="price" type="xs:decimal"/>
+ * </sequence>
+ * </xs:complexType>
+ * </pre>
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since JAXB2.0
+ */
+ at Retention(RUNTIME)
+ at Target({TYPE})
+public @interface XmlRootElement {
+ /**
+ * namespace name of the XML element.
+ * <p>
+ * If the value is "##default", then the XML namespace name is derived
+ * from the package of the class ( {@link XmlSchema} ). If the
+ * package is unnamed, then the XML namespace is the default empty
+ * namespace.
+ */
+ String namespace() default "##default";
+
+ /**
+ * local name of the XML element.
+ * <p>
+ * If the value is "##default", then the name is derived from the
+ * class name.
+ *
+ */
+ String name() default "##default";
+
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlRootElement.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlSchema.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlSchema.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlSchema.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+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.*;
+
+/**
+ * <p> Maps a package name to a XML namespace. </p>
+ *
+ * <p><b>Usage</b> </p>
+ * <p>
+ * The XmlSchema annotation can be used with the following program
+ * elements:
+ * <ul>
+ * <li>package</li>
+ * </ul>
+ *
+ * This is a package level annotation and follows the recommendations
+ * and restrictions contained in JSR 175, section III, "Annotations".
+ * Thus the usage is subject to the following constraints and
+ * recommendations.
+ * <ul>
+ * <li> There can only be one package declaration as noted in JSR
+ * 175, section III, "Annotations". </li>
+ * <li> JSR 175 recommends package-info.java for package level
+ * annotations. JAXB Providers that follow this recommendation
+ * will allow the package level annotations to be defined in
+ * package-info.java.
+ * </ul>
+ * <p>
+ *
+ * <p><b>Example 1:</b> Customize name of XML namespace to which
+ * package is mapped.</p>
+ *
+ * <pre>
+ * @javax.xml.bind.annotation.XmlSchema (
+ * namespace = "http://www.example.com/MYPO1"
+ * )
+ *
+ * <!-- XML Schema fragment -->
+ * <schema
+ * xmlns=...
+ * xmlns:po=....
+ * targetNamespace="http://www.example.com/MYPO1"
+ * >
+ * <!-- prefixes generated by default are implementation
+ * depedenent -->
+ * </pre>
+ *
+ * <p><b>Example 2:</b> Customize namespace prefix, namespace URI
+ * mapping</p>
+ *
+ * <pre>
+ * // Package level annotation
+ * @javax.xml.bind.annotation.XmlSchema (
+ * xmlns = {
+ * @javax.xml.bind.annotation.XmlNs(prefix = "po",
+ * namespaceURI="http://www.example.com/myPO1"),
+ *
+ * @javax.xml.bind.annotation.XmlNs(prefix="xs",
+ * namespaceURI="http://www.w3.org/2001/XMLSchema")
+ * )
+ * )
+ *
+ * <!-- XML Schema fragment -->
+ * <schema
+ * xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ * xmlns:po="http://www.example.com/PO1"
+ * targetNamespace="http://www.example.com/PO1">
+ *
+ * </pre>
+ *
+ * <p><b>Example 3:</b> Customize elementFormDefault</p>
+ * <pre>
+ * @javax.xml.bind.annotation.XmlSchema (
+ * elementFormDefault=XmlNsForm.UNQUALIFIED
+ * ...
+ * )
+ *
+ * <!-- XML Schema fragment -->
+ * <schema
+ * xmlns="http://www.w3.org/2001/XMLSchema"
+ * xmlns:po="http://www.example.com/PO1"
+ * elementFormDefault="unqualified">
+ *
+ * </pre>
+
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since JAXB2.0
+ * @version $Revision$
+ */
+
+ at Retention(RUNTIME) @Target({PACKAGE})
+public @interface XmlSchema {
+
+ /**
+ * Customize the namespace URI, prefix associations. By default,
+ * the namespace prefixes for a XML namespace are generated by a
+ * JAXB Provider in an implementation dependent way.
+ */
+ XmlNs[] xmlns() default {};
+
+ /**
+ * Name of the XML namespace.
+ */
+ String namespace() default "";
+
+ /**
+ * Namespace qualification for elements. By default, element
+ * default attribute will be absent from the XML Schema fragment.
+ */
+ XmlNsForm elementFormDefault() default XmlNsForm.UNSET;
+
+ /**
+ * Namespace qualification for attributes. By default,
+ * attributesFormDefault will be absent from the XML Schema fragment.
+ */
+ XmlNsForm attributeFormDefault() default XmlNsForm.UNSET;
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlSchema.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+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.ElementType.PACKAGE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Maps a Java type to a simple schema built-in type.
+ *
+ * <p> <b>Usage</b> </p>
+ * <p>
+ * <tt>@XmlSchemaType</tt> annotation can be used with the following program
+ * elements:
+ * <ul>
+ * <li> a JavaBean property </li>
+ * <li> field </li>
+ * <li> package</li>
+ * </ul>
+ *
+ * <p> <tt>@XmlSchemaType</tt> annotation defined for Java type
+ * applies to all references to the Java type from a property/field.
+ * A <tt>@XmlSchemaType</tt> annotation specified on the
+ * property/field overrides the <tt>@XmlSchemaType</tt> annotation
+ * specified at the package level.
+ *
+ * <p> This annotation can be used with the following annotations:
+ * {@link XmlElement}, {@link XmlAttribute}.
+ * <p>
+ * <b>Example 1: </b> Customize mapping of XMLGregorianCalendar on the
+ * field.
+ *
+ * <pre>
+ * //Example: Code fragment
+ * public class USPrice {
+ * @XmlElement
+ * @XmlSchemaType(name="date")
+ * public XMLGregorianCalendar date;
+ * }
+ *
+ * <!-- Example: Local XML Schema element -->
+ * <xs:complexType name="USPrice"/>
+ * <xs:sequence>
+ * <xs:element name="date" type="xs:date"/>
+ * </sequence>
+ * </xs:complexType>
+ * </pre>
+ *
+ * <p> <b> Example 2: </b> Customize mapping of XMLGregorianCalendar at package
+ * level </p>
+ * <pre>
+ * package foo;
+ * @javax.xml.bind.annotation.XmlSchemaType(
+ * name="date", type=javax.xml.datatype.XMLGregorianCalendar.class)
+ * }
+ * </pre>
+ *
+ * @since JAXB2.0
+ */
+
+ at Retention(RUNTIME) @Target({FIELD,METHOD,PACKAGE})
+public @interface XmlSchemaType {
+ String name();
+ String namespace() default "http://www.w3.org/2001/XMLSchema";
+ /**
+ * If this annotation is used at the package level, then value of
+ * the type() must be specified.
+ */
+
+ Class type() default DEFAULT.class;
+
+ /**
+ * Used in {@link XmlSchemaType#type()} to
+ * signal that the type be inferred from the signature
+ * of the property.
+ */
+
+ static final class DEFAULT {}
+
+}
+
+
+
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlSchemaType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlSchemaTypes.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlSchemaTypes.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlSchemaTypes.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.PACKAGE;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * <p>
+ * A container for multiple @{@link XmlSchemaType} annotations.
+ *
+ * <p> Multiple annotations of the same type are not allowed on a program
+ * element. This annotation therefore serves as a container annotation
+ * for multiple @XmlSchemaType annotations as follows:
+ *
+ * <pre>
+ * @XmlSchemaTypes({ @XmlSchemaType(...), @XmlSchemaType(...) })
+ * </pre>
+ * <p>The <tt>@XmlSchemaTypes</tt> annnotation can be used to
+ * define {@link XmlSchemaType} for different types at the
+ * package level.
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * @author <ul><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+ * @see XmlSchemaType
+ * @since JAXB2.0
+ */
+ at Retention(RUNTIME) @Target({PACKAGE})
+public @interface XmlSchemaTypes {
+ /**
+ * Collection of @{@link XmlSchemaType} annotations
+ */
+ XmlSchemaType[] value();
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlSchemaTypes.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlTransient.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlTransient.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlTransient.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * <p>
+ * Prevents the mapping of a JavaBean property to XML representation.
+ * <p>
+ * The <tt>@XmlTransient</tt> annotation is useful for resolving name
+ * collisions between a JavaBean property name and a field name or
+ * preventing the mapping of a field/property. A name collision can
+ * occur when the decapitalized JavaBean property name and a field
+ * name are the same. If the JavaBean property refers to the field,
+ * then the name collision can be resolved by preventing the
+ * mapping of either the field or the JavaBean property using the
+ * <tt>@XmlTransient</tt> annotation.
+ * <p><b>Usage</b></p>
+ * <p> The <tt>@XmlTransient</tt> annotation can be used with the following
+ * program elements:
+ * <ul>
+ * <li> a JavaBean property </li>
+ * <li> field </li>
+ * </ul>
+ *
+ * <p><tt>@XmlTransient</tt>is mutually exclusive with all other
+ * JAXB defined annotations. </p>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <p><b>Example:</b> Resolve name collision between JavaBean property and
+ * field name </p>
+ *
+ * <pre>
+ * // Example: Code fragment
+ * public class USAddress {
+ *
+ * // The field name "name" collides with the property name
+ * // obtained by bean decapitalization of getName() below
+ * @XmlTransient public String name;
+ *
+ * String getName() {..};
+ * String setName() {..};
+ * }
+ *
+ *
+ * <!-- Example: XML Schema fragment -->
+ * <xs:complexType name="USAddress">
+ * <xs:sequence>
+ * <xs:element name="name" type="xs:string"/>
+ * </xs:sequence>
+ * </xs:complexType>
+ * </pre>
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @since JAXB2.0
+ * @version $Revision$
+ */
+
+ at Retention(RUNTIME) @Target({FIELD, METHOD})
+public @interface XmlTransient {}
+
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlTransient.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlType.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlType.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlType.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,435 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * <p>
+ * Maps a class or an enum type to a XML Schema type.
+ *
+ * <p><b>Usage</b></p>
+ * <p> The <tt>@XmlType</tt> annnotation can be used with the following program
+ * elements:
+ * <ul>
+ * <li> a top level class </li>
+ * <li> an enum type </li>
+ * </ul>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * <h3> Mapping a Class </h3>
+ * <p>
+ * A class maps to a XML Schema type. A class is a data container for
+ * values represented by properties and fields. A schema type is a
+ * data container for values represented by schema components within a
+ * schema type's content model (e.g. model groups, attributes etc).
+ * <p> To be mapped, a class must either have a public no-arg
+ * constructor or a static no-arg factory method. The static factory
+ * method can be specified in <tt>factoryMethod()</tt> and
+ * <tt>factoryClass()</tt> annotation elements. The static factory
+ * method or the no-arg constructor is used during unmarshalling to
+ * create an instance of this class. If both are present, the static
+ * factory method overrides the no-arg constructor.
+ * <p>
+ * A class maps to either a XML Schema complex type or a XML Schema simple
+ * type. The XML Schema type is derived based on the
+ * mapping of JavaBean properties and fields contained within the
+ * class. The schema type to which the class is mapped can either be
+ * named or anonymous. A class can be mapped to an anonymous schema
+ * type by annotating the class with <tt>@XmlType(name="")</tt>.
+ * <p>
+ * Either a global element, local element or a local attribute can be
+ * associated with an anonymous type as follows:
+ * <ul>
+ * <li><b>global element: </b> A global element of an anonymous
+ * type can be derived by annotating the class with @{@link
+ * XmlRootElement}. See Example 3 below. </li>
+ *
+ * <li><b>local element: </b> A JavaBean property that references
+ * a class annotated with @XmlType(name="") and is mapped to the
+ * element associated with the anonymous type. See Example 4
+ * below.</li>
+ *
+ * <li><b>attribute: </b> A JavaBean property that references
+ * a class annotated with @XmlType(name="") and is mapped to the
+ * attribute associated with the anonymous type. See Example 5 below. </li>
+ * </ul>
+ * <b> Mapping to XML Schema Complex Type </b>
+ * <ul>
+ * <li>If class is annotated with <tt>@XmlType(name="") </tt>, it
+ * is mapped to an anonymous type otherwise, the class name maps
+ * to a complex type name. The <tt>XmlName()</tt> annotation element
+ * can be used to customize the name.</li>
+ *
+ * <li> Properties and fields that are mapped to elements are mapped to a
+ * content model within a complex type. The annotation element
+ * <tt>propOrder()</tt> can be used to customize the content model to be
+ * <tt>xs:all</tt> or <tt>xs:sequence</tt>. It is used for specifying
+ * the order of XML elements in <tt>xs:sequence</tt>. </li>
+ *
+ * <li> Properties and fields can be mapped to attributes within the
+ * complex type. </li>
+ *
+ * <li> The targetnamespace of the XML Schema type can be customized
+ * using the annotation element <tt>namespace()</tt>. </li>
+ * </ul>
+ *
+ * <p>
+ * <b> Mapping class to XML Schema simple type </b>
+ * <p>
+ * A class can be mapped to a XML Schema simple type using the
+ * <tt>@XmlValue</tt> annotation. For additional details and examples,
+ * see @{@link XmlValue} annotation type.
+ * <p>
+ * The following table shows the mapping of the class to a XML Schema
+ * complex type or simple type. The notational symbols used in the table are:
+ * <ul>
+ * <li> -> : represents a mapping </li>
+ * <li> [x]+ : one or more occurances of x </li>
+ * <li> [ <tt>@XmlValue</tt> property ]: JavaBean property annotated with
+ * <tt>@XmlValue</tt></li>
+ * <li> X : don't care
+ * </ul>
+ * <blockquote>
+ * <table border="1" cellpadding="4" cellspacing="3">
+ * <tbody>
+ * <tr>
+ * <td><b>Target</td>
+ * <td><b>propOrder</b></td>
+ * <td><b>ClassBody</b></td>
+ * <td><b>ComplexType</b></td>
+ * <td><b>SimpleType</b></td>
+ * </tr>
+ *
+ * <tr valign="top">
+ * <td>Class</td>
+ * <td>{}</td>
+ * <td>[property]+ -> elements</td>
+ * <td>complexcontent<br>xs:all</td>
+ * <td> </td>
+ * </tr>
+ *
+ * <tr valign="top">
+ * <td>Class</td>
+ * <td>non empty</td>
+ * <td>[property]+ -> elements</td>
+ * <td>complexcontent<br>xs:sequence</td>
+ * <td> </td>
+ * </tr>
+ *
+ * <tr valign="top">
+ * <td>Class</td>
+ * <td>X</td>
+ * <td>no property -> element</td>
+ * <td>complexcontent<br>empty sequence</td>
+ * <td> </td>
+ * </tr>
+ *
+ * <tr valign="top">
+ * <td>Class</td>
+ * <td>X</td>
+ * <td>1 [ <tt>@XmlValue</tt> property] && <br> [property]+
+ * ->attributes</td>
+ * <td>simplecontent</td>
+ * <td> </td>
+ * </tr>
+ *
+ * <tr valign="top">
+ * <td>Class</td>
+ * <td>X</td>
+ * <td>1 [ <tt>@XmlValue</tt> property ]&& <br> no properties
+ * -> attribute</td>
+ * <td> </td>
+ * <td>simpletype</td>
+ * <td> </td>
+ * </tr>
+ * </tbody>
+ * </table>
+ * </blockquote>
+ *
+ * <h3> Mapping an enum type </h3>
+ *
+ * An enum type maps to a XML schema simple type with enumeration
+ * facets. The following annotation elements are ignored since they
+ * are not meaningful: <tt>propOrder()</tt> , <tt>factoryMethod()</tt> ,
+ * <tt>factoryClass()</tt> .
+ *
+ * <h3> Usage with other annotations </h3>
+ * <p> This annotation can be used with the following annotations:
+ * {@link XmlRootElement}, {@link XmlAccessorOrder}, {@link XmlAccessorType},
+ * {@link XmlEnum}. However, {@link
+ * XmlAccessorOrder} and {@link XmlAccessorType} are ignored when this
+ * annotation is used on an enum type.
+ *
+ * <p> <b> Example 1: </b> Map a class to a complex type with
+ * xs:sequence with a customized ordering of JavaBean properties.
+ * </p>
+ *
+ * <pre>
+ * @XmlType(propOrder={"street", "city" , "state", "zip", "name" })
+ * public class USAddress {
+ * String getName() {..};
+ * void setName(String) {..};
+ *
+ * String getStreet() {..};
+ * void setStreet(String) {..};
+ *
+ * String getCity() {..};
+ * void setCity(String) {..};
+ *
+ * String getState() {..};
+ * void setState(String) {..};
+ *
+ * java.math.BigDecimal getZip() {..};
+ * void setZip(java.math.BigDecimal) {..};
+ * }
+ *
+ * <!-- XML Schema mapping for USAddress -->
+ * <xs:complexType name="USAddress">
+ * <xs:sequence>
+ * <xs:element name="street" type="xs:string"/>
+ * <xs:element name="city" type="xs:string"/>
+ * <xs:element name="state" type="xs:string"/>
+ * <xs:element name="zip" type="xs:decimal"/>
+ * <xs:element name="name" type="xs:string"/>
+ * </xs:all>
+ * </xs:complexType>
+ * </pre>
+ * <p> <b> Example 2: </b> Map a class to a complex type with
+ * xs:all </p>
+ * <pre>
+ * @XmlType(propOrder={})
+ * public class USAddress { ...}
+ *
+ * <!-- XML Schema mapping for USAddress -->
+ * <xs:complexType name="USAddress">
+ * <xs:all>
+ * <xs:element name="name" type="xs:string"/>
+ * <xs:element name="street" type="xs:string"/>
+ * <xs:element name="city" type="xs:string"/>
+ * <xs:element name="state" type="xs:string"/>
+ * <xs:element name="zip" type="xs:decimal"/>
+ * </xs:sequence>
+ * </xs:complexType>
+ *</pre>
+ * <p> <b> Example 3: </b> Map a class to a global element with an
+ * anonymous type.
+ * </p>
+ * <pre>
+ * @XmlRootElement
+ * @XmlType(name="")
+ * public class USAddress { ...}
+ *
+ * <!-- XML Schema mapping for USAddress -->
+ * <xs:element name="USAddress">
+ * <xs:complexType>
+ * <xs:sequence>
+ * <xs:element name="name" type="xs:string"/>
+ * <xs:element name="street" type="xs:string"/>
+ * <xs:element name="city" type="xs:string"/>
+ * <xs:element name="state" type="xs:string"/>
+ * <xs:element name="zip" type="xs:decimal"/>
+ * </xs:sequence>
+ * </xs:complexType>
+ * </xs:element>
+ * </pre>
+ *
+ * <p> <b> Example 4: </b> Map a property to a local element with
+ * anonmyous type.
+ * <pre>
+ * //Example: Code fragment
+ * public class Invoice {
+ * USAddress addr;
+ * ...
+ * }
+ *
+ * @XmlType(name="")
+ * public class USAddress { ... }
+ * }
+ *
+ * <!-- XML Schema mapping for USAddress -->
+ * <xs:complexType name="Invoice">
+ * <xs:sequence>
+ * <xs:element name="addr">
+ * <xs:complexType>
+ * <xs:element name="name", type="xs:string"/>
+ * <xs:element name="city", type="xs:string"/>
+ * <xs:element name="city" type="xs:string"/>
+ * <xs:element name="state" type="xs:string"/>
+ * <xs:element name="zip" type="xs:decimal"/>
+ * </xs:complexType>
+ * ...
+ * </xs:sequence>
+ * </xs:complexType>
+ * </pre>
+ *
+ * <p> <b> Example 5: </b> Map a property to an attribute with
+ * anonymous type.
+ *
+ * <pre>
+ *
+ * //Example: Code fragment
+ * public class Item {
+ * public String name;
+ * @XmlAttribute
+ * public USPrice price;
+ * }
+ *
+ * // map class to anonymous simple type.
+ * @XmlType(name="")
+ * public class USPrice {
+ * @XmlValue
+ * public java.math.BigDecimal price;
+ * }
+ *
+ * <!-- Example: XML Schema fragment -->
+ * <xs:complexType name="Item">
+ * <xs:sequence>
+ * <xs:element name="name" type="xs:string"/>
+ * <xs:attribute name="price">
+ * <xs:simpleType>
+ * <xs:restriction base="xs:decimal"/>
+ * </xs:simpleType>
+ * </xs:attribute>
+ * </xs:sequence>
+ * </xs:complexType>
+ * </pre>
+ *
+ * <p> <b> Example 6: </b> Define a factoryClass and factoryMethod
+ *
+ * <pre>
+ * @XmlType(name="USAddressType", factoryClass=USAddressFactory.class,
+ * factoryMethod="getUSAddress")
+ * public class USAddress {
+ *
+ * private String city;
+ * private String name;
+ * private String state;
+ * private String street;
+ * private int zip;
+ *
+ * public USAddress(String name, String street, String city,
+ * String state, int zip) {
+ * this.name = name;
+ * this.street = street;
+ * this.city = city;
+ * this.state = state;
+ * this.zip = zip;
+ * }
+ * }
+ *
+ * public class USAddressFactory {
+ * public static USAddress getUSAddress(){
+ * return new USAddress("Mark Baker", "23 Elm St",
+ * "Dayton", "OH", 90952);
+ * }
+ *
+ * </pre>
+ *
+ * <p> <b> Example 7: </b> Define factoryMethod and use the default factoryClass
+ *
+ * <pre>
+ * @XmlType(name="USAddressType", factoryMethod="getNewInstance")
+ * public class USAddress {
+ *
+ * private String city;
+ * private String name;
+ * private String state;
+ * private String street;
+ * private int zip;
+ *
+ * private USAddress() {}
+ *
+ * public static USAddress getNewInstance(){
+ * return new USAddress();
+ * }
+ * }
+ * </pre>
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @see XmlElement
+ * @see XmlAttribute
+ * @see XmlValue
+ * @see XmlSchema
+ * @since JAXB2.0
+ * @version $Revision$
+ */
+
+ at Retention(RUNTIME) @Target({TYPE})
+public @interface XmlType {
+ /**
+ * Name of the XML Schema type which the class is mapped.
+ */
+ String name() default "##default" ;
+
+ /**
+ * Specifies the order for XML Schema elements when class is
+ * mapped to a XML Schema complex type.
+ *
+ * <p> Refer to the table for how the propOrder affects the
+ * mapping of class </p>
+ *
+ * <p> The propOrder is a list of names of JavaBean properties in
+ * the class. Each name in the list is the name of a Java
+ * identifier of the JavaBean property. The order in which
+ * JavaBean properties are listed is the order of XML Schema
+ * elements to which the JavaBean properties are mapped. </p>
+ * <p> All of the JavaBean properties being mapped to XML Schema elements
+ * must be listed.
+ * <p> A JavaBean property or field listed in propOrder must not
+ * be transient or annotated with <tt>@XmlTransient</tt>.
+ * <p> The default ordering of JavaBean properties is determined
+ * by @{@link XmlAccessorOrder}.
+ */
+ String[] propOrder() default {""};
+
+ /**
+ * Name of the target namespace of the XML Schema type. By
+ * default, this is the target namespace to which the package
+ * containing the class is mapped.
+ */
+ String namespace() default "##default" ;
+
+ /**
+ * Class containing a no-arg factory method for creating an
+ * instance of this class. The default is this class.
+ *
+ * <p>If <tt>factoryClass</tt> is DEFAULT.class and
+ * <tt>factoryMethod</tt> is "", then there is no static factory
+ * method.
+ *
+ * <p>If <tt>factoryClass</tt> is DEFAULT.class and
+ * <tt>factoryMethod</tt> is not "", then
+ * <tt>factoryMethod</tt> is the name of a static factory method
+ * in this class.
+ *
+ * <p>If <tt>factoryClass</tt> is not DEFAULT.class, then
+ * <tt>factoryMethod</tt> must not be "" and must be the name of
+ * a static factory method specified in <tt>factoryClass</tt>.
+ */
+ Class factoryClass() default DEFAULT.class;
+
+ /**
+ * Used in {@link XmlType#factoryClass()} to
+ * signal that either factory mehod is not used or
+ * that it's in the class with this {@link XmlType} itself.
+ */
+ static final class DEFAULT {}
+
+ /**
+ * Name of a no-arg factory method in the class specified in
+ * <tt>factoryClass</tt> factoryClass().
+ *
+ */
+ String factoryMethod() default "";
+}
+
+
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlValue.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlValue.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlValue.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * <p>
+ * Enables mapping a class to a XML Schema complex type with a
+ * simpleContent or a XML Schema simple type.
+ * </p>
+ *
+ * <p>
+ * <b> Usage: </b>
+ * <p>
+ * The <tt>@XmlValue</tt> annotation can be used with the following program
+ * elements:
+ * <ul>
+ * <li> a JavaBean property.</li>
+ * <li> non static, non transient field.</li>
+ * </ul>
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * The usage is subject to the following usage constraints:
+ * <ul>
+ * <li>At most one field or property can be annotated with the
+ * <tt>@XmlValue</tt> annotation. </li>
+ *
+ * <li><tt>@XmlValue</tt> can be used with the following
+ * annotations: {@link XmlList}. However this is redundant since
+ * {@link XmlList} maps a type to a simple schema type that derives by
+ * list just as {@link XmlValue} would. </li>
+ *
+ * <li>If the type of the field or property is a collection type,
+ * then the collection item type must map to a simple schema
+ * type. </li>
+ *
+ * <li>If the type of the field or property is not a collection
+ * type, then the type must map to a XML Schema simple type. </li>
+ *
+ * </ul>
+ * </p>
+ * <p>
+ * If the annotated JavaBean property is the sole class member being
+ * mapped to XML Schema construct, then the class is mapped to a
+ * simple type.
+ *
+ * If there are additional JavaBean properties (other than the
+ * JavaBean property annotated with <tt>@XmlValue</tt> annotation)
+ * that are mapped to XML attributes, then the class is mapped to a
+ * complex type with simpleContent.
+ * </p>
+ *
+ * <p> <b> Example 1: </b> Map a class to XML Schema simpleType</p>
+ *
+ * <pre>
+ *
+ * // Example 1: Code fragment
+ * public class USPrice {
+ * @XmlValue
+ * public java.math.BigDecimal price;
+ * }
+ *
+ * <!-- Example 1: XML Schema fragment -->
+ * <xs:simpleType name="USPrice">
+ * <xs:restriction base="xs:decimal"/>
+ * </xs:simpleType>
+ *
+ * </pre>
+ *
+ * <p><b> Example 2: </b> Map a class to XML Schema complexType with
+ * with simpleContent.</p>
+ *
+ * <pre>
+ *
+ * // Example 2: Code fragment
+ * public class InternationalPrice {
+ * @XmlValue
+ * public java.math.BigDecimal price;
+ *
+ * @XmlAttribute
+ * public String currency;
+ * }
+ *
+ * <!-- Example 2: XML Schema fragment -->
+ * <xs:complexType name="InternationalPrice">
+ * <xs:simpleContent>
+ * <xs:extension base="xs:decimal">
+ * <xs:attribute name="currency" type="xs:string"/>
+ * </xs:extension>
+ * </xs:simpleContent>
+ * </xs:complexType>
+ *
+ * </pre>
+ * </p>
+ *
+ * @author Sekhar Vajjhala, Sun Microsystems, Inc.
+ * @see XmlType
+ * @since JAXB2.0
+ * @version $Revision$
+ */
+
+ at Retention(RUNTIME) @Target({FIELD, METHOD})
+public @interface XmlValue {}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/XmlValue.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation.adapters;
+
+
+
+/**
+ * Built-in {@link XmlAdapter} to handle <tt>xs:token</tt> and its derived types.
+ *
+ * <p>
+ * This adapter removes leading and trailing whitespaces, then truncate any
+ * sequnce of tab, CR, LF, and SP by a single whitespace character ' '.
+ *
+ * @author Kohsuke Kawaguchi
+ * @since JAXB 2.0
+ */
+public class CollapsedStringAdapter extends XmlAdapter<String,String> {
+ /**
+ * Removes leading and trailing whitespaces of the string
+ * given as the parameter, then truncate any
+ * sequnce of tab, CR, LF, and SP by a single whitespace character ' '.
+ */
+ public String unmarshal(String text) {
+ if(text==null) return null; // be defensive
+
+ int len = text.length();
+
+ // most of the texts are already in the collapsed form.
+ // so look for the first whitespace in the hope that we will
+ // never see it.
+ int s=0;
+ while(s<len) {
+ if(isWhiteSpace(text.charAt(s)))
+ break;
+ s++;
+ }
+ if(s==len)
+ // the input happens to be already collapsed.
+ return text;
+
+ // we now know that the input contains spaces.
+ // let's sit down and do the collapsing normally.
+
+ StringBuffer result = new StringBuffer(len /*allocate enough size to avoid re-allocation*/ );
+
+ if(s!=0) {
+ for( int i=0; i<s; i++ )
+ result.append(text.charAt(i));
+ result.append(' ');
+ }
+
+ boolean inStripMode = true;
+ for (int i = s+1; i < len; i++) {
+ char ch = text.charAt(i);
+ boolean b = isWhiteSpace(ch);
+ if (inStripMode && b)
+ continue; // skip this character
+
+ inStripMode = b;
+ if (inStripMode)
+ result.append(' ');
+ else
+ result.append(ch);
+ }
+
+ // remove trailing whitespaces
+ len = result.length();
+ if (len > 0 && result.charAt(len - 1) == ' ')
+ result.setLength(len - 1);
+ // whitespaces are already collapsed,
+ // so all we have to do is to remove the last one character
+ // if it's a whitespace.
+
+ return result.toString();
+ }
+
+ /**
+ * No-op.
+ *
+ * Just return the same string given as the parameter.
+ */
+ public String marshal(String s) {
+ return s;
+ }
+
+
+ /** returns true if the specified char is a white space character. */
+ protected static boolean isWhiteSpace(char ch) {
+ // most of the characters are non-control characters.
+ // so check that first to quickly return false for most of the cases.
+ if( ch>0x20 ) return false;
+
+ // other than we have to do four comparisons.
+ return ch == 0x9 || ch == 0xA || ch == 0xD || ch == 0x20;
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/CollapsedStringAdapter.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation.adapters;
+
+import javax.xml.bind.DatatypeConverter;
+
+/**
+ * {@link XmlAdapter} for <tt>xs:hexBinary</tt>.
+ *
+ * <p>
+ * This {@link XmlAdapter} binds <tt>byte[]</tt> to the hexBinary representation in XML.
+ *
+ * @author Kohsuke Kawaguchi
+ * @since JAXB 2.0
+ */
+public final class HexBinaryAdapter extends XmlAdapter<String,byte[]> {
+ public byte[] unmarshal(String s) {
+ return DatatypeConverter.parseHexBinary(s);
+ }
+
+ public String marshal(byte[] bytes) {
+ return DatatypeConverter.printHexBinary(bytes);
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/HexBinaryAdapter.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation.adapters;
+
+
+
+/**
+ * {@link XmlAdapter} to handle <tt>xs:normalizedString</tt>.
+ *
+ * <p>
+ * This adapter removes leading and trailing whitespaces, then replace
+ * any tab, CR, and LF by a whitespace character ' '.
+ *
+ * @author Kohsuke Kawaguchi
+ * @since JAXB 2.0
+ */
+public final class NormalizedStringAdapter extends XmlAdapter<String,String> {
+ /**
+ * Removes leading and trailing whitespaces of the string
+ * given as the parameter, then replace
+ * any tab, CR, and LF by a whitespace character ' '.
+ */
+ public String unmarshal(String text) {
+ if(text==null) return null; // be defensive
+
+ int i=text.length()-1;
+
+ // look for the first whitespace char.
+ while( i>=0 && !isWhiteSpaceExceptSpace(text.charAt(i)) )
+ i--;
+
+ if( i<0 )
+ // no such whitespace. replace(text)==text.
+ return text;
+
+ // we now know that we need to modify the text.
+ // allocate a char array to do it.
+ char[] buf = text.toCharArray();
+
+ buf[i--] = ' ';
+ for( ; i>=0; i-- )
+ if( isWhiteSpaceExceptSpace(buf[i]))
+ buf[i] = ' ';
+
+ return new String(buf);
+ }
+
+ /**
+ * No-op.
+ *
+ * Just return the same string given as the parameter.
+ */
+ public String marshal(String s) {
+ return s;
+ }
+
+
+ /**
+ * Returns true if the specified char is a white space character
+ * but not 0x20.
+ */
+ protected static boolean isWhiteSpaceExceptSpace(char ch) {
+ // most of the characters are non-control characters.
+ // so check that first to quickly return false for most of the cases.
+ if( ch>=0x20 ) return false;
+
+ // other than we have to do four comparisons.
+ return ch == 0x9 || ch == 0xA || ch == 0xD;
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/NormalizedStringAdapter.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/XmlAdapter.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/XmlAdapter.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/XmlAdapter.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,176 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation.adapters;
+
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.Marshaller;
+
+/**
+ * Adapts a Java type for custom marshaling.
+ *
+ * <p> <b> Usage: </b> </p>
+ *
+ * <p>
+ * Some Java types do not map naturally to a XML representation, for
+ * example <tt>HashMap</tt> or other non JavaBean classes. Conversely,
+ * a XML repsentation may map to a Java type but an application may
+ * choose to accesss the XML representation using another Java
+ * type. For example, the schema to Java binding rules bind
+ * xs:DateTime by default to XmlGregorianCalendar. But an application
+ * may desire to bind xs:DateTime to a custom type,
+ * MyXmlGregorianCalendar, for example. In both cases, there is a
+ * mismatch between <i> bound type </i>, used by an application to
+ * access XML content and the <i> value type</i>, that is mapped to an
+ * XML representation.
+ *
+ * <p>
+ * This abstract class defines methods for adapting a bound type to a value
+ * type or vice versa. The methods are invoked by the JAXB binding
+ * framework during marshaling and unmarshalling:
+ *
+ * <ul>
+ * <li> <b> XmlAdapter.marshal(...): </b> During marshalling, JAXB
+ * binding framework invokes XmlAdapter.marshal(..) to adapt a
+ * bound type to value type, which is then marshaled to XML
+ * representation. </li>
+ *
+ * <li> <b> XmlAdapter.unmarshal(...): </b> During unmarshalling,
+ * JAXB binding framework first unmarshals XML representation
+ * to a value type and then invokes XmlAdapter.unmarshal(..) to
+ * adapt the value type to a bound type. </li>
+ * </ul>
+ *
+ * Writing an adapter therefore involves the following steps:
+ *
+ * <ul>
+ * <li> Write an adapter that implements this abstract class. </li>
+ * <li> Install the adapter using the annotation {@link
+ * XmlJavaTypeAdapter} </li>
+ * </ul>
+ *
+ * <p><b>Example:</b> Customized mapping of </tt>HashMap</tt></p>
+ * <p> The following example illustrates the use of
+ * <tt>@XmlAdapter</tt> and <tt>@XmlJavaTypeAdapter</tt> to
+ * customize the mapping of a <tt>HashMap</tt>.
+ *
+ * <p> <b> Step 1: </b> Determine the desired XML representation for HashMap.
+ *
+ * <pre>
+ * <hashmap>
+ * <entry key="id123">this is a value</entry>
+ * <entry key="id312">this is another value</entry>
+ * ...
+ * </hashmap>
+ * </pre>
+ *
+ * <p> <b> Step 2: </b> Determine the schema definition that the
+ * desired XML representation shown above should follow.
+ *
+ * <pre>
+ *
+ * <xs:complexType name="myHashMapType">
+ * <xs:sequence>
+ * <xs:element name="entry" type="myHashMapEntryType"
+ * minOccurs = "0" maxOccurs="unbounded"/>
+ * </xs:sequence>
+ * </xs:complexType>
+ *
+ * <xs:complexType name="myHashMapEntryType">
+ * <xs:simpleContent>
+ * <xs:extension base="xs:string">
+ * <xs:attribute name="key" type="xs:int"/>
+ * </xs:extension>
+ * </xs:simpleContent>
+ * </xs:complexType>
+ *
+ * </pre>
+ *
+ * <p> <b> Step 3: </b> Write value types that can generate the above
+ * schema definition.
+ *
+ * <pre>
+ * public class MyHashMapType {
+ * List<MyHashMapEntryType> entry;
+ * }
+ *
+ * public class MyHashMapEntryType {
+ * @XmlAttribute
+ * public Integer key;
+ *
+ * @XmlValue
+ * public String value;
+ * }
+ * </pre>
+ *
+ * <p> <b> Step 4: </b> Write the adapter that adapts the value type,
+ * MyHashMapType to a bound type, HashMap, used by the application.
+ *
+ * <pre>
+ * public final class MyHashMapAdapter extends
+ * XmlAdapter<HashMap, MyHashMapType> { ... }
+ *
+ * </pre>
+ *
+ * <p> <b> Step 5: </b> Use the adapter.
+ *
+ * <pre>
+ * public class Foo {
+ * @XmlJavaTypeAdapter(MyHashMapAdapter.class)
+ * HashMap hashmap;
+ * ...
+ * }
+ * </pre>
+ *
+ * The above code fragment will map to the following schema:
+ *
+ * <pre>
+ * <xs:complexType name="Foo">
+ * <xs:sequence>
+ * <xs:element name="hashmap" type="myHashMapType"
+ * </xs:sequence>
+ * </xs:complexType>
+ * </pre>
+ *
+ * @param <BoundType>
+ * The type that JAXB doesn't know how to handle. An adapter is written
+ * to allow this type to be used as an in-memory representation through
+ * the <tt>ValueType</tt>.
+ * @param <ValueType>
+ * The type that JAXB knows how to handle out of the box.
+ *
+ * @author <ul><li>Sekhar Vajjhala, Sun Microsystems Inc.</li> <li> Kohsuke Kawaguchi, Sun Microsystems Inc.</li></ul>
+ * @see XmlJavaTypeAdapter
+ * @since JAXB 2.0
+ */
+public abstract class XmlAdapter<ValueType,BoundType> {
+
+ /**
+ * Do-nothing constructor for the derived classes.
+ */
+ protected XmlAdapter() {}
+
+ /**
+ * Convert a value type to a bound type.
+ *
+ * @param v
+ * The value to be converted. Can be null.
+ * @throws Exception
+ * if there's an error during the conversion. The caller is responsible for
+ * reporting the error to the user through {@link javax.xml.bind.ValidationEventHandler}.
+ */
+ public abstract BoundType unmarshal(ValueType v) throws Exception;
+
+ /**
+ * Convert a bound type to a value type.
+ *
+ * @param v
+ * The value to be convereted. Can be null.
+ * @throws Exception
+ * if there's an error during the conversion. The caller is responsible for
+ * reporting the error to the user through {@link javax.xml.bind.ValidationEventHandler}.
+ */
+ public abstract ValueType marshal(BoundType v) throws Exception;
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/XmlAdapter.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation.adapters;
+
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlElementRefs;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlElementRef;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlSchema;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlSchemaTypes;
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.PACKAGE;
+
+
+/**
+ * Use an adapter that implements {@link XmlAdapter} for custom marshaling.
+ *
+ * <p> <b> Usage: </b> </p>
+ *
+ * <p> The <tt>@XmlJavaTypeAdapter</tt> annotation can be used with the
+ * following program elements:
+ * <ul>
+ * <li> a JavaBean property </li>
+ * <li> field </li>
+ * <li> parameter </li>
+ * <li> package </li>
+ * <li> from within {@link XmlJavaTypeAdapters} </li>
+ * </ul>
+ *
+ * <p> When <tt>@XmlJavaTypeAdapter</tt> annotation is defined on a
+ * class, it applies to all references to the class.
+ * <p> When <tt>@XmlJavaTypeAdapter</tt> annotation is defined at the
+ * package level it applies to all references from within the package
+ * to <tt>@XmlJavaTypeAdapter.type()</tt>.
+ * <p> When <tt>@XmlJavaTypeAdapter</tt> annotation is defined on the
+ * field, property or parameter, then the annotation applies to the
+ * field, property or the parameter only.
+ * <p> A <tt>@XmlJavaTypeAdapter</tt> annotation on a field, property
+ * or parameter overrides the <tt>@XmlJavaTypeAdapter</tt> annotation
+ * associated with the class being referenced by the field, property
+ * or parameter.
+ * <p> A <tt>@XmlJavaTypeAdapter</tt> annotation on a class overrides
+ * the <tt>@XmlJavaTypeAdapter</tt> annotation specified at the
+ * package level for that class.
+ *
+ * <p>This annotation can be used with the following other annotations:
+ * {@link XmlElement}, {@link XmlAttribute}, {@link XmlElementRef},
+ * {@link XmlElementRefs}, {@link XmlAnyElement}. This can also be
+ * used at the package level with the following annotations:
+ * {@link XmlAccessorType}, {@link XmlSchema}, {@link XmlSchemaType},
+ * {@link XmlSchemaTypes}.
+ *
+ * <p><b> Example: </b> See example in {@link XmlAdapter}
+ *
+ * @author <ul><li>Sekhar Vajjhala, Sun Microsystems Inc.</li> <li> Kohsuke Kawaguchi, Sun Microsystems Inc.</li></ul>
+ * @since JAXB2.0
+ * @see XmlAdapter
+ * @version $Revision$
+ */
+
+ at Retention(RUNTIME) @Target({PACKAGE,FIELD,METHOD,TYPE,PARAMETER})
+public @interface XmlJavaTypeAdapter {
+ /**
+ * Points to the clsss that converts a value type to a bound type or vice versa.
+ * See {@link XmlAdapter} for more details.
+ */
+ Class<? extends XmlAdapter> value();
+
+ /**
+ * If this annotation is used at the package level, then value of
+ * the type() must be specified.
+ */
+
+ Class type() default DEFAULT.class;
+
+ /**
+ * Used in {@link XmlJavaTypeAdapter#type()} to
+ * signal that the type be inferred from the signature
+ * of the field, property, parameter or the class.
+ */
+
+ static final class DEFAULT {}
+
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.annotation.adapters;
+
+import static java.lang.annotation.ElementType.PACKAGE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * <p>
+ * A container for multiple @{@link XmlJavaTypeAdapter} annotations.
+ *
+ * <p> Multiple annotations of the same type are not allowed on a program
+ * element. This annotation therefore serves as a container annotation
+ * for multiple @XmlJavaTypeAdapter as follows:
+ *
+ * <pre>
+ * @XmlJavaTypeAdapters ({ @XmlJavaTypeAdapter(...), at XmlJavaTypeAdapter(...) })
+ * </pre>
+ *
+ * <p>The <tt>@XmlJavaTypeAdapters</tt> annnotation is useful for
+ * defining {@link XmlJavaTypeAdapter} annotations for different types
+ * at the package level.
+ *
+ * <p>See "Package Specification" in javax.xml.bind.package javadoc for
+ * additional common information.</p>
+ *
+ * @author <ul><li>Sekhar Vajjhala, Sun Microsystems, Inc.</li></ul>
+ * @see XmlJavaTypeAdapter
+ * @since JAXB2.0
+ */
+ at Retention(RUNTIME) @Target({PACKAGE})
+public @interface XmlJavaTypeAdapters {
+ /**
+ * Collection of @{@link XmlJavaTypeAdapter} annotations
+ */
+ XmlJavaTypeAdapter[] value();
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/package.html
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/package.html (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/adapters/package.html 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,48 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+ <head>
+ <!--
+
+ @(#)package.html 1.60 98/01/27
+
+ Copyright 1998 Sun Microsystems, Inc. 901 San Antonio Road,
+ Palo Alto, California, 94303, U.S.A. All Rights Reserved.
+
+ This software is the confidential and proprietary information of Sun
+ Microsystems, Inc. ("Confidential Information"). You shall not
+ disclose such Confidential Information and shall use it only in
+ accordance with the terms of the license agreement you entered into
+ with Sun.
+
+ CopyrightVersion 1.2
+
+ -->
+ </head>
+
+ <body>
+ <p>
+ {@link javax.xml.bind.annotation.adapters.XmlAdapter} and its spec-defined
+ sub-classes to allow arbitrary Java classes to be used with JAXB.
+
+ <h2>Package Specification</h2>
+
+ <ul>
+ <li><a href="http://java.sun.com/xml/downloads/jaxb.html">JAXB
+ Specification</a>
+ </ul>
+
+ <h2>Related Documentation</h2>
+
+ For overviews, tutorials, examples, guides, and tool documentation,
+ please see:
+ <ul>
+ <li>The <a href="http://java.sun.com/xml/jaxb/index.html">JAXB
+ Website</a>
+ </ul>
+
+ <!-- Put @see and @since tags down here. -->
+
+ </body>
+</html>
+
+
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/package.html
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/package.html (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/annotation/package.html 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,275 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+ <head>
+ <!--
+
+ @(#)package.html 1.60 98/01/27
+
+ Copyright 1998 Sun Microsystems, Inc. 901 San Antonio Road,
+ Palo Alto, California, 94303, U.S.A. All Rights Reserved.
+
+ This software is the confidential and proprietary information of Sun
+ Microsystems, Inc. ("Confidential Information"). You shall not
+ disclose such Confidential Information and shall use it only in
+ accordance with the terms of the license agreement you entered into
+ with Sun.
+
+ CopyrightVersion 1.2
+
+ -->
+ </head>
+
+ <body bgcolor="white">
+
+ <p>
+ Defines annotations for customizing Java program elements to XML Schema mapping.
+
+ <h2>Package Specification</h2>
+ <p>The following table shows the JAXB mapping annotations
+ that can be associated with each program element. </p>
+
+ <table border="1" cellpadding="4" cellspacing="3">
+ <tbody>
+ <tr>
+ <td><b>Program Element</td>
+ <td><b>JAXB annotation</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b>Package</td>
+ <td>
+ <table>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlAccessorOrder.html">XmlAccessorOrder</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlAccessorType.html">XmlAccessorType</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlSchema.html">XmlSchema</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlSchemaType.html">XmlSchemaType</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlSchemaTypes.html">XmlSchemaTypes</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.html">XmlJavaTypeAdapter</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/adapters/XmlJavaTypeAdapters.html">XmlJavaTypeAdapters</b></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><b>Class</td>
+ <td>
+ <table>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlAccessorOrder.html">XmlAccessorOrder</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlAccessorType.html">XmlAccessorType</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlInlineBinaryData.html">XmlInlineBinaryData</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlRootElement.html">XmlRootElement</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlType.html">XmlType</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.html">XmlJavaTypeAdapter</b></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><b>Enum type</td>
+ <td>
+ <table>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlEnum.html">XmlEnum</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlEnumValue.html">XmlEnumValue (enum constant only)</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlRootElement.html">XmlRootElement</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlType.html">XmlType</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.html">XmlJavaTypeAdapter</b></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><b>JavaBean Property/field</td>
+ <td>
+ <table>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlElement.html">XmlElement</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlElements.html">XmlElements</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlElementRef.html">XmlElementRef</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlElementRefs.html">XmlElementRefs</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlElementWrapper.html">XmlElementWrapper</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlAnyElement.html">XmlAnyElement</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlAttribute.html">XmlAttribute</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlAnyAttribute.html">XmlAnyAttribute</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlTransient.html">XmlTransient</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlValue.html">XmlValue</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlID.html">XmlID</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlIDREF.html">XmlIDREF</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlList.html">XmlList</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlMixed.html">XmlMixed</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlMimeType.html">XmlMimeType</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlAttachmentRef.html">XmlAttachmentRef</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlInlineBinaryData.html">XmlInlineBinaryData</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlElementDecl.html">XmlElementDecl (only on method)</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.html">XmlJavaTypeAdapter</b></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td><b>Parameter</td>
+ <td>
+ <table>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlList.html">XmlList</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlAttachmentRef.html">XmlAttachmentRef</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/XmlMimeType.html">XmlMimeType</b></td>
+ </tr>
+ <tr valign="top">
+ <td><b><a HREF="../../../../javax/xml/bind/annotation/adapters/XmlJavaTypeAdapter.html">XmlJavaTypeAdapter</b></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ </tbody>
+ </table>
+ <h3>Terminology</h3>
+ <p>
+ <b>JavaBean property and field:</b> For the purposes of
+ mapping, there is no semantic difference between a field and
+ a JavaBean property. Thus, an annotation that can be applied
+ to a JavaBean property can always be applied to a
+ field. Hence in the Javadoc documentation, for brevity, the
+ term JavaBean property or property is used to mean either JavaBean
+ property or a field. Where required, both are explicitly
+ mentioned.
+ <p>
+ <b>top level class:</b> For the purpose of mapping, there is
+ no semantic difference between a top level class and a
+ static nested class. Thus, an annotation that can be applied
+ to a top level class, can always be applied to a nested
+ static class. Hence in the Javadoc documentation, for
+ brevity, the term "top level class" or just class is used to
+ mean either a top level class or a nested static
+ class.
+ <p>
+ <b>mapping annotation:</b>A JAXB 2.0 defined program
+ annotation based on the JSR 175 programming annotation
+ facility.
+ <h3>Common Usage Constraints</h3>
+ <p>The following usage constraints are defined here since
+ they apply to more than annotation:
+ <ul>
+ <li> For a property, a given annotation can be applied to
+ either read or write property but not both. </li>
+
+ <li> A property name must be different from any other
+ property name in any of the super classes of the
+ class being mapped. </li>
+
+ <li> A mapped field name or the decapitalized name of a
+ mapped property must be unique within a class. </li>
+ </ul>
+ <h3>Notations</h3>
+ <b>Namespace prefixes</b>
+ <p>The following namespace prefixes are used in the XML Schema
+ fragments in this package.<p>
+
+ <table border="1" cellpadding="4" cellspacing="3">
+ <tbody>
+ <tr>
+ <td><b>Prefix</td>
+ <td><b>Namespace</b></td>
+ <td><b>Notes</b></td>
+ </tr>
+
+ <tr valign="top">
+ <td>xs</td>
+ <td>http://www.w3.org/2001/XMLSchema</td>
+ <td>Namespace of XML Schema namespace</td>
+ </tr>
+ <tr valign="top">
+ <td>ref</td>
+ <td>http://ws-i.org/profiles/basic/1.1/xsd</td>
+ <td>Namespace for swaref schema component</td>
+ </tr>
+ <tr valign="top">
+ <td>xsi</td>
+ <td>http://www.w3.org/2001/XMLSchema-instance</td>
+ <td>XML Schema namespace for instances</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <!-- Put @see and @since tags down here. -->
+ @since JAXB 2.0
+ </body>
+</html>
+
+
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/attachment/AttachmentMarshaller.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/attachment/AttachmentMarshaller.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/attachment/AttachmentMarshaller.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,176 @@
+package javax.xml.bind.attachment;
+
+import javax.activation.DataHandler;
+import javax.xml.bind.Marshaller;
+
+/**
+ * <p>Enable JAXB marshalling to optimize storage of binary data.</p>
+ *
+ * <p>This API enables an efficient cooperative creation of optimized
+ * binary data formats between a JAXB marshalling process and a MIME-based package
+ * processor. A JAXB implementation marshals the root body of a MIME-based package,
+ * delegating the creation of referenceable MIME parts to
+ * the MIME-based package processor that implements this abstraction.</p>
+ *
+ * <p>XOP processing is enabled when {@link #isXOPPackage()} is true.
+ * See {@link #addMtomAttachment(DataHandler, String, String)} for details.
+ * </p>
+ *
+ * <p>WS-I Attachment Profile 1.0 is supported by
+ * {@link #addSwaRefAttachment(DataHandler)} being called by the
+ * marshaller for each JAXB property related to
+ * {http://ws-i.org/profiles/basic/1.1/xsd}swaRef.</p>
+ *
+ *
+ * @author Marc Hadley
+ * @author Kohsuke Kawaguchi
+ * @author Joseph Fialli
+ * @since JAXB 2.0
+ *
+ * @see Marshaller#setAttachmentMarshaller(AttachmentMarshaller)
+ *
+ * @see <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/">XML-binary Optimized Packaging</a>
+ * @see <a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html">WS-I Attachments Profile Version 1.0.</a>
+ */
+public abstract class AttachmentMarshaller {
+
+ /**
+ * <p>Consider MIME content <code>data</code> for optimized binary storage as an attachment.
+ *
+ * <p>
+ * This method is called by JAXB marshal process when {@link #isXOPPackage()} is
+ * <code>true</code>, for each element whose datatype is "base64Binary", as described in
+ * Step 3 in
+ * <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/#creating_xop_packages">Creating XOP Packages</a>.
+ *
+ * <p>
+ * The method implementor determines whether <code>data</code> shall be attached separately
+ * or inlined as base64Binary data. If the implementation chooses to optimize the storage
+ * of the binary data as a MIME part, it is responsible for attaching <code>data</code> to the
+ * MIME-based package, and then assigning an unique content-id, cid, that identifies
+ * the MIME part within the MIME message. This method returns the cid,
+ * which enables the JAXB marshaller to marshal a XOP element that refers to that cid in place
+ * of marshalling the binary data. When the method returns null, the JAXB marshaller
+ * inlines <code>data</code> as base64binary data.
+ *
+ * <p>
+ * The caller of this method is required to meet the following constraint.
+ * If the element infoset item containing <code>data</code> has the attribute
+ * <code>xmime:contentType</code> or if the JAXB property/field representing
+ * <code>data</code>is annotated with a known MIME type,
+ * <code>data.getContentType()</code> should be set to that MIME type.
+ *
+ * <p>
+ * The <code>elementNamespace</code> and <code>elementLocalName</code>
+ * parameters provide the
+ * context that contains the binary data. This information could
+ * be used by the MIME-based package processor to determine if the
+ * binary data should be inlined or optimized as an attachment.
+ *
+ * @param data
+ * represents the data to be attached. Must be non-null.
+ * @param elementNamespace
+ * the namespace URI of the element that encloses the base64Binary data.
+ * Can be empty but never null.
+ * @param elementLocalName
+ * The local name of the element. Always a non-null valid string.
+ *
+ * @return
+ * a valid content-id URI (see <a href="http://www.w3.org/TR/xop10/#RFC2387">RFC 2387</a>) that identifies the attachment containing <code>data</code>.
+ * Otherwise, null if the attachment was not added and should instead be inlined in the message.
+ *
+ * @see <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/">XML-binary Optimized Packaging</a>
+ * @see <a href="http://www.w3.org/TR/xml-media-types/">Describing Media Content of Binary Data in XML</a>
+ */
+ public abstract String addMtomAttachment(DataHandler data, String elementNamespace, String elementLocalName);
+
+ /**
+ * <p>Consider binary <code>data</code> for optimized binary storage as an attachment.
+ *
+ * <p>Since content type is not known, the attachment's MIME content type must be set to "application/octet-stream".</p>
+ *
+ * <p>
+ * The <code>elementNamespace</code> and <code>elementLocalName</code>
+ * parameters provide the
+ * context that contains the binary data. This information could
+ * be used by the MIME-based package processor to determine if the
+ * binary data should be inlined or optimized as an attachment.
+ *
+ * @param data
+ * represents the data to be attached. Must be non-null. The actual data region is
+ * specified by <tt>(data,offset,length)</tt> tuple.
+ *
+ * @param offset
+ * The offset within the array of the first byte to be read;
+ * must be non-negative and no larger than array.length
+ *
+ * @param length
+ * The number of bytes to be read from the given array;
+ * must be non-negative and no larger than array.length
+ *
+ * @param mimeType
+ * If the data has an associated MIME type known to JAXB, that is passed
+ * as this parameter. If none is known, "application/octet-stream".
+ * This parameter may never be null.
+ *
+ * @param elementNamespace
+ * the namespace URI of the element that encloses the base64Binary data.
+ * Can be empty but never null.
+ *
+ * @param elementLocalName
+ * The local name of the element. Always a non-null valid string.
+ *
+ * @return content-id URI, cid, to the attachment containing
+ * <code>data</code> or null if data should be inlined.
+ *
+ * @see #addMtomAttachment(DataHandler, String, String)
+ */
+ public abstract String addMtomAttachment(byte[] data, int offset, int length, String mimeType, String elementNamespace, String elementLocalName);
+
+ /**
+ * <p>Read-only property that returns true if JAXB marshaller should enable XOP creation.</p>
+ *
+ * <p>This value must not change during the marshalling process. When this
+ * value is true, the <code>addMtomAttachment(...)</code> method
+ * is invoked when the appropriate binary datatypes are encountered by
+ * the marshal process.</p>
+ *
+ * <p>Marshaller.marshal() must throw IllegalStateException if this value is <code>true</code>
+ * and the XML content to be marshalled violates Step 1 in
+ * <a ref="http://www.w3.org/TR/2005/REC-xop10-20050125/#creating_xop_packages">Creating XOP Pacakges</a>
+ * http://www.w3.org/TR/2005/REC-xop10-20050125/#creating_xop_packages.
+ * <i>"Ensure the Original XML Infoset contains no element information item with a
+ * [namespace name] of "http://www.w3.org/2004/08/xop/include" and a [local name] of Include"</i>
+ *
+ * <p>When this method returns true and during the marshal process
+ * at least one call to <code>addMtomAttachment(...)</code> returns
+ * a content-id, the MIME-based package processor must label the
+ * root part with the application/xop+xml media type as described in
+ * Step 5 of
+ * <a ref="http://www.w3.org/TR/2005/REC-xop10-20050125/#creating_xop_packages">Creating XOP Pacakges</a>.<p>
+ *
+ * @return true when MIME context is a XOP Package.
+ */
+ public boolean isXOPPackage() { return false; }
+
+ /**
+ * <p>Add MIME <code>data</code> as an attachment and return attachment's content-id, cid.</p>
+ *
+ * <p>
+ * This method is called by JAXB marshal process for each element/attribute typed as
+ * {http://ws-i.org/profiles/basic/1.1/xsd}swaRef. The MIME-based package processor
+ * implementing this method is responsible for attaching the specified data to a
+ * MIME attachment, and generating a content-id, cid, that uniquely identifies the attachment
+ * within the MIME-based package.
+ *
+ * <p>Caller inserts the returned content-id, cid, into the XML content being marshalled.</p>
+ *
+ * @param data
+ * represents the data to be attached. Must be non-null.
+ * @return
+ * must be a valid URI used as cid. Must satisfy Conformance Requirement R2928 from
+ * <a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html#Referencing_Attachments_from_the_SOAP_Envelope">WS-I Attachments Profile Version 1.0.</a>
+ */
+ public abstract String addSwaRefAttachment(DataHandler data);
+}
+
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/attachment/AttachmentMarshaller.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/attachment/AttachmentUnmarshaller.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/attachment/AttachmentUnmarshaller.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/attachment/AttachmentUnmarshaller.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,117 @@
+package javax.xml.bind.attachment;
+
+import javax.activation.DataHandler;
+
+/**
+ * <p>Enables JAXB unmarshalling of a root document containing optimized binary data formats.</p>
+ *
+ * <p>This API enables an efficient cooperative processing of optimized
+ * binary data formats between a JAXB 2.0 implementation and MIME-based package
+ * processor (MTOM/XOP and WS-I AP 1.0). JAXB unmarshals the body of a package, delegating the
+ * understanding of the packaging format being used to a MIME-based
+ * package processor that implements this abstract class.</p>
+ *
+ * <p>This abstract class identifies if a package requires XOP processing, {@link #isXOPPackage()} and provides retrieval of binary content stored as attachments by content-id.</p>
+ *
+ * <h2>Identifying the content-id, cid, to pass to <code>getAttachment*(String cid)</code></h2>
+ * <ul>
+ * <li>
+ * For XOP processing, the infoset representation of the cid is described
+ * in step 2a in
+ * <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/#interpreting_xop_packages">Section 3.2 Interpreting XOP Packages</a>
+ * </li>
+ * <li>
+ * For WS-I AP 1.0, the cid is identified as an element or attribute of
+ * type <code>ref:swaRef </code> specified in
+ * <a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html#Referencing_Attachments_from_the_SOAP_Envelope">Section 4.4 Referencing Attachments from the SOAP Envelope</a>
+ * </li>
+ * </ul>
+ *
+ * @author Marc Hadley
+ * @author Kohsuke Kawaguchi
+ * @author Joseph Fialli
+ *
+ * @since JAXB 2.0
+ *
+ * @see javax.xml.bind.Unmarshaller#setAttachmentUnmarshaller(AttachmentUnmarshaller)
+ *
+ * @see <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/">XML-binary Optimized Packaging</a>
+ * @see <a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html">WS-I Attachments Profile Version 1.0.</a>
+ * @see <a href="http://www.w3.org/TR/xml-media-types/">Describing Media Content of Binary Data in XML</a>
+ */
+public abstract class AttachmentUnmarshaller {
+ /**
+ * <p>Lookup MIME content by content-id, <code>cid</code>, and return as a {@link DataHandler}.</p>
+ *
+ * <p>The returned <code>DataHandler</code> instance must be configured
+ * to meet the following required mapping constaint.
+ * <table border="2" rules="all" cellpadding="4">
+ * <thead>
+ * <tr>
+ * <th align="center" colspan="2">
+ * Required Mappings between MIME and Java Types
+ * </tr>
+ * <tr>
+ * <th>MIME Type</th>
+ * <th>Java Type</th>
+ * </tr>
+ * </tr>
+ * <tr>
+ * <th><code>DataHandler.getContentType()</code></th>
+ * <th><code>instanceof DataHandler.getContent()</code></th>
+ * </tr>
+ * </thead>
+ * <tbody>
+ * <tr>
+ * <td>image/gif</td>
+ * <td>java.awt.Image</td>
+ * </tr>
+ * <tr>
+ * <td>image/jpeg</td>
+ * <td>java.awt.Image</td>
+ * </tr>
+ * <tr>
+ * <td>text/xml or application/xml</td>
+ * <td>javax.xml.transform.Source</td>
+ * </tr>
+ * </tbody>
+ * </table>
+ * Note that it is allowable to support additional mappings.</p>
+ *
+ * @param cid It is expected to be a valid lexical form of the XML Schema
+ * <code>xs:anyURI</code> datatype. If <code>{@link #isXOPPackage()}
+ * ==true</code>, it must be a valid URI per the <code>cid:</code> URI scheme (see <a href="http://www.ietf.org/rfc/rfc2387.txt">RFC 2387</a>)
+ *
+ * @return
+ * a {@link DataHandler} that represents the MIME attachment.
+ *
+ * @throws IllegalArgumentException if the attachment for the given cid is not found.
+ */
+ public abstract DataHandler getAttachmentAsDataHandler(String cid);
+
+ /**
+ * <p>Retrieve the attachment identified by content-id, <code>cid</code>, as a <tt>byte[]</tt></p>.
+ *
+ * @param cid It is expected to be a valid lexical form of the XML Schema
+ * <code>xs:anyURI</code> datatype. If <code>{@link #isXOPPackage()}
+ * ==true</code>, it must be a valid URI per the <code>cid:</code> URI scheme (see <a href="http://www.ietf.org/rfc/rfc2387.txt">RFC 2387</a>)
+ *
+ * @return byte[] representation of attachment identified by cid.
+ *
+ * @throws IllegalArgumentException if the attachment for the given cid is not found.
+ */
+ public abstract byte[] getAttachmentAsByteArray(String cid);
+
+ /**
+ * <p>Read-only property that returns true if JAXB unmarshaller needs to perform XOP processing.</p>
+ *
+ * <p>This method returns <code>true</code> when the constraints specified
+ * in <a href="http://www.w3.org/TR/2005/REC-xop10-20050125/#identifying_xop_documents">Identifying XOP Documents</a> are met.
+ * This value must not change during the unmarshalling process.</p>
+ *
+ * @return true when MIME context is a XOP Document.
+ */
+ public boolean isXOPPackage() { return false; }
+}
+
+
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/attachment/AttachmentUnmarshaller.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/attachment/package.html
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/attachment/package.html (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/attachment/package.html 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,57 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+ <head>
+ <!--
+
+ @(#)package.html 1.60 98/01/27
+
+ Copyright 1998 Sun Microsystems, Inc. 901 San Antonio Road,
+ Palo Alto, California, 94303, U.S.A. All Rights Reserved.
+
+ This software is the confidential and proprietary information of Sun
+ Microsystems, Inc. ("Confidential Information"). You shall not
+ disclose such Confidential Information and shall use it only in
+ accordance with the terms of the license agreement you entered into
+ with Sun.
+
+ CopyrightVersion 1.2
+
+ -->
+ </head>
+
+ <body bgcolor="white">
+
+ <p>
+ This package is implemented by a MIME-based package processor that
+ enables the interpretation and creation of optimized binary data
+ within an MIME-based package format.
+
+ <p>
+ Soap MTOM[1], XOP([2][3]) and WS-I AP[4] standardize approaches to
+ optimized transmission of binary datatypes as an attachment.
+ To optimally support these standards within a message passing
+ environment, this package enables an integrated solution between
+ a MIME-based package processor and JAXB unmarshall/marshal processes.
+
+ <h2>Package Specification</h2>
+
+ <ul>
+ <li><a href="http://java.sun.com/xml/downloads/jaxb.html">JAXB
+ Specification</a>
+ </ul>
+
+ <h2>Related Standards</h2>
+
+ <ul>
+ <li><a href="http://www.w3.org/TR/2004/WD-soap12-mtom-20040608/">[1]SOAP Message Transmission Optimization Mechanism</a> </li>
+ <li><a href="http://www.w3.org/TR/2005/REC-xop10-20050125/">[2]XML-binary Optimized Packaging</a></li>
+ <li><a href="http://www.ws-i.org/Profiles/AttachmentsProfile-1.0-2004-08-24.html">[3]WS-I Attachments Profile Version 1.0.</a></li>
+ <li><a href="http://www.w3.org/TR/xml-media-types/">[4]Describing Media Content of Binary Data in XML</a></li>
+ </ul>
+
+ <!-- Put @see and @since tags down here. -->
+ @since JAXB 2.0
+ </body>
+</html>
+
+
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/AbstractMarshallerImpl.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/AbstractMarshallerImpl.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/AbstractMarshallerImpl.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,461 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+package javax.xml.bind.helpers;
+
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.PropertyException;
+import javax.xml.bind.ValidationEventHandler;
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+import javax.xml.bind.attachment.AttachmentMarshaller;
+import javax.xml.stream.XMLEventWriter;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.sax.SAXResult;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.validation.Schema;
+import java.io.UnsupportedEncodingException;
+// J2SE1.4 feature
+// import java.nio.charset.Charset;
+// import java.nio.charset.UnsupportedCharsetException;
+
+/**
+ * Partial default <tt>Marshaller</tt> implementation.
+ *
+ * <p>
+ * This class provides a partial default implementation for the
+ * {@link javax.xml.bind.Marshaller} interface.
+ *
+ * <p>
+ * The only methods that a JAXB Provider has to implement are
+ * {@link Marshaller#marshal(Object, javax.xml.transform.Result) marshal(Object, javax.xml.transform.Result)},
+ * {@link Marshaller#marshal(Object, javax.xml.transform.Result) marshal(Object, javax.xml.stream.XMLStreamWriter)}, and
+ * {@link Marshaller#marshal(Object, javax.xml.transform.Result) marshal(Object, javax.xml.stream.XMLEventWriter)}.
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$ $Date: 2006/03/08 17:00:39 $
+ * @see javax.xml.bind.Marshaller
+ * @since JAXB1.0
+ */
+public abstract class AbstractMarshallerImpl implements Marshaller
+{
+ /** handler that will be used to process errors and warnings during marshal */
+ private ValidationEventHandler eventHandler =
+ new DefaultValidationEventHandler();
+
+ //J2SE1.4 feature
+ //private Charset encoding = null;
+
+ /** store the value of the encoding property. */
+ private String encoding = "UTF-8";
+
+ /** store the value of the schemaLocation property. */
+ private String schemaLocation = null;
+
+ /** store the value of the noNamespaceSchemaLocation property. */
+ private String noNSSchemaLocation = null;
+
+ /** store the value of the formattedOutput property. */
+ private boolean formattedOutput = false;
+
+ /** store the value of the fragment property. */
+ private boolean fragment = false;
+
+ public final void marshal( Object obj, java.io.OutputStream os )
+ throws JAXBException {
+
+ checkNotNull( obj, "obj", os, "os" );
+ marshal( obj, new StreamResult(os) );
+ }
+
+ public final void marshal( Object obj, java.io.Writer w )
+ throws JAXBException {
+
+ checkNotNull( obj, "obj", w, "writer" );
+ marshal( obj, new StreamResult(w) );
+ }
+
+ public final void marshal( Object obj, org.xml.sax.ContentHandler handler )
+ throws JAXBException {
+
+ checkNotNull( obj, "obj", handler, "handler" );
+ marshal( obj, new SAXResult(handler) );
+ }
+
+ public final void marshal( Object obj, org.w3c.dom.Node node )
+ throws JAXBException {
+
+ checkNotNull( obj, "obj", node, "node" );
+ marshal( obj, new DOMResult(node) );
+ }
+
+ /**
+ * By default, the getNode method is unsupported and throw
+ * an {@link java.lang.UnsupportedOperationException}.
+ *
+ * Implementations that choose to support this method must
+ * override this method.
+ */
+ public org.w3c.dom.Node getNode( Object obj ) throws JAXBException {
+
+ checkNotNull( obj, "obj", Boolean.TRUE, "foo" );
+
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Convenience method for getting the current output encoding.
+ *
+ * @return the current encoding or "UTF-8" if it hasn't been set.
+ */
+ protected String getEncoding() {
+ return encoding;
+ }
+
+ /**
+ * Convenience method for setting the output encoding.
+ *
+ * @param encoding a valid encoding as specified in the Marshaller class
+ * documentation
+ */
+ protected void setEncoding( String encoding ) {
+ this.encoding = encoding;
+ }
+
+ /**
+ * Convenience method for getting the current schemaLocation.
+ *
+ * @return the current schemaLocation or null if it hasn't been set
+ */
+ protected String getSchemaLocation() {
+ return schemaLocation;
+ }
+
+ /**
+ * Convenience method for setting the schemaLocation.
+ *
+ * @param location the schemaLocation value
+ */
+ protected void setSchemaLocation( String location ) {
+ schemaLocation = location;
+ }
+
+ /**
+ * Convenience method for getting the current noNamespaceSchemaLocation.
+ *
+ * @return the current noNamespaceSchemaLocation or null if it hasn't
+ * been set
+ */
+ protected String getNoNSSchemaLocation() {
+ return noNSSchemaLocation;
+ }
+
+ /**
+ * Convenience method for setting the noNamespaceSchemaLocation.
+ *
+ * @param location the noNamespaceSchemaLocation value
+ */
+ protected void setNoNSSchemaLocation( String location ) {
+ noNSSchemaLocation = location;
+ }
+
+ /**
+ * Convenience method for getting the formatted output flag.
+ *
+ * @return the current value of the formatted output flag or false if
+ * it hasn't been set.
+ */
+ protected boolean isFormattedOutput() {
+ return formattedOutput;
+ }
+
+ /**
+ * Convenience method for setting the formatted output flag.
+ *
+ * @param v value of the formatted output flag.
+ */
+ protected void setFormattedOutput( boolean v ) {
+ formattedOutput = v;
+ }
+
+
+ /**
+ * Convenience method for getting the fragment flag.
+ *
+ * @return the current value of the fragment flag or false if
+ * it hasn't been set.
+ */
+ protected boolean isFragment() {
+ return fragment;
+ }
+
+ /**
+ * Convenience method for setting the fragment flag.
+ *
+ * @param v value of the fragment flag.
+ */
+ protected void setFragment( boolean v ) {
+ fragment = v;
+ }
+
+
+ static String[] aliases = {
+ "UTF-8", "UTF8",
+ "UTF-16", "Unicode",
+ "UTF-16BE", "UnicodeBigUnmarked",
+ "UTF-16LE", "UnicodeLittleUnmarked",
+ "US-ASCII", "ASCII",
+ "TIS-620", "TIS620",
+
+ // taken from the project-X parser
+ "ISO-10646-UCS-2", "Unicode",
+
+ "EBCDIC-CP-US", "cp037",
+ "EBCDIC-CP-CA", "cp037",
+ "EBCDIC-CP-NL", "cp037",
+ "EBCDIC-CP-WT", "cp037",
+
+ "EBCDIC-CP-DK", "cp277",
+ "EBCDIC-CP-NO", "cp277",
+ "EBCDIC-CP-FI", "cp278",
+ "EBCDIC-CP-SE", "cp278",
+
+ "EBCDIC-CP-IT", "cp280",
+ "EBCDIC-CP-ES", "cp284",
+ "EBCDIC-CP-GB", "cp285",
+ "EBCDIC-CP-FR", "cp297",
+
+ "EBCDIC-CP-AR1", "cp420",
+ "EBCDIC-CP-HE", "cp424",
+ "EBCDIC-CP-BE", "cp500",
+ "EBCDIC-CP-CH", "cp500",
+
+ "EBCDIC-CP-ROECE", "cp870",
+ "EBCDIC-CP-YU", "cp870",
+ "EBCDIC-CP-IS", "cp871",
+ "EBCDIC-CP-AR2", "cp918",
+
+ // IANA also defines two that JDK 1.2 doesn't handle:
+ // EBCDIC-CP-GR --> CP423
+ // EBCDIC-CP-TR --> CP905
+ };
+
+ /**
+ * Gets the corresponding Java encoding name from an IANA name.
+ *
+ * This method is a helper method for the derived class to convert
+ * encoding names.
+ *
+ * @exception UnsupportedEncodingException
+ * If this implementation couldn't find the Java encoding name.
+ */
+ protected String getJavaEncoding( String encoding ) throws UnsupportedEncodingException {
+ try {
+ "1".getBytes(encoding);
+ return encoding;
+ } catch( UnsupportedEncodingException e ) {
+ // try known alias
+ for( int i=0; i<aliases.length; i+=2 ) {
+ if(encoding.equals(aliases[i])) {
+ "1".getBytes(aliases[i+1]);
+ return aliases[i+1];
+ }
+ }
+
+ throw new UnsupportedEncodingException(encoding);
+ }
+ /* J2SE1.4 feature
+ try {
+ this.encoding = Charset.forName( _encoding );
+ } catch( UnsupportedCharsetException uce ) {
+ throw new JAXBException( uce );
+ }
+ */
+ }
+
+ /**
+ * Default implementation of the setProperty method handles
+ * the four defined properties in Marshaller. If a provider
+ * needs to handle additional properties, it should override
+ * this method in a derived class.
+ */
+ public void setProperty( String name, Object value )
+ throws PropertyException {
+
+ if( name == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, "name" ) );
+ }
+
+ // recognize and handle four pre-defined properties.
+ if( JAXB_ENCODING.equals(name) ) {
+ checkString( name, value );
+ setEncoding( (String)value );
+ return;
+ }
+ if( JAXB_FORMATTED_OUTPUT.equals(name) ) {
+ checkBoolean( name, value );
+ setFormattedOutput((Boolean) value );
+ return;
+ }
+ if( JAXB_NO_NAMESPACE_SCHEMA_LOCATION.equals(name) ) {
+ checkString( name, value );
+ setNoNSSchemaLocation( (String)value );
+ return;
+ }
+ if( JAXB_SCHEMA_LOCATION.equals(name) ) {
+ checkString( name, value );
+ setSchemaLocation( (String)value );
+ return;
+ }
+ if( JAXB_FRAGMENT.equals(name) ) {
+ checkBoolean(name, value);
+ setFragment((Boolean) value );
+ return;
+ }
+
+ throw new PropertyException(name, value);
+ }
+
+ /**
+ * Default implementation of the getProperty method handles
+ * the four defined properties in Marshaller. If a provider
+ * needs to support additional provider specific properties,
+ * it should override this method in a derived class.
+ */
+ public Object getProperty( String name )
+ throws PropertyException {
+
+ if( name == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, "name" ) );
+ }
+
+ // recognize and handle four pre-defined properties.
+ if( JAXB_ENCODING.equals(name) )
+ return getEncoding();
+ if( JAXB_FORMATTED_OUTPUT.equals(name) )
+ return isFormattedOutput()?Boolean.TRUE:Boolean.FALSE;
+ if( JAXB_NO_NAMESPACE_SCHEMA_LOCATION.equals(name) )
+ return getNoNSSchemaLocation();
+ if( JAXB_SCHEMA_LOCATION.equals(name) )
+ return getSchemaLocation();
+ if( JAXB_FRAGMENT.equals(name) )
+ return isFragment()?Boolean.TRUE:Boolean.FALSE;
+
+ throw new PropertyException(name);
+ }
+ /**
+ * @see javax.xml.bind.Marshaller#getEventHandler()
+ */
+ public ValidationEventHandler getEventHandler() throws JAXBException {
+ return eventHandler;
+ }
+
+ /**
+ * @see javax.xml.bind.Marshaller#setEventHandler(ValidationEventHandler)
+ */
+ public void setEventHandler(ValidationEventHandler handler)
+ throws JAXBException {
+
+ if( handler == null ) {
+ eventHandler = new DefaultValidationEventHandler();
+ } else {
+ eventHandler = handler;
+ }
+ }
+
+
+
+
+ /*
+ * assert that the given object is a Boolean
+ */
+ private void checkBoolean( String name, Object value ) throws PropertyException {
+ if(!(value instanceof Boolean))
+ throw new PropertyException(
+ Messages.format( Messages.MUST_BE_BOOLEAN, name ) );
+ }
+
+ /*
+ * assert that the given object is a String
+ */
+ private void checkString( String name, Object value ) throws PropertyException {
+ if(!(value instanceof String))
+ throw new PropertyException(
+ Messages.format( Messages.MUST_BE_STRING, name ) );
+ }
+
+ /*
+ * assert that the parameters are not null
+ */
+ private void checkNotNull( Object o1, String o1Name,
+ Object o2, String o2Name ) {
+
+ if( o1 == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, o1Name ) );
+ }
+ if( o2 == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, o2Name ) );
+ }
+ }
+ /* (non-Javadoc)
+ * @see javax.xml.bind.Marshaller#marshal(java.lang.Object, javax.xml.stream.XMLEventWriter)
+ */
+ public void marshal(Object obj, XMLEventWriter writer)
+ throws JAXBException {
+
+ throw new UnsupportedOperationException();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.xml.bind.Marshaller#marshal(java.lang.Object, javax.xml.stream.XMLStreamWriter)
+ */
+ public void marshal(Object obj, XMLStreamWriter writer)
+ throws JAXBException {
+
+ throw new UnsupportedOperationException();
+ }
+
+ public void setSchema(Schema schema) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Schema getSchema() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setAdapter(XmlAdapter adapter) {
+ if(adapter==null)
+ throw new IllegalArgumentException();
+ setAdapter((Class)adapter.getClass(),adapter);
+ }
+
+ public <A extends XmlAdapter> void setAdapter(Class<A> type, A adapter) {
+ throw new UnsupportedOperationException();
+ }
+
+ public <A extends XmlAdapter> A getAdapter(Class<A> type) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setAttachmentMarshaller(AttachmentMarshaller am) {
+ throw new UnsupportedOperationException();
+ }
+
+ public AttachmentMarshaller getAttachmentMarshaller() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setListener(Listener listener) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Listener getListener() {
+ throw new UnsupportedOperationException();
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/AbstractMarshallerImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,415 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+package javax.xml.bind.helpers;
+
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.w3c.dom.Node;
+
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.PropertyException;
+import javax.xml.bind.UnmarshalException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.ValidationEventHandler;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+import javax.xml.bind.attachment.AttachmentUnmarshaller;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import java.io.File;
+import java.io.Reader;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+/**
+ * Partial default <tt>Unmarshaller</tt> implementation.
+ *
+ * <p>
+ * This class provides a partial default implementation for the
+ * {@link javax.xml.bind.Unmarshaller}interface.
+ *
+ * <p>
+ * A JAXB Provider has to implement five methods (getUnmarshallerHandler,
+ * unmarshal(Node), unmarshal(XMLReader,InputSource),
+ * unmarshal(XMLStreamReader), and unmarshal(XMLEventReader).
+ *
+ * @author <ul>
+ * <li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li>
+ * </ul>
+ * @version $Revision$ $Date: 2006/03/08 17:01:00 $
+ * @see javax.xml.bind.Unmarshaller
+ * @since JAXB1.0
+ */
+public abstract class AbstractUnmarshallerImpl implements Unmarshaller
+{
+ /** handler that will be used to process errors and warnings during unmarshal */
+ private ValidationEventHandler eventHandler =
+ new DefaultValidationEventHandler();
+
+ /** whether or not the unmarshaller will validate */
+ protected boolean validating = false;
+
+ /**
+ * XMLReader that will be used to parse a document.
+ */
+ private XMLReader reader = null;
+
+ /**
+ * Obtains a configured XMLReader.
+ *
+ * This method is used when the client-specified
+ * {@link SAXSource} object doesn't have XMLReader.
+ *
+ * {@link Unmarshaller} is not re-entrant, so we will
+ * only use one instance of XMLReader.
+ */
+ protected XMLReader getXMLReader() throws JAXBException {
+ if(reader==null) {
+ try {
+ SAXParserFactory parserFactory;
+ parserFactory = SAXParserFactory.newInstance();
+ parserFactory.setNamespaceAware(true);
+ // there is no point in asking a validation because
+ // there is no guarantee that the document will come with
+ // a proper schemaLocation.
+ parserFactory.setValidating(false);
+ reader = parserFactory.newSAXParser().getXMLReader();
+ } catch( ParserConfigurationException e ) {
+ throw new JAXBException(e);
+ } catch( SAXException e ) {
+ throw new JAXBException(e);
+ }
+ }
+ return reader;
+ }
+
+ public Object unmarshal( Source source ) throws JAXBException {
+ if( source == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, "source" ) );
+ }
+
+ if(source instanceof SAXSource)
+ return unmarshal( (SAXSource)source );
+ if(source instanceof StreamSource)
+ return unmarshal( streamSourceToInputSource((StreamSource)source));
+ if(source instanceof DOMSource)
+ return unmarshal( ((DOMSource)source).getNode() );
+
+ // we don't handle other types of Source
+ throw new IllegalArgumentException();
+ }
+
+ // use the client specified XMLReader contained in the SAXSource.
+ private Object unmarshal( SAXSource source ) throws JAXBException {
+
+ XMLReader reader = source.getXMLReader();
+ if( reader == null )
+ reader = getXMLReader();
+
+ return unmarshal( reader, source.getInputSource() );
+ }
+
+ /**
+ * Unmarshals an object by using the specified XMLReader and the InputSource.
+ *
+ * The callee should call the setErrorHandler method of the XMLReader
+ * so that errors are passed to the client-specified ValidationEventHandler.
+ */
+ protected abstract Object unmarshal( XMLReader reader, InputSource source ) throws JAXBException;
+
+ public final Object unmarshal( InputSource source ) throws JAXBException {
+ if( source == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, "source" ) );
+ }
+
+ return unmarshal( getXMLReader(), source );
+ }
+
+
+ private Object unmarshal( String url ) throws JAXBException {
+ return unmarshal( new InputSource(url) );
+ }
+
+ public final Object unmarshal( URL url ) throws JAXBException {
+ if( url == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, "url" ) );
+ }
+
+ return unmarshal( url.toExternalForm() );
+ }
+
+ public final Object unmarshal( File f ) throws JAXBException {
+ if( f == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, "file" ) );
+ }
+
+ try {
+ // copied from JAXP
+ String path = f.getAbsolutePath();
+ if (File.separatorChar != '/')
+ path = path.replace(File.separatorChar, '/');
+ if (!path.startsWith("/"))
+ path = "/" + path;
+ if (!path.endsWith("/") && f.isDirectory())
+ path = path + "/";
+ return unmarshal(new URL("file", "", path));
+ } catch( MalformedURLException e ) {
+ throw new IllegalArgumentException(e.getMessage());
+ }
+ }
+
+ public final Object unmarshal( java.io.InputStream is )
+ throws JAXBException {
+
+ if( is == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, "is" ) );
+ }
+
+ InputSource isrc = new InputSource( is );
+ return unmarshal( isrc );
+ }
+
+ public final Object unmarshal( Reader reader ) throws JAXBException {
+ if( reader == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, "reader" ) );
+ }
+
+ InputSource isrc = new InputSource( reader );
+ return unmarshal( isrc );
+ }
+
+
+ private static InputSource streamSourceToInputSource( StreamSource ss ) {
+ InputSource is = new InputSource();
+ is.setSystemId( ss.getSystemId() );
+ is.setByteStream( ss.getInputStream() );
+ is.setCharacterStream( ss.getReader() );
+
+ return is;
+ }
+
+
+ /**
+ * Indicates whether or not the Unmarshaller is configured to validate
+ * during unmarshal operations.
+ * <p>
+ * <i><b>Note:</b> I named this method isValidating() to stay in-line
+ * with JAXP, as opposed to naming it getValidating(). </i>
+ *
+ * @return true if the Unmarshaller is configured to validate during
+ * unmarshal operations, false otherwise
+ * @throws JAXBException if an error occurs while retrieving the validating
+ * flag
+ */
+ public boolean isValidating() throws JAXBException {
+ return validating;
+ }
+
+ /**
+ * Allow an application to register a validation event handler.
+ * <p>
+ * The validation event handler will be called by the JAXB Provider if any
+ * validation errors are encountered during calls to any of the
+ * <tt>unmarshal</tt> methods. If the client application does not register
+ * a validation event handler before invoking the unmarshal methods, then
+ * all validation events will be silently ignored and may result in
+ * unexpected behaviour.
+ *
+ * @param handler the validation event handler
+ * @throws JAXBException if an error was encountered while setting the
+ * event handler
+ */
+ public void setEventHandler(ValidationEventHandler handler)
+ throws JAXBException {
+
+ if( handler == null ) {
+ eventHandler = new DefaultValidationEventHandler();
+ } else {
+ eventHandler = handler;
+ }
+ }
+
+ /**
+ * Specifies whether or not the Unmarshaller should validate during
+ * unmarshal operations. By default, the <tt>Unmarshaller</tt> does
+ * not validate.
+ * <p>
+ * This method may only be invoked before or after calling one of the
+ * unmarshal methods.
+ *
+ * @param validating true if the Unmarshaller should validate during
+ * unmarshal, false otherwise
+ * @throws JAXBException if an error occurred while enabling or disabling
+ * validation at unmarshal time
+ */
+ public void setValidating(boolean validating) throws JAXBException {
+ this.validating = validating;
+ }
+
+ /**
+ * Return the current event handler or the default event handler if one
+ * hasn't been set.
+ *
+ * @return the current ValidationEventHandler or the default event handler
+ * if it hasn't been set
+ * @throws JAXBException if an error was encountered while getting the
+ * current event handler
+ */
+ public ValidationEventHandler getEventHandler() throws JAXBException {
+ return eventHandler;
+ }
+
+
+ /**
+ * Creates an UnmarshalException from a SAXException.
+ *
+ * This is an utility method provided for the derived classes.
+ *
+ * <p>
+ * When a provider-implemented ContentHandler wants to throw a
+ * JAXBException, it needs to wrap the exception by a SAXException.
+ * If the unmarshaller implementation blindly wrap SAXException
+ * by JAXBException, such an exception will be a JAXBException
+ * wrapped by a SAXException wrapped by another JAXBException.
+ * This is silly.
+ *
+ * <p>
+ * This method checks the nested exception of SAXException
+ * and reduce those excessive wrapping.
+ *
+ * @return the resulting UnmarshalException
+ */
+ protected UnmarshalException createUnmarshalException( SAXException e ) {
+ // check the nested exception to see if it's an UnmarshalException
+ Exception nested = e.getException();
+ if(nested instanceof UnmarshalException)
+ return (UnmarshalException)nested;
+
+ if(nested instanceof RuntimeException)
+ // typically this is an unexpected exception,
+ // just throw it rather than wrap it, so that the full stack
+ // trace can be displayed.
+ throw (RuntimeException)nested;
+
+
+ // otherwise simply wrap it
+ if(nested!=null)
+ return new UnmarshalException(nested);
+ else
+ return new UnmarshalException(e);
+ }
+
+ /**
+ * Default implementation of the setProperty method always
+ * throws PropertyException since there are no required
+ * properties. If a provider needs to handle additional
+ * properties, it should override this method in a derived class.
+ */
+ public void setProperty( String name, Object value )
+ throws PropertyException {
+
+ if( name == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, "name" ) );
+ }
+
+ throw new PropertyException(name, value);
+ }
+
+ /**
+ * Default implementation of the getProperty method always
+ * throws PropertyException since there are no required
+ * properties. If a provider needs to handle additional
+ * properties, it should override this method in a derived class.
+ */
+ public Object getProperty( String name )
+ throws PropertyException {
+
+ if( name == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, "name" ) );
+ }
+
+ throw new PropertyException(name);
+ }
+
+ public Object unmarshal(XMLEventReader reader) throws JAXBException {
+
+ throw new UnsupportedOperationException();
+ }
+
+ public Object unmarshal(XMLStreamReader reader) throws JAXBException {
+
+ throw new UnsupportedOperationException();
+ }
+
+ public <T> JAXBElement<T> unmarshal(Node node, Class<T> expectedType) throws JAXBException {
+ throw new UnsupportedOperationException();
+ }
+
+ public <T> JAXBElement<T> unmarshal(Source source, Class<T> expectedType) throws JAXBException {
+ throw new UnsupportedOperationException();
+ }
+
+ public <T> JAXBElement<T> unmarshal(XMLStreamReader reader, Class<T> expectedType) throws JAXBException {
+ throw new UnsupportedOperationException();
+ }
+
+ public <T> JAXBElement<T> unmarshal(XMLEventReader reader, Class<T> expectedType) throws JAXBException {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setSchema(Schema schema) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Schema getSchema() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setAdapter(XmlAdapter adapter) {
+ if(adapter==null)
+ throw new IllegalArgumentException();
+ setAdapter((Class)adapter.getClass(),adapter);
+ }
+
+ public <A extends XmlAdapter> void setAdapter(Class<A> type, A adapter) {
+ throw new UnsupportedOperationException();
+ }
+
+ public <A extends XmlAdapter> A getAdapter(Class<A> type) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setAttachmentUnmarshaller(AttachmentUnmarshaller au) {
+ throw new UnsupportedOperationException();
+ }
+
+ public AttachmentUnmarshaller getAttachmentUnmarshaller() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setListener(Listener listener) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Listener getListener() {
+ throw new UnsupportedOperationException();
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/AbstractUnmarshallerImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/DefaultValidationEventHandler.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/DefaultValidationEventHandler.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/DefaultValidationEventHandler.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+package javax.xml.bind.helpers;
+
+import org.w3c.dom.Node;
+
+import javax.xml.bind.ValidationEvent;
+import javax.xml.bind.ValidationEventHandler;
+import javax.xml.bind.ValidationEventLocator;
+import java.net.URL;
+
+/**
+ * <p>
+ * JAXB 1.0 only default validation event handler. This is the default
+ * handler for all objects created from a JAXBContext that is managing
+ * schema-derived code generated by a JAXB 1.0 binding compiler.
+ *
+ * <p>
+ * This handler causes the unmarshal and validate operations to fail on the first
+ * error or fatal error.
+ *
+ * <p>
+ * This handler is not the default handler for JAXB mapped classes following
+ * JAXB 2.0 or later versions. Default validation event handling has changed
+ * and is specified in {@link javax.xml.bind.Unmarshaller} and
+ * {@link javax.xml.bind.Marshaller}.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$
+ * @see javax.xml.bind.Unmarshaller
+ * @see javax.xml.bind.Validator
+ * @see javax.xml.bind.ValidationEventHandler
+ * @since JAXB1.0
+ */
+public class DefaultValidationEventHandler implements ValidationEventHandler {
+
+ public boolean handleEvent( ValidationEvent event ) {
+
+ if( event == null ) {
+ throw new IllegalArgumentException();
+ }
+
+ // calculate the severity prefix and return value
+ String severity = null;
+ boolean retVal = false;
+ switch ( event.getSeverity() ) {
+ case ValidationEvent.WARNING:
+ severity = Messages.format( Messages.WARNING );
+ retVal = true; // continue after warnings
+ break;
+ case ValidationEvent.ERROR:
+ severity = Messages.format( Messages.ERROR );
+ retVal = false; // terminate after errors
+ break;
+ case ValidationEvent.FATAL_ERROR:
+ severity = Messages.format( Messages.FATAL_ERROR );
+ retVal = false; // terminate after fatal errors
+ break;
+ default:
+ assert false :
+ Messages.format( Messages.UNRECOGNIZED_SEVERITY,
+ event.getSeverity() );
+ }
+
+ // calculate the location message
+ String location = getLocation( event );
+
+ System.out.println(
+ Messages.format( Messages.SEVERITY_MESSAGE,
+ severity,
+ event.getMessage(),
+ location ) );
+
+ // fail on the first error or fatal error
+ return retVal;
+ }
+
+ /**
+ * Calculate a location message for the event
+ *
+ */
+ private String getLocation(ValidationEvent event) {
+ StringBuffer msg = new StringBuffer();
+
+ ValidationEventLocator locator = event.getLocator();
+
+ if( locator != null ) {
+
+ URL url = locator.getURL();
+ Object obj = locator.getObject();
+ Node node = locator.getNode();
+ int line = locator.getLineNumber();
+
+ if( url!=null || line!=-1 ) {
+ msg.append( "line " + line );
+ if( url!=null )
+ msg.append( " of " + url );
+ } else if( obj != null ) {
+ msg.append( " obj: " + obj.toString() );
+ } else if( node != null ) {
+ msg.append( " node: " + node.toString() );
+ }
+ } else {
+ msg.append( Messages.format( Messages.LOCATION_UNAVAILABLE ) );
+ }
+
+ return msg.toString();
+ }
+}
+
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/DefaultValidationEventHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/Messages.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/Messages.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/Messages.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.helpers;
+
+import java.text.MessageFormat;
+import java.util.ResourceBundle;
+
+/**
+ * Formats error messages.
+ */
+class Messages
+{
+ static String format( String property ) {
+ return format( property, null );
+ }
+
+ static String format( String property, Object arg1 ) {
+ return format( property, new Object[]{arg1} );
+ }
+
+ static String format( String property, Object arg1, Object arg2 ) {
+ return format( property, new Object[]{arg1,arg2} );
+ }
+
+ static String format( String property, Object arg1, Object arg2, Object arg3 ) {
+ return format( property, new Object[]{arg1,arg2,arg3} );
+ }
+
+ // add more if necessary.
+
+ /** Loads a string resource and formats it with specified arguments. */
+ static String format( String property, Object[] args ) {
+ String text = ResourceBundle.getBundle(Messages.class.getName()).getString(property);
+ return MessageFormat.format(text,args);
+ }
+
+//
+//
+// Message resources
+//
+//
+ static final String INPUTSTREAM_NOT_NULL = // 0 args
+ "AbstractUnmarshallerImpl.ISNotNull";
+
+ static final String MUST_BE_BOOLEAN = // 1 arg
+ "AbstractMarshallerImpl.MustBeBoolean";
+
+ static final String MUST_BE_STRING = // 1 arg
+ "AbstractMarshallerImpl.MustBeString";
+
+ static final String SEVERITY_MESSAGE = // 3 args
+ "DefaultValidationEventHandler.SeverityMessage";
+
+ static final String LOCATION_UNAVAILABLE = // 0 args
+ "DefaultValidationEventHandler.LocationUnavailable";
+
+ static final String UNRECOGNIZED_SEVERITY = // 1 arg
+ "DefaultValidationEventHandler.UnrecognizedSeverity";
+
+ static final String WARNING = // 0 args
+ "DefaultValidationEventHandler.Warning";
+
+ static final String ERROR = // 0 args
+ "DefaultValidationEventHandler.Error";
+
+ static final String FATAL_ERROR = // 0 args
+ "DefaultValidationEventHandler.FatalError";
+
+ static final String ILLEGAL_SEVERITY = // 0 args
+ "ValidationEventImpl.IllegalSeverity";
+
+ static final String MUST_NOT_BE_NULL = // 1 arg
+ "Shared.MustNotBeNull";
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/Messages.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/NotIdentifiableEventImpl.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/NotIdentifiableEventImpl.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/NotIdentifiableEventImpl.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.helpers;
+
+import javax.xml.bind.ValidationEventLocator;
+
+/**
+ * Default implementation of the NotIdentifiableEvent interface.
+ *
+ * <p>
+ * JAXB providers are allowed to use whatever class that implements
+ * the ValidationEvent interface. This class is just provided for a
+ * convenience.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$
+ * @see javax.xml.bind.NotIdentifiableEvent
+ * @see javax.xml.bind.Validator
+ * @see javax.xml.bind.ValidationEventHandler
+ * @see javax.xml.bind.ValidationEvent
+ * @see javax.xml.bind.ValidationEventLocator
+ * @since JAXB1.0
+ */
+public class NotIdentifiableEventImpl
+ extends ValidationEventImpl
+ implements javax.xml.bind.NotIdentifiableEvent {
+
+ /**
+ * Create a new NotIdentifiableEventImpl.
+ *
+ * @param _severity The severity value for this event. Must be one of
+ * ValidationEvent.WARNING, ValidationEvent.ERROR, or
+ * ValidationEvent.FATAL_ERROR
+ * @param _message The text message for this event - may be null.
+ * @param _locator The locator object for this event - may be null.
+ * @throws IllegalArgumentException if an illegal severity field is supplied
+ */
+ public NotIdentifiableEventImpl( int _severity, String _message,
+ ValidationEventLocator _locator) {
+
+ super(_severity, _message, _locator);
+ }
+
+ /**
+ * Create a new NotIdentifiableEventImpl.
+ *
+ * @param _severity The severity value for this event. Must be one of
+ * ValidationEvent.WARNING, ValidationEvent.ERROR, or
+ * ValidationEvent.FATAL_ERROR
+ * @param _message The text message for this event - may be null.
+ * @param _locator The locator object for this event - may be null.
+ * @param _linkedException An optional linked exception that may provide
+ * additional information about the event - may be null.
+ * @throws IllegalArgumentException if an illegal severity field is supplied
+ */
+ public NotIdentifiableEventImpl( int _severity, String _message,
+ ValidationEventLocator _locator,
+ Throwable _linkedException) {
+
+ super(_severity, _message, _locator, _linkedException);
+ }
+
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/NotIdentifiableEventImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/ParseConversionEventImpl.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/ParseConversionEventImpl.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/ParseConversionEventImpl.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.helpers;
+
+import javax.xml.bind.ParseConversionEvent;
+import javax.xml.bind.ValidationEventLocator;
+
+/**
+ * Default implementation of the ParseConversionEvent interface.
+ *
+ * <p>
+ * JAXB providers are allowed to use whatever class that implements
+ * the ValidationEvent interface. This class is just provided for a
+ * convenience.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$
+ * @see javax.xml.bind.ParseConversionEvent
+ * @see javax.xml.bind.Validator
+ * @see javax.xml.bind.ValidationEventHandler
+ * @see javax.xml.bind.ValidationEvent
+ * @see javax.xml.bind.ValidationEventLocator
+ * @since JAXB1.0
+ */
+public class ParseConversionEventImpl
+ extends ValidationEventImpl
+ implements ParseConversionEvent {
+
+ /**
+ * Create a new ParseConversionEventImpl.
+ *
+ * @param _severity The severity value for this event. Must be one of
+ * ValidationEvent.WARNING, ValidationEvent.ERROR, or
+ * ValidationEvent.FATAL_ERROR
+ * @param _message The text message for this event - may be null.
+ * @param _locator The locator object for this event - may be null.
+ * @throws IllegalArgumentException if an illegal severity field is supplied
+ */
+ public ParseConversionEventImpl( int _severity, String _message,
+ ValidationEventLocator _locator) {
+
+ super(_severity, _message, _locator);
+ }
+
+ /**
+ * Create a new ParseConversionEventImpl.
+ *
+ * @param _severity The severity value for this event. Must be one of
+ * ValidationEvent.WARNING, ValidationEvent.ERROR, or
+ * ValidationEvent.FATAL_ERROR
+ * @param _message The text message for this event - may be null.
+ * @param _locator The locator object for this event - may be null.
+ * @param _linkedException An optional linked exception that may provide
+ * additional information about the event - may be null.
+ * @throws IllegalArgumentException if an illegal severity field is supplied
+ */
+ public ParseConversionEventImpl( int _severity, String _message,
+ ValidationEventLocator _locator,
+ Throwable _linkedException) {
+
+ super(_severity, _message, _locator, _linkedException);
+ }
+
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/ParseConversionEventImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/PrintConversionEventImpl.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/PrintConversionEventImpl.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/PrintConversionEventImpl.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.helpers;
+
+import javax.xml.bind.PrintConversionEvent;
+import javax.xml.bind.ValidationEventLocator;
+
+/**
+ * Default implementation of the PrintConversionEvent interface.
+ *
+ * <p>
+ * JAXB providers are allowed to use whatever class that implements
+ * the ValidationEvent interface. This class is just provided for a
+ * convenience.
+ *
+ * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$
+ * @see javax.xml.bind.PrintConversionEvent
+ * @see javax.xml.bind.Validator
+ * @see javax.xml.bind.ValidationEventHandler
+ * @see javax.xml.bind.ValidationEvent
+ * @see javax.xml.bind.ValidationEventLocator
+ * @since JAXB1.0
+ */
+public class PrintConversionEventImpl
+ extends ValidationEventImpl
+ implements PrintConversionEvent {
+
+ /**
+ * Create a new PrintConversionEventImpl.
+ *
+ * @param _severity The severity value for this event. Must be one of
+ * ValidationEvent.WARNING, ValidationEvent.ERROR, or
+ * ValidationEvent.FATAL_ERROR
+ * @param _message The text message for this event - may be null.
+ * @param _locator The locator object for this event - may be null.
+ * @throws IllegalArgumentException if an illegal severity field is supplied
+ */
+ public PrintConversionEventImpl( int _severity, String _message,
+ ValidationEventLocator _locator) {
+
+ super(_severity, _message, _locator);
+ }
+
+ /**
+ * Create a new PrintConversionEventImpl.
+ *
+ * @param _severity The severity value for this event. Must be one of
+ * ValidationEvent.WARNING, ValidationEvent.ERROR, or
+ * ValidationEvent.FATAL_ERROR
+ * @param _message The text message for this event - may be null.
+ * @param _locator The locator object for this event - may be null.
+ * @param _linkedException An optional linked exception that may provide
+ * additional information about the event - may be null.
+ * @throws IllegalArgumentException if an illegal severity field is supplied
+ */
+ public PrintConversionEventImpl( int _severity, String _message,
+ ValidationEventLocator _locator,
+ Throwable _linkedException) {
+
+ super(_severity, _message, _locator, _linkedException);
+ }
+
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/PrintConversionEventImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/ValidationEventImpl.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/ValidationEventImpl.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/ValidationEventImpl.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,155 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+package javax.xml.bind.helpers;
+
+import java.text.MessageFormat;
+
+import javax.xml.bind.ValidationEvent;
+import javax.xml.bind.ValidationEventLocator;
+
+/**
+ * Default implementation of the ValidationEvent interface.
+ *
+ * <p>
+ * JAXB providers are allowed to use whatever class that implements
+ * the ValidationEvent interface. This class is just provided for a
+ * convenience.
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$
+ * @see javax.xml.bind.Validator
+ * @see javax.xml.bind.ValidationEventHandler
+ * @see javax.xml.bind.ValidationEvent
+ * @see javax.xml.bind.ValidationEventLocator
+ * @since JAXB1.0
+ */
+public class ValidationEventImpl implements ValidationEvent
+{
+
+ /**
+ * Create a new ValidationEventImpl.
+ *
+ * @param _severity The severity value for this event. Must be one of
+ * ValidationEvent.WARNING, ValidationEvent.ERROR, or
+ * ValidationEvent.FATAL_ERROR
+ * @param _message The text message for this event - may be null.
+ * @param _locator The locator object for this event - may be null.
+ * @throws IllegalArgumentException if an illegal severity field is supplied
+ */
+ public ValidationEventImpl( int _severity, String _message,
+ ValidationEventLocator _locator ) {
+
+ this(_severity,_message,_locator,null);
+ }
+
+ /**
+ * Create a new ValidationEventImpl.
+ *
+ * @param _severity The severity value for this event. Must be one of
+ * ValidationEvent.WARNING, ValidationEvent.ERROR, or
+ * ValidationEvent.FATAL_ERROR
+ * @param _message The text message for this event - may be null.
+ * @param _locator The locator object for this event - may be null.
+ * @param _linkedException An optional linked exception that may provide
+ * additional information about the event - may be null.
+ * @throws IllegalArgumentException if an illegal severity field is supplied
+ */
+ public ValidationEventImpl( int _severity, String _message,
+ ValidationEventLocator _locator,
+ Throwable _linkedException ) {
+
+ setSeverity( _severity );
+ this.message = _message;
+ this.locator = _locator;
+ this.linkedException = _linkedException;
+ }
+
+ private int severity;
+ private String message;
+ private Throwable linkedException;
+ private ValidationEventLocator locator;
+
+ public int getSeverity() {
+ return severity;
+ }
+
+
+ /**
+ * Set the severity field of this event.
+ *
+ * @param _severity Must be one of ValidationEvent.WARNING,
+ * ValidationEvent.ERROR, or ValidationEvent.FATAL_ERROR.
+ * @throws IllegalArgumentException if an illegal severity field is supplied
+ */
+ public void setSeverity( int _severity ) {
+
+ if( _severity != ValidationEvent.WARNING &&
+ _severity != ValidationEvent.ERROR &&
+ _severity != ValidationEvent.FATAL_ERROR ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.ILLEGAL_SEVERITY ) );
+ }
+
+ this.severity = _severity;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+ /**
+ * Set the message field of this event.
+ *
+ * @param _message String message - may be null.
+ */
+ public void setMessage( String _message ) {
+ this.message = _message;
+ }
+
+ public Throwable getLinkedException() {
+ return linkedException;
+ }
+ /**
+ * Set the linked exception field of this event.
+ *
+ * @param _linkedException Optional linked exception - may be null.
+ */
+ public void setLinkedException( Throwable _linkedException ) {
+ this.linkedException = _linkedException;
+ }
+
+ public ValidationEventLocator getLocator() {
+ return locator;
+ }
+ /**
+ * Set the locator object for this event.
+ *
+ * @param _locator The locator - may be null.
+ */
+ public void setLocator( ValidationEventLocator _locator ) {
+ this.locator = _locator;
+ }
+
+ /**
+ * Returns a string representation of this object in a format
+ * helpful to debugging.
+ *
+ * @see Object#equals(Object)
+ */
+ public String toString() {
+ String s;
+ switch(getSeverity()) {
+ case WARNING: s="WARNING";break;
+ case ERROR: s="ERROR";break;
+ case FATAL_ERROR: s="FATAL_ERROR";break;
+ default: s=String.valueOf(getSeverity());break;
+ }
+ return MessageFormat.format("[severity={0},message={1},locator={2}]",
+ new Object[]{
+ s,
+ getMessage(),
+ getLocator()
+ });
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/ValidationEventImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/ValidationEventLocatorImpl.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/ValidationEventLocatorImpl.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/ValidationEventLocatorImpl.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,253 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+package javax.xml.bind.helpers;
+
+import java.net.URL;
+import java.net.MalformedURLException;
+import java.text.MessageFormat;
+
+import javax.xml.bind.ValidationEventLocator;
+import org.w3c.dom.Node;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXParseException;
+
+/**
+ * Default implementation of the ValidationEventLocator interface.
+ *
+ * <p>
+ * JAXB providers are allowed to use whatever class that implements
+ * the ValidationEventLocator interface. This class is just provided for a
+ * convenience.
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$
+ * @see javax.xml.bind.Validator
+ * @see javax.xml.bind.ValidationEventHandler
+ * @see javax.xml.bind.ValidationEvent
+ * @see javax.xml.bind.ValidationEventLocator
+ * @since JAXB1.0
+ */
+public class ValidationEventLocatorImpl implements ValidationEventLocator
+{
+ /**
+ * Creates an object with all fields unavailable.
+ */
+ public ValidationEventLocatorImpl() {
+ }
+
+ /**
+ * Constructs an object from an org.xml.sax.Locator.
+ *
+ * The object's ColumnNumber, LineNumber, and URL become available from the
+ * values returned by the locator's getColumnNumber(), getLineNumber(), and
+ * getSystemId() methods respectively. Node, Object, and Offset are not
+ * available.
+ *
+ * @param loc the SAX Locator object that will be used to populate this
+ * event locator.
+ * @throws IllegalArgumentException if the Locator is null
+ */
+ public ValidationEventLocatorImpl( Locator loc ) {
+ if( loc == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, "loc" ) );
+ }
+
+ this.url = toURL(loc.getSystemId());
+ this.columnNumber = loc.getColumnNumber();
+ this.lineNumber = loc.getLineNumber();
+ }
+
+ /**
+ * Constructs an object from the location information of a SAXParseException.
+ *
+ * The object's ColumnNumber, LineNumber, and URL become available from the
+ * values returned by the locator's getColumnNumber(), getLineNumber(), and
+ * getSystemId() methods respectively. Node, Object, and Offset are not
+ * available.
+ *
+ * @param e the SAXParseException object that will be used to populate this
+ * event locator.
+ * @throws IllegalArgumentException if the SAXParseException is null
+ */
+ public ValidationEventLocatorImpl( SAXParseException e ) {
+ if( e == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, "e" ) );
+ }
+
+ this.url = toURL(e.getSystemId());
+ this.columnNumber = e.getColumnNumber();
+ this.lineNumber = e.getLineNumber();
+ }
+
+ /**
+ * Constructs an object that points to a DOM Node.
+ *
+ * The object's Node becomes available. ColumnNumber, LineNumber, Object,
+ * Offset, and URL are not available.
+ *
+ * @param _node the DOM Node object that will be used to populate this
+ * event locator.
+ * @throws IllegalArgumentException if the Node is null
+ */
+ public ValidationEventLocatorImpl(Node _node) {
+ if( _node == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, "_node" ) );
+ }
+
+ this.node = _node;
+ }
+
+ /**
+ * Constructs an object that points to a JAXB content object.
+ *
+ * The object's Object becomes available. ColumnNumber, LineNumber, Node,
+ * Offset, and URL are not available.
+ *
+ * @param _object the Object that will be used to populate this
+ * event locator.
+ * @throws IllegalArgumentException if the Object is null
+ */
+ public ValidationEventLocatorImpl(Object _object) {
+ if( _object == null ) {
+ throw new IllegalArgumentException(
+ Messages.format( Messages.MUST_NOT_BE_NULL, "_object" ) );
+ }
+
+ this.object = _object;
+ }
+
+ /** Converts a system ID to an URL object. */
+ private static URL toURL( String systemId ) {
+ try {
+ return new URL(systemId);
+ } catch( MalformedURLException e ) {
+ // TODO: how should we handle system id here?
+ return null; // for now
+ }
+ }
+
+ private URL url = null;
+ private int offset = -1;
+ private int lineNumber = -1;
+ private int columnNumber = -1;
+ private Object object = null;
+ private Node node = null;
+
+
+ /**
+ * @see javax.xml.bind.ValidationEventLocator#getURL()
+ */
+ public URL getURL() {
+ return url;
+ }
+
+ /**
+ * Set the URL field on this event locator. Null values are allowed.
+ *
+ * @param _url the url
+ */
+ public void setURL( URL _url ) {
+ this.url = _url;
+ }
+
+ /**
+ * @see javax.xml.bind.ValidationEventLocator#getOffset()
+ */
+ public int getOffset() {
+ return offset;
+ }
+
+ /**
+ * Set the offset field on this event locator.
+ *
+ * @param _offset the offset
+ */
+ public void setOffset( int _offset ) {
+ this.offset = _offset;
+ }
+
+ /**
+ * @see javax.xml.bind.ValidationEventLocator#getLineNumber()
+ */
+ public int getLineNumber() {
+ return lineNumber;
+ }
+
+ /**
+ * Set the lineNumber field on this event locator.
+ *
+ * @param _lineNumber the line number
+ */
+ public void setLineNumber( int _lineNumber ) {
+ this.lineNumber = _lineNumber;
+ }
+
+ /**
+ * @see javax.xml.bind.ValidationEventLocator#getColumnNumber()
+ */
+ public int getColumnNumber() {
+ return columnNumber;
+ }
+
+ /**
+ * Set the columnNumber field on this event locator.
+ *
+ * @param _columnNumber the column number
+ */
+ public void setColumnNumber( int _columnNumber ) {
+ this.columnNumber = _columnNumber;
+ }
+
+ /**
+ * @see javax.xml.bind.ValidationEventLocator#getObject()
+ */
+ public Object getObject() {
+ return object;
+ }
+
+ /**
+ * Set the Object field on this event locator. Null values are allowed.
+ *
+ * @param _object the java content object
+ */
+ public void setObject( Object _object ) {
+ this.object = _object;
+ }
+
+ /**
+ * @see javax.xml.bind.ValidationEventLocator#getNode()
+ */
+ public Node getNode() {
+ return node;
+ }
+
+ /**
+ * Set the Node field on this event locator. Null values are allowed.
+ *
+ * @param _node the Node
+ */
+ public void setNode( Node _node ) {
+ this.node = _node;
+ }
+
+ /**
+ * Returns a string representation of this object in a format
+ * helpful to debugging.
+ *
+ * @see Object#equals(Object)
+ */
+ public String toString() {
+ return MessageFormat.format("[node={0},object={1},url={2},line={3},col={4},offset={5}]",
+ getNode(),
+ getObject(),
+ getURL(),
+ String.valueOf(getLineNumber()),
+ String.valueOf(getColumnNumber()),
+ String.valueOf(getOffset()));
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/ValidationEventLocatorImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/package.html
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/package.html (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/helpers/package.html 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,53 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+ <head>
+ <!--
+
+ @(#)package.html 1.60 98/01/27
+
+ Copyright 1998 Sun Microsystems, Inc. 901 San Antonio Road,
+ Palo Alto, California, 94303, U.S.A. All Rights Reserved.
+
+ This software is the confidential and proprietary information of Sun
+ Microsystems, Inc. ("Confidential Information"). You shall not
+ disclose such Confidential Information and shall use it only in
+ accordance with the terms of the license agreement you entered into
+ with Sun.
+
+ CopyrightVersion 1.2
+
+ -->
+ </head>
+
+ <body bgcolor="white">
+
+ <p>
+ <B>JAXB Provider Use Only:</b> Provides partial default implementations for
+ some of the <tt>javax.xml.bind</tt> interfaces.
+
+ <p>
+ JAXB Providers can extend these classes and implement the abstract
+ methods.
+
+ <h2>Package Specification</h2>
+
+ <ul>
+ <li><a href="http://java.sun.com/xml/downloads/jaxb.html">JAXB
+ Specification</a>
+ </ul>
+
+ <h2>Related Documentation</h2>
+
+ For overviews, tutorials, examples, guides, and tool documentation,
+ please see:
+ <ul>
+ <li>The <a href="http://java.sun.com/xml/jaxb/index.html">JAXB
+ Website</a>
+ </ul>
+
+ <!-- Put @see and @since tags down here. -->
+
+ </body>
+</html>
+
+
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/package.html
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/package.html (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/package.html 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+ <head>
+ <!--
+
+ @(#)package.html 1.60 98/01/27
+
+ Copyright 1998 Sun Microsystems, Inc. 901 San Antonio Road,
+ Palo Alto, California, 94303, U.S.A. All Rights Reserved.
+
+ This software is the confidential and proprietary information of Sun
+ Microsystems, Inc. ("Confidential Information"). You shall not
+ disclose such Confidential Information and shall use it only in
+ accordance with the terms of the license agreement you entered into
+ with Sun.
+
+ CopyrightVersion 1.2
+
+ -->
+ </head>
+
+ <body bgcolor="white">
+
+ <p>
+ Provides a runtime binding framework for client applications including
+ unmarshalling, marshalling, and validation capabilities.
+
+ <p>
+ <tt>JAXBContext</tt> is the client-entry point to the runtime binding
+ framework.
+
+
+ <h2>Package Specification</h2>
+
+ <ul>
+ <li><a href="http://java.sun.com/xml/downloads/jaxb.html">JAXB
+ Specification</a>
+ </ul>
+
+ <h2>Related Documentation</h2>
+
+ For overviews, tutorials, examples, guides, and tool documentation,
+ please see:
+ <ul>
+ <li>The <a href="http://java.sun.com/xml/jaxb/index.html">JAXB
+ Website</a>
+ </ul>
+
+ <!-- Put @see and @since tags down here. -->
+
+ </body>
+</html>
+
+
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/util/JAXBResult.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/util/JAXBResult.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/util/JAXBResult.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,129 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+package javax.xml.bind.util;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.UnmarshallerHandler;
+import javax.xml.transform.sax.SAXResult;
+
+/**
+ * JAXP {@link javax.xml.transform.Result} implementation
+ * that unmarshals a JAXB object.
+ *
+ * <p>
+ * This utility class is useful to combine JAXB with
+ * other Java/XML technologies.
+ *
+ * <p>
+ * The following example shows how to use JAXB to unmarshal a document
+ * resulting from an XSLT transformation.
+ *
+ * <blockquote>
+ * <pre>
+ * JAXBResult result = new JAXBResult(
+ * JAXBContext.newInstance("org.acme.foo") );
+ *
+ * // set up XSLT transformation
+ * TransformerFactory tf = TransformerFactory.newInstance();
+ * Transformer t = tf.newTransformer(new StreamSource("test.xsl"));
+ *
+ * // run transformation
+ * t.transform(new StreamSource("document.xml"),result);
+ *
+ * // obtain the unmarshalled content tree
+ * Object o = result.getResult();
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * The fact that JAXBResult derives from SAXResult is an implementation
+ * detail. Thus in general applications are strongly discouraged from
+ * accessing methods defined on SAXResult.
+ *
+ * <p>
+ * In particular it shall never attempt to call the setHandler,
+ * setLexicalHandler, and setSystemId methods.
+ *
+ * @author
+ * Kohsuke Kawaguchi (kohsuke.kawaguchi at sun.com)
+ */
+public class JAXBResult extends SAXResult {
+
+ /**
+ * Creates a new instance that uses the specified
+ * JAXBContext to unmarshal.
+ *
+ * @param context The JAXBContext that will be used to create the
+ * necessary Unmarshaller. This parameter must not be null.
+ * @exception JAXBException if an error is encountered while creating the
+ * JAXBResult or if the context parameter is null.
+ */
+ public JAXBResult( JAXBContext context ) throws JAXBException {
+ this( ( context == null ) ? assertionFailed() : context.createUnmarshaller() );
+ }
+
+ /**
+ * Creates a new instance that uses the specified
+ * Unmarshaller to unmarshal an object.
+ *
+ * <p>
+ * This JAXBResult object will use the specified Unmarshaller
+ * instance. It is the caller's responsibility not to use the
+ * same Unmarshaller for other purposes while it is being
+ * used by this object.
+ *
+ * <p>
+ * The primary purpose of this method is to allow the client
+ * to configure Unmarshaller. Unless you know what you are doing,
+ * it's easier and safer to pass a JAXBContext.
+ *
+ * @param _unmarshaller the unmarshaller. This parameter must not be null.
+ * @throws JAXBException if an error is encountered while creating the
+ * JAXBResult or the Unmarshaller parameter is null.
+ */
+ public JAXBResult( Unmarshaller _unmarshaller ) throws JAXBException {
+ if( _unmarshaller == null )
+ throw new JAXBException(
+ Messages.format( Messages.RESULT_NULL_UNMARSHALLER ) );
+
+ this.unmarshallerHandler = _unmarshaller.getUnmarshallerHandler();
+
+ super.setHandler(unmarshallerHandler);
+ }
+
+ /**
+ * Unmarshaller that will be used to unmarshal
+ * the input documents.
+ */
+ private final UnmarshallerHandler unmarshallerHandler;
+
+ /**
+ * Gets the unmarshalled object created by the transformation.
+ *
+ * @return
+ * Always return a non-null object.
+ *
+ * @exception IllegalStateException
+ * if this method is called before an object is unmarshalled.
+ *
+ * @exception JAXBException
+ * if there is any unmarshalling error.
+ * Note that the implementation is allowed to throw SAXException
+ * during the parsing when it finds an error.
+ */
+ public Object getResult() throws JAXBException {
+ return unmarshallerHandler.getResult();
+ }
+
+ /**
+ * Hook to throw exception from the middle of a contructor chained call
+ * to this
+ */
+ private static Unmarshaller assertionFailed() throws JAXBException {
+ throw new JAXBException( Messages.format( Messages.RESULT_NULL_CONTEXT ) );
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/util/JAXBResult.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/util/JAXBSource.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/util/JAXBSource.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/util/JAXBSource.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,250 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+package javax.xml.bind.util;
+
+import org.xml.sax.ContentHandler;
+import org.xml.sax.DTDHandler;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.ext.LexicalHandler;
+import org.xml.sax.helpers.XMLFilterImpl;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.transform.sax.SAXSource;
+
+/**
+ * JAXP {@link javax.xml.transform.Source} implementation
+ * that marshals a JAXB-generated object.
+ *
+ * <p>
+ * This utility class is useful to combine JAXB with
+ * other Java/XML technologies.
+ *
+ * <p>
+ * The following example shows how to use JAXB to marshal a document
+ * for transformation by XSLT.
+ *
+ * <blockquote>
+ * <pre>
+ * MyObject o = // get JAXB content tree
+ *
+ * // jaxbContext is a JAXBContext object from which 'o' is created.
+ * JAXBSource source = new JAXBSource( jaxbContext, o );
+ *
+ * // set up XSLT transformation
+ * TransformerFactory tf = TransformerFactory.newInstance();
+ * Transformer t = tf.newTransformer(new StreamSource("test.xsl"));
+ *
+ * // run transformation
+ * t.transform(source,new StreamResult(System.out));
+ * </pre>
+ * </blockquote>
+ *
+ * <p>
+ * The fact that JAXBSource derives from SAXSource is an implementation
+ * detail. Thus in general applications are strongly discouraged from
+ * accessing methods defined on SAXSource. In particular,
+ * the setXMLReader and setInputSource methods shall never be called.
+ * The XMLReader object obtained by the getXMLReader method shall
+ * be used only for parsing the InputSource object returned by
+ * the getInputSource method.
+ *
+ * <p>
+ * Similarly the InputSource object obtained by the getInputSource
+ * method shall be used only for being parsed by the XMLReader object
+ * returned by the getXMLReader.
+ *
+ * @author
+ * Kohsuke Kawaguchi (kohsuke.kawaguchi at sun.com)
+ */
+public class JAXBSource extends SAXSource {
+
+ /**
+ * Creates a new {@link javax.xml.transform.Source} for the given content object.
+ *
+ * @param context
+ * JAXBContext that was used to create
+ * <code>contentObject</code>. This context is used
+ * to create a new instance of marshaller and must not be null.
+ * @param contentObject
+ * An instance of a JAXB-generated class, which will be
+ * used as a {@link javax.xml.transform.Source} (by marshalling it into XML). It must
+ * not be null.
+ * @throws JAXBException if an error is encountered while creating the
+ * JAXBSource or if either of the parameters are null.
+ */
+ public JAXBSource( JAXBContext context, Object contentObject )
+ throws JAXBException {
+
+ this(
+ ( context == null ) ?
+ assertionFailed( Messages.format( Messages.SOURCE_NULL_CONTEXT ) ) :
+ context.createMarshaller(),
+
+ ( contentObject == null ) ?
+ assertionFailed( Messages.format( Messages.SOURCE_NULL_CONTENT ) ) :
+ contentObject);
+ }
+
+ /**
+ * Creates a new {@link javax.xml.transform.Source} for the given content object.
+ *
+ * @param marshaller
+ * A marshaller instance that will be used to marshal
+ * <code>contentObject</code> into XML. This must be
+ * created from a JAXBContext that was used to build
+ * <code>contentObject</code> and must not be null.
+ * @param contentObject
+ * An instance of a JAXB-generated class, which will be
+ * used as a {@link javax.xml.transform.Source} (by marshalling it into XML). It must
+ * not be null.
+ * @throws JAXBException if an error is encountered while creating the
+ * JAXBSource or if either of the parameters are null.
+ */
+ public JAXBSource( Marshaller marshaller, Object contentObject )
+ throws JAXBException {
+
+ if( marshaller == null )
+ throw new JAXBException(
+ Messages.format( Messages.SOURCE_NULL_MARSHALLER ) );
+
+ if( contentObject == null )
+ throw new JAXBException(
+ Messages.format( Messages.SOURCE_NULL_CONTENT ) );
+
+ this.marshaller = marshaller;
+ this.contentObject = contentObject;
+
+ super.setXMLReader(pseudoParser);
+ // pass a dummy InputSource. We don't care
+ super.setInputSource(new InputSource());
+ }
+
+ private final Marshaller marshaller;
+ private final Object contentObject;
+
+ // this object will pretend as an XMLReader.
+ // no matter what parameter is specified to the parse method,
+ // it just parse the contentObject.
+ private final XMLReader pseudoParser = new XMLReader() {
+ public boolean getFeature(String name) throws SAXNotRecognizedException {
+ if(name.equals("http://xml.org/sax/features/namespaces"))
+ return true;
+ if(name.equals("http://xml.org/sax/features/namespace-prefixes"))
+ return false;
+ throw new SAXNotRecognizedException(name);
+ }
+
+ public void setFeature(String name, boolean value) throws SAXNotRecognizedException {
+ if(name.equals("http://xml.org/sax/features/namespaces") && value)
+ return;
+ if(name.equals("http://xml.org/sax/features/namespace-prefixes") && !value)
+ return;
+ throw new SAXNotRecognizedException(name);
+ }
+
+ public Object getProperty(String name) throws SAXNotRecognizedException {
+ if( "http://xml.org/sax/properties/lexical-handler".equals(name) ) {
+ return lexicalHandler;
+ }
+ throw new SAXNotRecognizedException(name);
+ }
+
+ public void setProperty(String name, Object value) throws SAXNotRecognizedException {
+ if( "http://xml.org/sax/properties/lexical-handler".equals(name) ) {
+ this.lexicalHandler = (LexicalHandler)value;
+ return;
+ }
+ throw new SAXNotRecognizedException(name);
+ }
+
+ private LexicalHandler lexicalHandler;
+
+ // we will store this value but never use it by ourselves.
+ private EntityResolver entityResolver;
+ public void setEntityResolver(EntityResolver resolver) {
+ this.entityResolver = resolver;
+ }
+ public EntityResolver getEntityResolver() {
+ return entityResolver;
+ }
+
+ private DTDHandler dtdHandler;
+ public void setDTDHandler(DTDHandler handler) {
+ this.dtdHandler = handler;
+ }
+ public DTDHandler getDTDHandler() {
+ return dtdHandler;
+ }
+
+ // SAX allows ContentHandler to be changed during the parsing,
+ // but JAXB doesn't. So this repeater will sit between those
+ // two components.
+ private XMLFilterImpl repeater = new XMLFilterImpl();
+
+ public void setContentHandler(ContentHandler handler) {
+ repeater.setContentHandler(handler);
+ }
+ public ContentHandler getContentHandler() {
+ return repeater.getContentHandler();
+ }
+
+ private ErrorHandler errorHandler;
+ public void setErrorHandler(ErrorHandler handler) {
+ this.errorHandler = handler;
+ }
+ public ErrorHandler getErrorHandler() {
+ return errorHandler;
+ }
+
+ public void parse(InputSource input) throws SAXException {
+ parse();
+ }
+
+ public void parse(String systemId) throws SAXException {
+ parse();
+ }
+
+ public void parse() throws SAXException {
+ // parses a content object by using the given marshaller
+ // SAX events will be sent to the repeater, and the repeater
+ // will further forward it to an appropriate component.
+ try {
+ marshaller.marshal( contentObject, repeater );
+ } catch( JAXBException e ) {
+ // wrap it to a SAXException
+ SAXParseException se =
+ new SAXParseException( e.getMessage(),
+ null, null, -1, -1, e );
+
+ // if the consumer sets an error handler, it is our responsibility
+ // to notify it.
+ if(errorHandler!=null)
+ errorHandler.fatalError(se);
+
+ // this is a fatal error. Even if the error handler
+ // returns, we will abort anyway.
+ throw se;
+ }
+ }
+ };
+
+ /**
+ * Hook to throw exception from the middle of a contructor chained call
+ * to this
+ */
+ private static Marshaller assertionFailed( String message )
+ throws JAXBException {
+
+ throw new JAXBException( message );
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/util/JAXBSource.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/util/Messages.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/util/Messages.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/util/Messages.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+
+package javax.xml.bind.util;
+
+import java.text.MessageFormat;
+import java.util.ResourceBundle;
+
+/**
+ * Formats error messages.
+ */
+class Messages
+{
+ static String format( String property ) {
+ return format( property, null );
+ }
+
+ static String format( String property, Object arg1 ) {
+ return format( property, new Object[]{arg1} );
+ }
+
+ static String format( String property, Object arg1, Object arg2 ) {
+ return format( property, new Object[]{arg1,arg2} );
+ }
+
+ static String format( String property, Object arg1, Object arg2, Object arg3 ) {
+ return format( property, new Object[]{arg1,arg2,arg3} );
+ }
+
+ // add more if necessary.
+
+ /** Loads a string resource and formats it with specified arguments. */
+ static String format( String property, Object[] args ) {
+ String text = ResourceBundle.getBundle(Messages.class.getName()).getString(property);
+ return MessageFormat.format(text,args);
+ }
+
+//
+//
+// Message resources
+//
+//
+ static final String UNRECOGNIZED_SEVERITY = // 1 arg
+ "ValidationEventCollector.UnrecognizedSeverity";
+
+ static final String RESULT_NULL_CONTEXT = // 0 args
+ "JAXBResult.NullContext";
+
+ static final String RESULT_NULL_UNMARSHALLER = // 0 arg
+ "JAXBResult.NullUnmarshaller";
+
+ static final String SOURCE_NULL_CONTEXT = // 0 args
+ "JAXBSource.NullContext";
+
+ static final String SOURCE_NULL_CONTENT = // 0 arg
+ "JAXBSource.NullContent";
+
+ static final String SOURCE_NULL_MARSHALLER = // 0 arg
+ "JAXBSource.NullMarshaller";
+
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/util/Messages.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/util/ValidationEventCollector.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/util/ValidationEventCollector.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/util/ValidationEventCollector.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ */
+package javax.xml.bind.util;
+
+import java.util.Vector;
+import javax.xml.bind.ValidationEventHandler;
+import javax.xml.bind.ValidationEvent;
+
+/**
+ * {@link javax.xml.bind.ValidationEventHandler ValidationEventHandler}
+ * implementation that collects all events.
+ *
+ * <p>
+ * To use this class, create a new instance and pass it to the setEventHandler
+ * method of the Validator, Unmarshaller, Marshaller class. After the call to
+ * validate or unmarshal completes, call the getEvents method to retrieve all
+ * the reported errors and warnings.
+ *
+ * @author <ul><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
+ * @version $Revision$
+ * @see javax.xml.bind.Validator
+ * @see javax.xml.bind.ValidationEventHandler
+ * @see javax.xml.bind.ValidationEvent
+ * @see javax.xml.bind.ValidationEventLocator
+ * @since JAXB1.0
+ */
+public class ValidationEventCollector implements ValidationEventHandler
+{
+ private final Vector<ValidationEvent> events = new Vector<ValidationEvent>();
+
+ /**
+ * Return an array of ValidationEvent objects containing a copy of each of
+ * the collected errors and warnings.
+ *
+ * @return
+ * a copy of all the collected errors and warnings or an empty array
+ * if there weren't any
+ */
+ public ValidationEvent[] getEvents() {
+ return events.toArray(new ValidationEvent[events.size()]);
+ }
+
+ /**
+ * Clear all collected errors and warnings.
+ */
+ public void reset() {
+ events.removeAllElements();
+ }
+
+ /**
+ * Returns true if this event collector contains at least one
+ * ValidationEvent.
+ *
+ * @return true if this event collector contains at least one
+ * ValidationEvent, false otherwise
+ */
+ public boolean hasEvents() {
+ return !events.isEmpty();
+ }
+
+ public boolean handleEvent( ValidationEvent event ) {
+ events.add(event);
+
+ boolean retVal = true;
+ switch( event.getSeverity() ) {
+ case ValidationEvent.WARNING:
+ retVal = true; // continue validation
+ break;
+ case ValidationEvent.ERROR:
+ retVal = true; // continue validation
+ break;
+ case ValidationEvent.FATAL_ERROR:
+ retVal = false; // halt validation
+ break;
+ default:
+ _assert( false,
+ Messages.format( Messages.UNRECOGNIZED_SEVERITY,
+ event.getSeverity() ) );
+ break;
+ }
+
+ return retVal;
+ }
+
+ private static void _assert( boolean b, String msg ) {
+ if( !b ) {
+ throw new InternalError( msg );
+ }
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/util/ValidationEventCollector.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/util/package.html
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/util/package.html (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/javax/xml/bind/util/package.html 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,48 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+ <head>
+ <!--
+
+ @(#)package.html 1.60 98/01/27
+
+ Copyright 1998 Sun Microsystems, Inc. 901 San Antonio Road,
+ Palo Alto, California, 94303, U.S.A. All Rights Reserved.
+
+ This software is the confidential and proprietary information of Sun
+ Microsystems, Inc. ("Confidential Information"). You shall not
+ disclose such Confidential Information and shall use it only in
+ accordance with the terms of the license agreement you entered into
+ with Sun.
+
+ CopyrightVersion 1.2
+
+ -->
+ </head>
+
+ <body bgcolor="white">
+
+ <p>
+ Useful client utility classes.
+
+ <h2>Package Specification</h2>
+
+ <ul>
+ <li><a href="http://java.sun.com/xml/downloads/jaxb.html">JAXB
+ Specification</a>
+ </ul>
+
+ <h2>Related Documentation</h2>
+
+ For overviews, tutorials, examples, guides, and tool documentation,
+ please see:
+ <ul>
+ <li>The <a href="http://java.sun.com/xml/jaxb/index.html">JAXB
+ Website</a>
+ </ul>
+
+ <!-- Put @see and @since tags down here. -->
+
+ </body>
+</html>
+
+
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/Config.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/Config.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/Config.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class Config
+{
+ String consoleServerUrl = "http://localhost:8080";
+ String webContext = "/gwt-console-server";
+
+ public String getConsoleServerUrl()
+ {
+ return consoleServerUrl;
+ }
+
+ public void setConsoleServerUrl(String consoleServerUrl)
+ {
+ this.consoleServerUrl = consoleServerUrl;
+ }
+
+ public String getWebContext()
+ {
+ return webContext;
+ }
+
+ public void setWebContext(String webContext)
+ {
+ this.webContext = webContext;
+ }
+
+ public String getProcessDefinitionURL()
+ {
+ return consoleServerUrl + webContext + "/rs/process/definitions";
+ }
+
+ public String getProcessInstanceURL(long processId)
+ {
+ return consoleServerUrl + webContext + "/rs/process/definitions/"+processId+"/instances";
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/Config.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/ConsoleView.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/ConsoleView.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/ConsoleView.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -27,6 +27,8 @@
import com.gwtext.client.core.RegionPosition;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.Viewport;
+import com.gwtext.client.widgets.MessageBox;
+import com.gwtext.client.widgets.MessageBoxConfig;
import com.gwtext.client.widgets.layout.BorderLayout;
import com.gwtext.client.widgets.layout.BorderLayoutData;
import com.gwtext.client.widgets.layout.FitLayout;
@@ -34,6 +36,7 @@
import org.jboss.bpm.console.client.process.ProcessDefinitionListEditor;
import org.jboss.bpm.console.client.widgets.EditorView;
import org.jboss.bpm.console.client.widgets.UIConstants;
+import org.jboss.bpm.console.client.model.ProcessDefinition;
/**
* @author Heiko.Braun <heiko.braun at jboss.com>
@@ -49,11 +52,17 @@
private MainMenu mainMenu;
private EditorPanel editorPanel;
+ private Config config = new Config();
+
+ private Viewport viewport;
+
public ConsoleView()
{
mainPanel.setBorder(false);
mainPanel.setPaddings(5); // outer most padding
- mainPanel.setLayout(new FitLayout());
+ mainPanel.setLayout(new FitLayout());
+ mainPanel.setWidth(1024);
+ mainPanel.setHeight(768);
initWidget( mainPanel );
@@ -87,7 +96,9 @@
// ------------------------------------------
mainPanel.add(borderPanel);
- Viewport viewport = new Viewport(mainPanel);
+
+ // auto viewport and js init
+ viewport = new Viewport(mainPanel);
}
public void addEditorView(EditorView editorView)
@@ -100,13 +111,32 @@
return editorPanel.hasEditor(id);
}
+ public Config getConfig()
+ {
+ return config;
+ }
+
public void showEditor(String id)
{
editorPanel.showTab(id);
}
- public void setError(String error)
+ public void setError(final String error)
{
status.setText(error);
+
+ MessageBox.show(new MessageBoxConfig() {
+ {
+ setTitle("Unknown Error");
+ setMsg(error);
+ setButtons(MessageBox.OK);
+ setCallback(new MessageBox.PromptCallback()
+ {
+ public void execute(String btnID, String text)
+ {
+ }
+ });
+ }
+ });
}
}
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricEditor.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricEditor.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricEditor.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -59,7 +59,7 @@
// -----------------------------------------------
this.setLayout( new ColumnLayout() );
- this.setWidth(UIConstants.EDITOR_PANE_WIDTH);
+ this.setWidth(UIConstants.EDITOR_WIDTH);
// -----------------------------------------------
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricView.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricView.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/DefinitionMetricView.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -57,7 +57,7 @@
// ----------------------------------------
ProcessInstancePerformance perf =
- DAOFactory.createMetricsDAO().getProcessInstancePerformance(parent.getId());
+ DAOFactory.createMetricsDAO().getProcessInstancePerformance(parent.getProcessId());
LineChart chart = new LineChart(
parent.getName() + " performance", 380, 260, perf.getInstanceMetrics(), "Instance", "t"
@@ -69,7 +69,7 @@
chartPanel.setPaddings(10);
chartPanel.setHeader(false);
chartPanel.setBorder(false);
- chartPanel.setWidth(UIConstants.EDITOR_PANE_WIDTH);
+ chartPanel.setWidth(UIConstants.EDITOR_WIDTH);
chartPanel.add(chart);
// ----------------------------------------
@@ -82,7 +82,7 @@
//create the form
FormPanel formPanel = new FormPanel();
formPanel.setLabelAlign(Position.LEFT);
- formPanel.setWidth(UIConstants.MAIN_EDITOR_PANEL_WIDTH);
+ formPanel.setWidth(UIConstants.EDITOR_PANEL_WIDTH);
formPanel.setHeader(false);
formPanel.setFrame(false);
formPanel.setPaddings(5, 5, 5, 0);
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverview.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverview.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverview.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -80,7 +80,7 @@
chartPanel.setPaddings(10);
chartPanel.setHeader(false);
chartPanel.setBorder(false);
- chartPanel.setWidth(UIConstants.EDITOR_PANE_WIDTH);
+ chartPanel.setWidth(UIConstants.EDITOR_WIDTH);
chartPanel.add( chart );
// -------------------------------
@@ -93,7 +93,7 @@
formPanel.setFrame(true);
formPanel.setTitle("View process details");
- formPanel.setWidth(UIConstants.MAIN_EDITOR_PANEL_WIDTH);
+ formPanel.setWidth(UIConstants.EDITOR_PANEL_WIDTH);
formPanel.setLabelWidth(75);
//formPanel.setUrl("save-form.php");
@@ -185,7 +185,7 @@
{
ProcessDefinition pd = (ProcessDefinition)it.next();
records[row] = new Object[3];
- records[row][0] = new Long(pd.getId());
+ records[row][0] = new Long(pd.getProcessId());
records[row][1] = pd.getName();
records[row][2] = pd.getVersion();
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverviewEditor.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverviewEditor.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/metric/MetricOverviewEditor.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -52,7 +52,7 @@
// -------------------------------------
this.setLayout( new ColumnLayout() );
- this.setWidth(UIConstants.EDITOR_PANE_WIDTH);
+ this.setWidth(UIConstants.EDITOR_WIDTH);
// -------------------------------------
Deleted: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinition.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinition.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessDefinition.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -1,79 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.model;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public class ProcessDefinition
-{
- private long Id;
- private String name;
- private String version;
-
- public ProcessDefinition()
- {
- }
-
- public ProcessDefinition(long id, String name, String version)
- {
- this.Id = id;
- this.name = name;
- this.version = version;
- }
-
- public long getId()
- {
- return Id;
- }
-
- public void setId(long id)
- {
- Id = id;
- }
-
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public String getVersion()
- {
- return version;
- }
-
- public void setVersion(String version)
- {
- this.version = version;
- }
-
-
- public String toString()
- {
- return "ProcessDefinition{id="+this.Id+", name="+this.name+"}";
- }
-}
Deleted: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessInstance.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessInstance.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessInstance.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -1,111 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.model;
-
-import java.util.Date;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public class ProcessInstance
-{
- private long Id;
- private long parentId;
-
- private String key;
- private String status;
- private Date startDate;
- private Date endDate;
-
- public ProcessInstance()
- {
- }
-
- public ProcessInstance(long id, long parentId, String status, Date startDate, Date endDate)
- {
- this.Id = id;
- this.parentId = parentId;
- this.status = status;
- this.startDate = startDate;
- this.endDate = endDate;
- }
-
- public long getId()
- {
- return Id;
- }
-
- public void setId(long id)
- {
- Id = id;
- }
-
- public long getParentId()
- {
- return parentId;
- }
-
- public void setParentId(long parentId)
- {
- this.parentId = parentId;
- }
-
- public String getKey()
- {
- return key !=null ? key : "";
- }
-
- public void setKey(String key)
- {
- this.key = key;
- }
-
- public String getStatus()
- {
- return status;
- }
-
- public void setStatus(String status)
- {
- this.status = status;
- }
-
- public Date getStartDate()
- {
- return startDate;
- }
-
- public void setStartDate(Date startDate)
- {
- this.startDate = startDate;
- }
-
- public Date getEndDate()
- {
- return endDate;
- }
-
- public void setEndDate(Date endDate)
- {
- this.endDate = endDate;
- }
-}
Deleted: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessInstancePerformance.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessInstancePerformance.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/ProcessInstancePerformance.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.model;
-
-import java.util.Map;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public final class ProcessInstancePerformance
-{
- private long id;
- private String processName;
-
- Map instanceMetrics; // Map<instanceId,averageExectime>
-
- public ProcessInstancePerformance(long processId, String processName, Map instanceMetrics)
- {
- this.id = processId;
- this.processName = processName;
- this.instanceMetrics = instanceMetrics;
- }
-
-
- public long getId()
- {
- return id;
- }
-
- public String getProcessName()
- {
- return processName;
- }
-
- public Map getInstanceMetrics()
- {
- return instanceMetrics;
- }
-}
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockMetricsDAO.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockMetricsDAO.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockMetricsDAO.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -40,7 +40,7 @@
ProcessDefinition pd = DAOFactory.createProcessDefinitionDAO().getProcessDefinitionById(processId);
ProcessInstancePerformance performance = new ProcessInstancePerformance(
- pd.getId(), pd.getName(), generateInstanceMetrics(processId)
+ pd.getProcessId(), pd.getName(), generateInstanceMetrics(processId)
);
return performance;
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockProcessDefinitionDAO.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockProcessDefinitionDAO.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/model/internal/MockProcessDefinitionDAO.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -57,7 +57,7 @@
for(int i=0; i<defs.size(); i++)
{
ProcessDefinition pd = (ProcessDefinition)defs.get(i);
- if(pd.getId() == id)
+ if(pd.getProcessId() == id)
{
result = pd;
break;
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionList.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionList.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionList.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -22,79 +22,75 @@
package org.jboss.bpm.console.client.process;
import com.gwtext.client.data.*;
-import com.gwtext.client.widgets.MessageBox;
-import com.gwtext.client.widgets.MessageBoxConfig;
+import com.gwtext.client.widgets.*;
import com.gwtext.client.widgets.grid.ColumnConfig;
import com.gwtext.client.widgets.grid.ColumnModel;
import org.jboss.bpm.console.client.ConsoleView;
-import org.jboss.bpm.console.client.model.DAOFactory;
import org.jboss.bpm.console.client.model.ProcessDefinition;
-import org.jboss.bpm.console.client.model.ProcessDefinitionDAO;
-import org.jboss.bpm.console.client.widgets.ListView;
+import org.jboss.bpm.console.client.widgets.RemoteListView;
import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
import java.util.Map;
/**
* @author Heiko.Braun <heiko.braun at jboss.com>
*/
-public class ProcessDefinitionList extends ListView
+public class ProcessDefinitionList extends RemoteListView
{
-
private Map row2ProcessMap = new HashMap();
- public ProcessDefinitionList(String titleName, ConsoleView view)
+ public ProcessDefinitionList(String titleName, final ConsoleView view)
{
- super(titleName, view);
+ super(titleName, view, getResourceUrl(view));
+ }
- // ----------------------------------------
+ private static String getResourceUrl(ConsoleView view)
+ {
+ return view.getConfig().getProcessDefinitionURL();
+ }
- final RecordDef recordDef = new RecordDef(
- new FieldDef[]{
- new IntegerFieldDef("processId"),
- new StringFieldDef("name"),
- new StringFieldDef("version")
- }
- );
-
- // ----------------------------------------
-
+ protected ColumnModel createColumnModel()
+ {
final ColumnModel columnModel = new ColumnModel(
new ColumnConfig[]
{
new ColumnConfig("Process ID", "processId", 75, true),
- new ColumnConfig("Name", "name", 300, true, null, "name"),
+ new ColumnConfig("Name", "name", 300, true, null, "expand"),
new ColumnConfig("Version", "version", 75, true)
}
);
+ return columnModel;
+ }
- grid.setColumnModel(columnModel);
+ protected JsonReader createReader()
+ {
+ final RecordDef recordDef = new RecordDef(
+ new FieldDef[]{
+ new IntegerFieldDef("processId"),
+ new StringFieldDef("name"),
+ new StringFieldDef("version")
+ }
+ );
- // ----------------------------------------
-
- Store store = createStore(recordDef);
- store.load();
- grid.setStore(store);
-
- grid.setAutoExpandColumn("name");
- grid.setAutoExpandMin(300);
-
+ final JsonReader reader = new JsonReader(recordDef);
+ reader.setRoot("definitions");
+ reader.setTotalProperty("totalCount");
+ reader.setId("processId");
+ return reader;
}
- protected void onExamine(final Integer row)
+ protected void onExamine(int row)
{
ProcessDefinition proc = (ProcessDefinition)row2ProcessMap.get(row);
String editorId = ProcessInstanceEditor.ID+"."+proc.getName();
-
+
if(view.hasEditorView(editorId))
view.showEditor(editorId);
else
view.addEditorView( new ProcessInstanceListEditor(proc, view) );
}
- protected void onDelete(final Integer row)
+ protected void onDelete(final int row)
{
System.out.println("Delete " + row);
MessageBox.show(new MessageBoxConfig() {
@@ -115,38 +111,23 @@
});
}
- protected final Store createStore(RecordDef recordDef)
- {
- MemoryProxy proxy = new MemoryProxy( getData() );
- ArrayReader reader = new ArrayReader(recordDef);
- Store store = new Store(proxy, reader);
- return store;
- }
-
- protected Object[][] getData()
+ protected void onRecordsLoaded(Record[] records)
{
- ProcessDefinitionDAO dao = DAOFactory.createProcessDefinitionDAO();
- List processDefs = dao.getAllProcessDefinitions();
-
- Object[][] records = new Object[processDefs.size()][];
-
- Iterator it = processDefs.iterator();
- int row = 0;
- while(it.hasNext())
+ int i = 0;
+ for(Record r : records)
{
- ProcessDefinition pd = (ProcessDefinition)it.next();
- records[row] = new Object[3];
- records[row][0] = new Long(pd.getId());
- records[row][1] = pd.getName();
- records[row][2] = pd.getVersion();
+ Long id = Long.valueOf(r.getAsString("processId"));
+ ProcessDefinition pd = new ProcessDefinition(
+ id,
+ r.getAsString("name"),
+ r.getAsString("version")
+ );
- row2ProcessMap.put(new Integer(row), pd);
-
- row++;
+ row2ProcessMap.put(i, pd);
+ i++;
}
- return records;
+ System.out.println("Loaded " + row2ProcessMap.size() + " records");
}
-
-
}
+
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDefinitionListEditor.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -58,7 +58,7 @@
this.view = view;
this.setLayout( new ColumnLayout() );
- this.setWidth(UIConstants.EDITOR_PANE_WIDTH);
+ this.setWidth(UIConstants.EDITOR_WIDTH);
// ----------------------------------
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceEditor.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceEditor.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceEditor.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -63,7 +63,7 @@
// ----------------------------------
this.setPaddings(10);
- this.setWidth(UIConstants.EDITOR_PANE_WIDTH);
+ this.setWidth(UIConstants.EDITOR_WIDTH);
this.setLayout( new ColumnLayout() );
this.setBorder(false);
@@ -72,7 +72,7 @@
// ----------------------------------
ProcessImageView imageView = new ProcessImageView(instance);
- imageView.setWidth(UIConstants.MAIN_EDITOR_PANEL_WIDTH);
+ imageView.setWidth(UIConstants.EDITOR_PANEL_WIDTH);
Toolbar imageToolbar = new Toolbar();
imageToolbar.addFill();
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -25,21 +25,17 @@
import com.gwtext.client.widgets.grid.ColumnConfig;
import com.gwtext.client.widgets.grid.ColumnModel;
import org.jboss.bpm.console.client.ConsoleView;
-import org.jboss.bpm.console.client.model.DAOFactory;
import org.jboss.bpm.console.client.model.ProcessDefinition;
import org.jboss.bpm.console.client.model.ProcessInstance;
-import org.jboss.bpm.console.client.model.ProcessInstanceDAO;
-import org.jboss.bpm.console.client.widgets.ListView;
+import org.jboss.bpm.console.client.widgets.RemoteListView;
import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
import java.util.Map;
/**
* @author Heiko.Braun <heiko.braun at jboss.com>
*/
-public class ProcessInstanceList extends ListView
+public class ProcessInstanceList extends RemoteListView
{
private Map row2InstanceMap = new HashMap();
@@ -47,45 +43,8 @@
public ProcessInstanceList(ProcessDefinition procDef, String titleName, ConsoleView view)
{
- super(titleName, view);
+ super(titleName, view, getResourceUrl(view, procDef.getProcessId()));
this.parent = procDef;
-
- // ----------------------------------------
-
- final RecordDef recordDef = new RecordDef(
- new FieldDef[]{
- new IntegerFieldDef("instanceId"),
- new StringFieldDef("key"),
- new StringFieldDef("status"),
- new DateFieldDef("start"),
- new DateFieldDef("end")
- }
- );
-
- // ----------------------------------------
-
- final ColumnModel columnModel = new ColumnModel(
- new ColumnConfig[]
- {
- new ColumnConfig("Instance ID", "instanceId", 50, true),
- new ColumnConfig("key", "key", 50, true),
- new ColumnConfig("Status", "status", 100, true, null, "status"),
- new ColumnConfig("Start Date", "start", 125, true),
- new ColumnConfig("End Date", "end", 125, true)
- }
- );
-
- grid.setColumnModel(columnModel);
-
- // ----------------------------------------
-
- Store store = createStore(recordDef);
- store.load();
- grid.setStore(store);
-
-
- grid.setAutoExpandColumn("status");
- grid.setAutoExpandMin(100);
}
ProcessDefinition getProcessDefinition()
@@ -93,55 +52,83 @@
return parent;
}
- protected final Store createStore(RecordDef recordDef)
+ protected void onExamine(final int row)
{
- MemoryProxy proxy = new MemoryProxy( getData() );
- ArrayReader reader = new ArrayReader(recordDef);
- Store store = new Store(proxy, reader);
- return store;
+ ProcessInstance instance = (ProcessInstance)row2InstanceMap.get(row);
+ String id = ProcessInstanceEditor.ID+"."+instance.getId();
+ if(view.hasEditorView(id))
+ view.showEditor(id);
+ else
+ view.addEditorView( new ProcessInstanceEditor(parent, instance, view) );
}
- protected Object[][] getData()
+ protected void onDelete(final int row)
{
- ProcessInstanceDAO dao = DAOFactory.createProcessInstanceDAO();
- List processDefs = dao.getInstanceByProcessDefinitionId(parent.getId());
+ // TODO: Implement
+ }
- Object[][] records = new Object[processDefs.size()][];
-
- //DateTimeFormat df = DateTimeFormat.getFormat("yyyy.MM.dd - HH:mm:ss");
-
- Iterator it = processDefs.iterator();
- int row = 0;
- while(it.hasNext())
+ protected void onRecordsLoaded(Record[] records)
+ {
+ int i = 0;
+ for(Record r : records)
{
- ProcessInstance pd = (ProcessInstance)it.next();
- records[row] = new Object[5];
- records[row][0] = new Long(pd.getId());
- records[row][1] = pd.getKey();
- records[row][2] = pd.getStatus();
- records[row][3] = pd.getStartDate();
- records[row][4] = pd.getEndDate();
+ Long id = Long.valueOf(r.getAsString("instanceId"));
+ ProcessInstance pd = new ProcessInstance(
+ id,
+ Long.valueOf( r.getAsString("parentId")),
+ r.getAsString("status"),
+ r.getAsDate("start"),
+ r.getAsDate("end")
+ );
- row2InstanceMap.put(new Integer(row), pd);
-
- row++;
+ row2InstanceMap.put(i, pd);
+ i++;
}
- return records;
+ System.out.println("Loaded " + row2InstanceMap.size() + " records");
}
- protected void onExamine(final Integer row)
+ protected ColumnModel createColumnModel()
{
- ProcessInstance instance = (ProcessInstance)row2InstanceMap.get(row);
- String id = ProcessInstanceEditor.ID+"."+instance.getId();
- if(view.hasEditorView(id))
- view.showEditor(id);
- else
- view.addEditorView( new ProcessInstanceEditor(parent, instance, view) );
+ final ColumnModel columnModel = new ColumnModel(
+ new ColumnConfig[]
+ {
+ new ColumnConfig("Instance ID", "instanceId", 75, true),
+ //new ColumnConfig("Process ID", "parentId", 25, true),
+ //new ColumnConfig("Key", "key", 50, true),
+ new ColumnConfig("Status", "status", 100, true, null, "expand"),
+ new ColumnConfig("Start Date", "start", 125, true),
+ new ColumnConfig("End Date", "end", 125, true)
+ }
+ );
+
+ return columnModel;
}
- protected void onDelete(final Integer row)
+ protected JsonReader createReader()
{
+ final RecordDef recordDef = new RecordDef(
+ new FieldDef[]{
+ new IntegerFieldDef("instanceId"),
+ new IntegerFieldDef("parentId"),
+ new StringFieldDef("key"),
+ new StringFieldDef("status"),
+ new DateFieldDef("start"),
+ new DateFieldDef("end")
+ }
+ );
+ final JsonReader reader = new JsonReader(recordDef);
+ reader.setRoot("instances");
+ reader.setTotalProperty("totalCount");
+ reader.setId("instanceId");
+
+ return reader;
}
+
+ private static String getResourceUrl(ConsoleView view, long parentId)
+ {
+ return view.getConfig().getProcessInstanceURL(parentId);
+ }
+
}
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -33,7 +33,6 @@
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.grid.RowSelectionModel;
import com.gwtext.client.widgets.grid.event.RowSelectionListenerAdapter;
-import com.gwtext.client.widgets.layout.ColumnLayoutData;
import com.gwtext.client.core.Position;
import com.gwtext.client.core.Function;
import com.gwtext.client.data.Record;
@@ -41,7 +40,7 @@
/**
* @author Heiko.Braun <heiko.braun at jboss.com>
*
- * @see org.jboss.bpm.console.client.process.ProcessDefinitionList#onExamine(Integer)
+ * @see org.jboss.bpm.console.client.process.ProcessDefinitionList#onExamine(int)
*/
public class ProcessInstanceListEditor extends EditorView
{
@@ -74,7 +73,7 @@
final FormPanel formPanel = new FormPanel();
formPanel.setLabelAlign(Position.LEFT);
- formPanel.setWidth(UIConstants.MAIN_EDITOR_PANEL_WIDTH);
+ formPanel.setWidth(UIConstants.EDITOR_PANEL_WIDTH);
formPanel.setHeader(false);
formPanel.setFrame(false);
formPanel.setPaddings(5, 5, 5, 0);
Deleted: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/ListView.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/ListView.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/ListView.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -1,138 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.widgets;
-
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.widgets.*;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-import com.gwtext.client.widgets.grid.GridPanel;
-import com.gwtext.client.widgets.grid.event.GridCellListener;
-import org.jboss.bpm.console.client.ConsoleView;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public abstract class ListView extends Panel
-{
- protected ConsoleView view;
- protected GridPanel grid;
-
- private Integer selectedRowIndex = null;
-
- public ListView(String titleName, ConsoleView view)
- {
- super();
- this.setId(getId());
- this.view = view;
-
- // ----------------------------------
-
- this.setPaddings(10);
- this.setHeader(false);
- this.setBorder(false);
- this.setFrame(false);
-
- // ----------------------------------
-
- this.grid = new GridPanel();
-
- grid.addGridCellListener(new GridCellListener()
- {
- public void onCellClick(GridPanel grid, int rowIndex, int colindex, EventObject e)
- {
- selectedRowIndex = new Integer(rowIndex);
- }
-
- public void onCellContextMenu(GridPanel gridPanel, int i, int i1, EventObject eventObject)
- {
-
- }
-
- public void onCellDblClick(GridPanel gridPanel, int i, int i1, EventObject eventObject)
- {
-
- }
- }
- );
-
- // ----------------------------------------
-
- Toolbar bottomToolbar = new Toolbar();
- bottomToolbar.addFill();
- bottomToolbar.addButton(
- new ToolbarButton("Examine", new ButtonListenerAdapter() {
- public void onClick(Button button, EventObject e)
- {
- if(null== selectedRowIndex)
- MessageBox.alert("Please select a process.");
- else
- onExamine(selectedRowIndex);
- }
- })
- );
-
- bottomToolbar.addButton(
- new ToolbarButton("Delete", new ButtonListenerAdapter()
- {
- public void onClick(Button button, EventObject e)
- {
- if(null== selectedRowIndex)
- {
- MessageBox.alert("Please select a process.");
- }
- else
- {
- onDelete(selectedRowIndex);
- }
- }
- })
- );
-
- grid.setBottomToolbar(bottomToolbar);
-
- // ----------------------------------------
-
- grid.setFrame(false);
- grid.setStripeRows(true);
- grid.setTitle(titleName);
-
- grid.setWidth(UIConstants.EDITOR_PANEL_WIDTH);
-
- grid.setEnableHdMenu(false);
- grid.setEnableColumnMove(false);
-
- // ----------------------------------------
-
- this.add(grid);
-
- }
-
- protected abstract void onExamine(final Integer row);
-
- protected abstract void onDelete(final Integer row);
-
-
- public GridPanel getGrid()
- {
- return grid;
- }
-}
Added: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java (rev 0)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -0,0 +1,227 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.widgets;
+
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.data.*;
+import com.gwtext.client.data.event.StoreListenerAdapter;
+import com.gwtext.client.widgets.*;
+import com.gwtext.client.widgets.event.PanelListenerAdapter;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
+import com.gwtext.client.widgets.grid.ColumnModel;
+import com.gwtext.client.widgets.grid.GridPanel;
+import com.gwtext.client.widgets.grid.event.GridCellListener;
+import org.jboss.bpm.console.client.ConsoleView;
+
+/**
+ * A {@link com.gwtext.client.widgets.grid.GridPanel} view that will pull data
+ * from a remote REST/Json resource.
+ * <p>
+ * The view will be lazily initialized by calling {@link com.gwtext.client.data.Store#load()}
+ * in {@link com.gwtext.client.widgets.event.PanelListenerAdapter#doBeforeRender(com.gwtext.client.widgets.Component)}
+ * and subsequently add the grid to the container panel upon {@link com.gwtext.client.data.event.StoreListenerAdapter#onLoad(com.gwtext.client.data.Store, com.gwtext.client.data.Record[])}
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public abstract class RemoteListView extends Panel
+{
+ protected int selectedRowIndex = -1;
+ protected ConsoleView view;
+ protected static final int PAGE_SIZE = 25;
+ private GridPanel grid;
+ protected String title;
+
+ public RemoteListView(String titleName, ConsoleView view, String resourceUrl)
+ {
+ super();
+
+ this.title = titleName;
+ this.view = view;
+
+ // ----------------------------------------
+
+ this.setPaddings(10);
+ this.setHeader(false);
+ this.setBorder(false);
+ this.setFrame(false);
+
+ // ----------------------------------------
+
+ grid = createGridPanel(titleName);
+
+ // ----------------------------------------
+
+ final JsonReader reader = createReader();
+
+ // ----------------------------------------
+
+ final ColumnModel columnModel = createColumnModel();
+ grid.setColumnModel(columnModel);
+ grid.setAutoExpandColumn("expand");
+ //grid.setAutoExpandMin(300);
+
+ // ----------------------------------------
+
+ DataProxy dataProxy = new ScriptTagProxy(resourceUrl, 1000*10);
+
+ final Store store = new Store(dataProxy, reader, false); // boolean==remoteSort, add's GET parameters
+ store.addStoreListener( new ListViewStoreListener(this, grid) );
+ grid.setStore(store);
+
+ // ------------------------------------------
+ final PagingToolbar pagingToolbar = createToolbar(store);
+ grid.setBottomToolbar(pagingToolbar);
+
+ // PanelListener will lazy load store data.
+ // Store.onLoad() callback will populate the grid
+ // and add it to the container panel.
+ this.addListener( new PanelListenerAdapter()
+ {
+ public boolean doBeforeRender(Component component)
+ {
+ store.load(0, PAGE_SIZE);
+ return true;
+ }
+ }
+ );
+
+ }
+
+ private GridPanel createGridPanel(String titleName)
+ {
+ GridPanel grid = new GridPanel();
+
+ grid.setTitle(titleName);
+ grid.setFrame(true);
+ grid.setWidth(UIConstants.EDITOR_PANEL_WIDTH);
+ grid.stripeRows(true);
+
+ grid.addGridCellListener( new ListViewCellListener() );
+
+ return grid;
+ }
+
+ private PagingToolbar createToolbar(Store store)
+ {
+ PagingToolbar pagingToolbar = new PagingToolbar(store);
+ pagingToolbar.setPageSize(PAGE_SIZE);
+ pagingToolbar.setDisplayInfo(false);
+
+ pagingToolbar.addButton(
+ new ToolbarButton("Examine", new ButtonListenerAdapter() {
+ public void onClick(Button button, EventObject e)
+ {
+ if(-1== selectedRowIndex)
+ MessageBox.alert("Please select a process.");
+ else
+ onExamine(selectedRowIndex);
+ }
+ })
+ );
+
+ pagingToolbar.addButton(
+ new ToolbarButton("Delete", new ButtonListenerAdapter()
+ {
+ public void onClick(Button button, EventObject e)
+ {
+ if(-1== selectedRowIndex)
+ {
+ MessageBox.alert("Please select a process.");
+ }
+ else
+ {
+ onDelete(selectedRowIndex);
+ }
+ }
+ })
+ );
+
+ return pagingToolbar;
+ }
+
+ protected abstract void onExamine(final int row);
+
+ protected abstract void onDelete(final int row);
+
+ protected abstract void onRecordsLoaded(Record[] records);
+
+ protected abstract ColumnModel createColumnModel();
+
+ protected abstract JsonReader createReader();
+
+ private class ListViewStoreListener extends StoreListenerAdapter
+ {
+
+ Panel containerPanel;
+ GridPanel grid;
+
+ public ListViewStoreListener(Panel containerPanel, GridPanel grid)
+ {
+ this.containerPanel = containerPanel;
+ this.grid = grid;
+ }
+
+ /**
+ * load callback will push records to implementation
+ * and (!) add the grid to the container panel.
+ */
+ public void onLoad(Store store, Record[] records)
+ {
+
+ onRecordsLoaded(records);
+
+ containerPanel.clear();
+ containerPanel.add(grid);
+ containerPanel.doLayout();
+ }
+
+ public void onLoadException(Throwable throwable)
+ {
+ throwable.printStackTrace(System.out);
+ view.setError("Failed to load remote data: " + throwable.getMessage());
+ }
+
+ };
+
+ private class ListViewCellListener implements GridCellListener
+ {
+ public void onCellClick(GridPanel grid, int rowIndex, int colindex, EventObject e)
+ {
+ selectedRowIndex = rowIndex;
+ }
+
+ public void onCellContextMenu(GridPanel gridPanel, int i, int i1, EventObject eventObject)
+ {
+
+ }
+
+ public void onCellDblClick(GridPanel gridPanel, int i, int i1, EventObject eventObject)
+ {
+
+ }
+ }
+
+ public GridPanel getGrid()
+ {
+ return grid;
+ }
+}
Property changes on: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/UIConstants.java
===================================================================
--- jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/UIConstants.java 2008-10-02 11:44:36 UTC (rev 2466)
+++ jbpm3/trunk/modules/gwt-console/war/src/main/java/org/jboss/bpm/console/client/widgets/UIConstants.java 2008-10-02 12:37:27 UTC (rev 2467)
@@ -25,11 +25,10 @@
* @author Heiko.Braun <heiko.braun at jboss.com>
*/
public class UIConstants
-{
- final static int EDITOR_PANEL_WIDTH = 450;
+{
public static final int MAIN_MENU_MIN = 175;
public static final int MAIN_MENU_MAX = 400;
- public static final int EDITOR_PANE_WIDTH = 680;
+ public static final int EDITOR_WIDTH = 680;
public static final int TEASER_PANEL_WIDTH = 200;
- public static final int MAIN_EDITOR_PANEL_WIDTH = 450;
+ public static final int EDITOR_PANEL_WIDTH = 450;
}
More information about the jbpm-commits
mailing list