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
JSON DataFilter This DataFilter walks an Object as if it was a call
to JSON.toString(Object) and calls the protected methods
filterString(String), filterNumber(Number),
filterBoolean(Boolean), #filterArray(Object, ClientImpl) or
#filterMap(Map, ClientImpl) appropriate. Derived filters may override
one or more of these methods to provide filtering of specific types.
|
Method Summary |
Object |
filter(ServerSession from,
ServerChannel to,
Object data)
|
protected Object |
filterArray(ServerSession from,
ServerChannel to,
Object array)
|
protected Object |
filterBoolean(Boolean bool)
|
protected Object |
filterJSON(ServerSession from,
ServerChannel to,
org.eclipse.jetty.util.ajax.JSON.Generator generator)
|
protected Object |
filterJSON(ServerSession from,
ServerChannel to,
org.eclipse.jetty.util.ajax.JSON.Literal json)
|
protected Object |
filterMap(ServerSession from,
ServerChannel to,
Map map)
|
protected Object |
filterNumber(Number number)
|
protected Object |
filterObject(ServerSession from,
ServerChannel to,
Object obj)
|
protected Object |
filterString(String string)
|
void |
init(Object init)
|
| 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)
filterJSON
protected Object filterJSON(ServerSession from,
ServerChannel to,
org.eclipse.jetty.util.ajax.JSON.Generator generator)
filterJSON
protected Object filterJSON(ServerSession from,
ServerChannel to,
org.eclipse.jetty.util.ajax.JSON.Literal json)
filterObject
protected Object filterObject(ServerSession from,
ServerChannel to,
Object obj)
Copyright © 2008-2011 Dojo Foundation. All Rights Reserved.