org.springframework.rules.closure
Class StringTrimmer
java.lang.Object
org.springframework.core.closure.support.AlgorithmsAccessor
org.springframework.core.closure.support.AbstractClosure
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
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.AlgorithmsAccessor |
allTrue, allTrue, anyTrue, anyTrue, findAll, findAll, findFirst, findFirst, forEach, forEach, getAlgorithms |
StringTrimmer
public StringTrimmer()
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.