public class

BadCharacterReplacingNMapper

extends Object
implements NameMapper
java.lang.Object
   ↳ org.apache.commons.betwixt.strategy.BadCharacterReplacingNMapper

Class Overview

NameMapper implementation that processes a name by replacing or stripping illegal characters before passing result down the chain.

Summary

Public Constructors
BadCharacterReplacingNMapper(NameMapper chainedMapper)
Constructs a replacing mapper which delegates to given mapper.
Public Methods
Character getReplacement()
Gets the character that should be used to replace bad characters if null then bad characters will be deleted.
String mapTypeToElementName(String typeName)
This implementation processes characters which are not allowed in xml element names and then returns the result from the next link in the chain.
void setReplacement(Character replacement)
Sets the character that should be used to replace bad characters.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.commons.betwixt.strategy.NameMapper

Public Constructors

public BadCharacterReplacingNMapper (NameMapper chainedMapper)

Constructs a replacing mapper which delegates to given mapper.

Parameters
chainedMapper next link in processing chain, possibly null

Public Methods

public Character getReplacement ()

Gets the character that should be used to replace bad characters if null then bad characters will be deleted.

Returns
  • the replacement Character possibly null

public String mapTypeToElementName (String typeName)

This implementation processes characters which are not allowed in xml element names and then returns the result from the next link in the chain. This processing consists of deleting them if no replacement character has been set. Otherwise, the character will be replaced.

Parameters
typeName the string to convert
Returns
  • the processed input

public void setReplacement (Character replacement)

Sets the character that should be used to replace bad characters.

Parameters
replacement the Charcter to be used for replacement if not null. Otherwise, indicates that illegal characters should be deleted.