All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mikerusoft.jsonable.transform.NullTransformer Maven / Gradle / Ivy

package com.mikerusoft.jsonable.transform;

import com.mikerusoft.jsonable.utils.Outputter;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;

/**
 * Transforms Null
 * @author Grinfeld Mikhail
 * @since 5/25/2014.
 */
public class NullTransformer extends TransformerImpl {

    private Log log = LogFactory.getLog(NullTransformer.class);

    @Override
    public boolean match(Object o) {
        return o == null;
    }

    @Override
    public boolean matchClass(Class clazz) {
        return false;
    }

    @Override
    public void transform(Object o, Outputter out, String... groups) throws IOException, InvocationTargetException, IllegalAccessException {
        out.write("null");
    }

    @Override public int matchPriority() { return Transformer.LOW_PRIORITY; }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy