org.mortbay.cometd.filter
Class JSONDataFilter
java.lang.Object
org.mortbay.cometd.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, Client)
or
filterMap(Map, Client)
appropriate.
Derived filters may override one or more of these methods to provide filtering of specific types.
- Author:
- gregw
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)
- Specified by:
init
in interface DataFilter
filter
public Object filter(Object data,
Client from)
throws IllegalStateException
- Specified by:
filter
in interface DataFilter
- Returns:
- The filtered data.
- Throws:
IllegalStateException
- 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(Object array,
Client from)
filterMap
protected Object filterMap(Map object,
Client from)
Copyright © 2007 Mort Bay Consulting. All Rights Reserved.