1 /* 2 * Copyright 2005 Joe Walker 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package org.directwebremoting.convert; 17 18 import org.directwebremoting.dwrp.SimpleOutboundVariable; 19 import org.directwebremoting.extend.Converter; 20 import org.directwebremoting.extend.ConverterManager; 21 import org.directwebremoting.extend.InboundContext; 22 import org.directwebremoting.extend.InboundVariable; 23 import org.directwebremoting.extend.OutboundContext; 24 import org.directwebremoting.extend.OutboundVariable; 25 26 /** 27 * An implementation of Converter for null and undefined. 28 * @author Joe Walker [joe at eireneh dot com] 29 * @version $Id: StringConverter.java,v 1.2 2004/11/04 15:54:07 joe_walker Exp $ 30 */ 31 public class NullConverter implements Converter 32 { 33 /* (non-Javadoc) 34 * @see org.directwebremoting.Converter#setConverterManager(org.directwebremoting.ConverterManager) 35 */ 36 public void setConverterManager(ConverterManager config) 37 { 38 } 39 40 /* (non-Javadoc) 41 * @see org.directwebremoting.Converter#convertInbound(java.lang.Class, org.directwebremoting.InboundVariable, org.directwebremoting.InboundContext) 42 */ 43 public Object convertInbound(Class paramType, InboundVariable data, InboundContext inctx) 44 { 45 return null; 46 } 47 48 /* (non-Javadoc) 49 * @see org.directwebremoting.Converter#convertOutbound(java.lang.Object, org.directwebremoting.OutboundContext) 50 */ 51 public OutboundVariable convertOutbound(Object data, OutboundContext outctx) 52 { 53 return new SimpleOutboundVariable("null", outctx, true); 54 } 55 } 56