org.cometd.server.filter
Class JSONDataFilter
java.lang.Object
org.cometd.server.filter.JSONDataFilter
- All Implemented Interfaces:
- DataFilter
- Direct Known Subclasses:
- NoMarkupFilter, NoScriptsFilter, RegexFilter
public class JSONDataFilter
- extends Object
- implements DataFilter
JSONDataFilter walks an object to see if it is a JSON data structure
and calls the appropriate protected method filterString(String),
filterNumber(Number), filterBoolean(Boolean),
filterArray(ServerSession, ServerChannel, Object) or
filterMap(ServerSession, ServerChannel, Map).
Derived filters may override one or more of these methods to provide
filtering of specific types.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JSONDataFilter
public JSONDataFilter()
init
public void init(Object init)
filter
public Object filter(ServerSession from,
ServerChannel to,
Object data)
- Specified by:
filter in interface DataFilter
- Parameters:
from - the Client that sends the datato - the channel the data is being sent todata - the data being sent
- Returns:
- the transformed data or null if the message should be aborted
filterString
protected Object filterString(String string)
filterBoolean
protected Object filterBoolean(Boolean bool)
filterNumber
protected Object filterNumber(Number number)
filterArray
protected Object filterArray(ServerSession from,
ServerChannel to,
Object array)
filterMap
protected Object filterMap(ServerSession from,
ServerChannel to,
Map map)
filterObject
protected Object filterObject(ServerSession from,
ServerChannel to,
Object obj)
Copyright © 2008-2012 Dojo Foundation. All Rights Reserved.