org.springframework.rules.closure
Class StringTrimmer

java.lang.Object
  extended by org.springframework.core.closure.support.AlgorithmsAccessor
      extended by org.springframework.core.closure.support.AbstractClosure
          extended by org.springframework.rules.closure.StringTrimmer
All Implemented Interfaces:
Serializable, Closure

public class StringTrimmer
extends AbstractClosure

Returns a trimmed copy of the string form of an object.

Author:
Keith Donald
See Also:
Serialized Form

Constructor Summary
StringTrimmer()
           
 
Method Summary
 Object call(Object argument)
          Evaluate the string form of the object, returning a trimmed (no leading/trailing whitespace) copy of the string.
static Closure instance()
          Returns the shared StringTrimmer instance--this is possible as the default instance is immutable and stateless.
 String toString()
           
 
Methods inherited from class org.springframework.core.closure.support.AbstractClosure
forEach, forEach
 
Methods inherited from class org.springframework.core.closure.support.AlgorithmsAccessor
allTrue, allTrue, anyTrue, anyTrue, findAll, findAll, findFirst, findFirst, forEach, forEach, getAlgorithms
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringTrimmer

public StringTrimmer()
Method Detail

instance

public static Closure instance()
Returns the shared StringTrimmer instance--this is possible as the default instance is immutable and stateless.

Returns:
the shared instance

call

public Object call(Object argument)
Evaluate the string form of the object, returning a trimmed (no leading/trailing whitespace) copy of the string.

Parameters:
argument - the argument
Returns:
The trimmed string
See Also:
Closure.call(java.lang.Object)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.