## 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, ClientImpl)` or `#filterMap(Map, ClientImpl)` appropriate. Derived filters may override one or more of these methods to provide filtering of specific types.

Author:
  gregw

Constructor Summary
`JSONDataFilter()`

Method Summary
`Object` `filter(Client from, Channel to, Object data)`
`protected Object` `filterArray(Client from, Channel to, Object array)`
`protected Object` `filterBoolean(Boolean bool)`
`protected Object` `filterJSON(Client from, Channel to, JSON.Generator json)`
`protected Object` `filterJSON(Client from, Channel to, JSON.Literal json)`
`protected Object` `filterMap(Client from, Channel to, Map object)`
`protected Object` `filterNumber(Number number)`
`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`

Constructor Detail

### JSONDataFilter

    public JSONDataFilter()

Method Detail

### init

    public void init(Object init)

### filter

    public Object filter(Client from,
                         Channel to,
                         Object data)
                  throws IllegalStateException

  Specified by:
    `filter` in interface `DataFilter`
    `to` - TODO
  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(Client from,
                                 Channel to,
                                 Object array)

### filterMap

    protected Object filterMap(Client from,
                               Channel to,
                               Map object)

### filterJSON

    protected Object filterJSON(Client from,
                                Channel to,
                                JSON.Generator json)

### filterJSON

    protected Object filterJSON(Client from,
                                Channel to,
                                JSON.Literal json)

Copyright © 2007 Mort Bay Consulting. All Rights Reserved.