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 java.lang.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.
- Author:
- gregw
|
Method Summary |
java.lang.Object |
filter(ServerSession from,
ServerChannel to,
java.lang.Object data)
|
protected java.lang.Object |
filterArray(ServerSession from,
ServerChannel to,
java.lang.Object array)
|
protected java.lang.Object |
filterBoolean(java.lang.Boolean bool)
|
protected java.lang.Object |
filterJSON(ServerSession from,
ServerChannel to,
org.eclipse.jetty.util.ajax.JSON.Generator generator)
|
protected java.lang.Object |
filterJSON(ServerSession from,
ServerChannel to,
org.eclipse.jetty.util.ajax.JSON.Literal json)
|
protected java.lang.Object |
filterMap(ServerSession from,
ServerChannel to,
java.util.Map object)
|
protected java.lang.Object |
filterNumber(java.lang.Number number)
|
protected java.lang.Object |
filterObject(ServerSession from,
ServerChannel to,
java.lang.Object obj)
|
protected java.lang.Object |
filterString(java.lang.String string)
|
void |
init(java.lang.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(java.lang.Object init)
filter
public java.lang.Object filter(ServerSession from,
ServerChannel to,
java.lang.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 java.lang.Object filterString(java.lang.String string)
filterBoolean
protected java.lang.Object filterBoolean(java.lang.Boolean bool)
filterNumber
protected java.lang.Object filterNumber(java.lang.Number number)
filterArray
protected java.lang.Object filterArray(ServerSession from,
ServerChannel to,
java.lang.Object array)
filterMap
protected java.lang.Object filterMap(ServerSession from,
ServerChannel to,
java.util.Map object)
filterJSON
protected java.lang.Object filterJSON(ServerSession from,
ServerChannel to,
org.eclipse.jetty.util.ajax.JSON.Generator generator)
filterJSON
protected java.lang.Object filterJSON(ServerSession from,
ServerChannel to,
org.eclipse.jetty.util.ajax.JSON.Literal json)
filterObject
protected java.lang.Object filterObject(ServerSession from,
ServerChannel to,
java.lang.Object obj)
Copyright © 2008-2010 Dojo Foundation. All Rights Reserved.