org.apache.torque.betwixt.util
Class SuppressPrimaryKeys

java.lang.Object
  extended by org.apache.commons.betwixt.strategy.ValueSuppressionStrategy
      extended by org.apache.torque.betwixt.util.SuppressPrimaryKeys

public class SuppressPrimaryKeys
extends org.apache.commons.betwixt.strategy.ValueSuppressionStrategy

A Betwixt BeanWriter ValueSuppressionStategy that will filter out all primary key columns when the XML is written. This can be useful if your primary keys are autogenerated ids and you want to create new primary ids on import. It can also make for more "user readable" exports in some cases. (Plus it's a good example of using this Betwixt filter).

To use it, you need to add it to the BeanWriter's bindingConfiguration before writing the XML out. E.g.:

beanWriter.getBindingConfiguration().setValueSuppressionStrategy( new SuppressPrimaryKeys() );

Author:
Greg Monroe

Field Summary
 
Fields inherited from class org.apache.commons.betwixt.strategy.ValueSuppressionStrategy
ALLOW_ALL_VALUES, DEFAULT, SUPPRESS_EMPTY
 
Constructor Summary
SuppressPrimaryKeys()
           
 
Method Summary
 boolean suppressAttribute(org.apache.commons.betwixt.AttributeDescriptor attributeDescriptor, java.lang.String value)
          Do nothing but call DEFAULT implimentation because superclass defines this as abstract.
 boolean suppressElement(org.apache.commons.betwixt.ElementDescriptor element, java.lang.String namespaceUri, java.lang.String localName, java.lang.String qualifiedName, java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SuppressPrimaryKeys

public SuppressPrimaryKeys()
Method Detail

suppressAttribute

public boolean suppressAttribute(org.apache.commons.betwixt.AttributeDescriptor attributeDescriptor,
                                 java.lang.String value)
Do nothing but call DEFAULT implimentation because superclass defines this as abstract.

Specified by:
suppressAttribute in class org.apache.commons.betwixt.strategy.ValueSuppressionStrategy

suppressElement

public boolean suppressElement(org.apache.commons.betwixt.ElementDescriptor element,
                               java.lang.String namespaceUri,
                               java.lang.String localName,
                               java.lang.String qualifiedName,
                               java.lang.Object value)
Overrides:
suppressElement in class org.apache.commons.betwixt.strategy.ValueSuppressionStrategy


Copyright © 2006 Torque Add-ons Project. All Rights Reserved.