convert empty string to null w3c document

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

convert empty string to null w3c document

anoordover
Is it possible to convert an empty string to a null w3c document  using for example cbr?
Reply | Threaded
Open this post in threaded view
|

Re: convert empty string to null w3c document

arno noordover
I found a solution for my problem where I want to return a null object based on the input.
I've done it using a combination of content based routing and a transform using the simple language.
In the "simple" language I refer to a generic NullObjectFactory bean that has a method the creates a null-object.
The code of my NullObjectFactory is:
package .......;

public class NullObjectFactory<T> {

    public NullObjectFactory(T t) {
    }

    public T createNullObject() {
        return null;
    }
}