org.jboss.dna.common.text
Class NoOpEncoder

java.lang.Object
  extended by org.jboss.dna.common.text.NoOpEncoder
All Implemented Interfaces:
TextEncoder

public class NoOpEncoder
extends java.lang.Object
implements TextEncoder

An encoder implementation that does nothing. This is useful when a encoder is optional but the code is easier to write when there is always an encoder.

Author:
Randall Hauch

Constructor Summary
NoOpEncoder()
           
 
Method Summary
 java.lang.String decode(java.lang.String encodedText)
          Return the decoded version of an encoded string
 java.lang.String encode(java.lang.String text)
          Returns the encoded version of a string.
static NoOpEncoder getInstance()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoOpEncoder

public NoOpEncoder()
Method Detail

getInstance

public static final NoOpEncoder getInstance()

encode

public java.lang.String encode(java.lang.String text)
Returns the encoded version of a string.

Specified by:
encode in interface TextEncoder
Parameters:
text - the text with characters that are to be encoded.
Returns:
the text with the characters encoded as required, or null if the supplied text is null
See Also:
TextEncoder.decode(String)

decode

public java.lang.String decode(java.lang.String encodedText)
Return the decoded version of an encoded string

Specified by:
decode in interface TextEncoder
Parameters:
encodedText - the encoded text
Returns:
the unecoded form of the text, or null if the supplied node name is also null
See Also:
TextEncoder.encode(String)


Copyright © 2008. All Rights Reserved.