public abstract class

ValueSuppressionStrategy

extends Object
java.lang.Object
   ↳ org.apache.commons.betwixt.strategy.ValueSuppressionStrategy

Class Overview

Determines whether the expression of an attribute with a values should be suppressed.

Summary

Fields
public static final ValueSuppressionStrategy ALLOW_ALL_VALUES Strategy allows all values to be expressed for all attributes
public static final ValueSuppressionStrategy DEFAULT Default strategy is SUPPRESS_EMPTY.
public static final ValueSuppressionStrategy SUPPRESS_EMPTY Suppresses all null values.
Public Constructors
ValueSuppressionStrategy()
Public Methods
abstract boolean suppressAttribute(AttributeDescriptor attributeDescriptor, String value)
Should the given attribute value be suppressed?
boolean suppressElement(ElementDescriptor element, String namespaceUri, String localName, String qualifiedName, Object value)

Should be given element value be suppressed?

Note: to preserve binary compatibility, this method contains an implementation that returns false.

[Expand]
Inherited Methods
From class java.lang.Object

Fields

public static final ValueSuppressionStrategy ALLOW_ALL_VALUES

Strategy allows all values to be expressed for all attributes

public static final ValueSuppressionStrategy DEFAULT

Default strategy is SUPPRESS_EMPTY.

public static final ValueSuppressionStrategy SUPPRESS_EMPTY

Suppresses all null values.

Public Constructors

public ValueSuppressionStrategy ()

Public Methods

public abstract boolean suppressAttribute (AttributeDescriptor attributeDescriptor, String value)

Should the given attribute value be suppressed?

Parameters
attributeDescriptor AttributeDescriptor describing the attribute, not null
value Object value, possibly null
Returns
  • true if the attribute should not be written for the given value

public boolean suppressElement (ElementDescriptor element, String namespaceUri, String localName, String qualifiedName, Object value)

Should be given element value be suppressed?

Note: to preserve binary compatibility, this method contains an implementation that returns false. Subclasses should not rely upon this behaviour as (in future) this may be made abstract.

Parameters
element ElementDescriptor describing the element, not null
namespaceUri the namespace of the element to be written
localName the local name of the element to be written
qualifiedName the qualified name of the element to be written
value Object value, possibly null
Returns
  • true if the element should be suppressed (in other words, not written) for the given value