commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vikram Goyal" <t...@craftbits.com>
Subject Re: [Betwixt] Excluding a bean from parsing into XML
Date Mon, 02 May 2005 12:00:47 GMT
Hi Weez,

The easiest way to do this is to include a .betwixt file in your CLASSPATH. 
The details of this file are specified on the Betwixt website. Effectively, 
you need to include a hide element in this file that points to the 
element(s) that you don't want printed.

-- example.betwixt --
<?xml version='1.0' encoding='UTF-8' ?>
<info primitiveTypes="attribute">
  <hide property="customers">      <-- This suppresses the output of 
customers
  <element name='customerbean'>
    <addDefaults/>
  </element>
</info>

HTH,
Vikram
---------------------------------------------------------------------------------------
Jakarta Commons Online Bookshelf
Module 5: JXPath and Betwixt: 
http://www.manning.com/catalog/view.php?book=goyal5
All Modules: http://www.manning.com/goyal
---------------------------------------------------------------------------------------

----- Original Message ----- 
From: "WeeZard" <weezard@email.si>
To: <commons-user@jakarta.apache.org>
Sent: Monday, May 02, 2005 9:44 PM
Subject: [Betwixt] Excluding a bean from parsing into XML


Hello,

I'm new to Betwixt, and even more new to Java so this may be a newbie 
question ;-)

For example, I got a class, something like this:

public class CustomerBean {
    private String name;
    private CustomerBean customers;

    public String getName();
    public CustomerBean getCustomers();

}

When I call SAXBeanWriter.write(...), I would like to tell Betwixt NOT to 
include "customers" in the output XML document. How do I do that?


tnx a lot for any tips on this subject

Weez 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message