Return-Path: Delivered-To: apmail-activemq-camel-commits-archive@locus.apache.org Received: (qmail 3897 invoked from network); 23 Oct 2008 13:41:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Oct 2008 13:41:45 -0000 Received: (qmail 92538 invoked by uid 500); 23 Oct 2008 13:41:41 -0000 Delivered-To: apmail-activemq-camel-commits-archive@activemq.apache.org Received: (qmail 92523 invoked by uid 500); 23 Oct 2008 13:41:41 -0000 Mailing-List: contact camel-commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-dev@activemq.apache.org Delivered-To: mailing list camel-commits@activemq.apache.org Received: (qmail 92512 invoked by uid 99); 23 Oct 2008 13:41:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Oct 2008 06:41:41 -0700 X-ASF-Spam-Status: No, hits=-1999.8 required=10.0 tests=ALL_TRUSTED,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Oct 2008 13:40:22 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id C6AD3238896D; Thu, 23 Oct 2008 06:41:01 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r707373 - /activemq/camel/trunk/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/XStreamDataFormat.java Date: Thu, 23 Oct 2008 13:41:00 -0000 To: camel-commits@activemq.apache.org From: jstrachan@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081023134101.C6AD3238896D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jstrachan Date: Thu Oct 23 06:41:00 2008 New Revision: 707373 URL: http://svn.apache.org/viewvc?rev=707373&view=rev Log: added a factory method to make it easier to create an annotated set of classes for XStream : see http://www.nabble.com/Xstream-marshalling---Alias-tp20089956s22882p20130279.html Modified: activemq/camel/trunk/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/XStreamDataFormat.java Modified: activemq/camel/trunk/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/XStreamDataFormat.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/XStreamDataFormat.java?rev=707373&r1=707372&r2=707373&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/XStreamDataFormat.java (original) +++ activemq/camel/trunk/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/XStreamDataFormat.java Thu Oct 23 06:41:00 2008 @@ -46,6 +46,30 @@ private XStream xstream; private StaxConverter staxConverter; + /** + * A factory method which takes a collection of types to be annotated + */ + public static XStreamDataFormat processAnnotations(Iterable> types) { + XStreamDataFormat answer = new XStreamDataFormat(); + XStream xstream = answer.getXStream(); + for (Class type : types) { + xstream.processAnnotations(type); + } + return answer; + } + + /** + * A factory method which takes a number of types to be annotated + */ + public static XStreamDataFormat processAnnotations(Class... types) { + XStreamDataFormat answer = new XStreamDataFormat(); + XStream xstream = answer.getXStream(); + for (Class type : types) { + xstream.processAnnotations(type); + } + return answer; + } + public XStreamDataFormat() { }