Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mortbay.cometd.filter
Class JSONDataFilter

    java.lang.Object
      org.mortbay.cometd.filter.JSONDataFilter

All Implemented Interfaces:
  org.cometd.DataFilter

Direct Known Subclasses:
  NoMarkupFilter, NoScriptsFilter, RegexFilter

    public class JSONDataFilter

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

Constructor Detail

### JSONDataFilter

    public JSONDataFilter()

Method Detail

### init

    public void init(Object init)

### filter

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

  Specified by:
    `filter` in interface `org.cometd.DataFilter`
  Throws:
    `IllegalStateException`

### filterString

    protected Object filterString(String string)

### filterBoolean

    protected Object filterBoolean(Boolean bool)

### filterNumber

    protected Object filterNumber(Number number)

### filterArray

    protected Object filterArray(org.cometd.Client from,
                                 org.cometd.Channel to,
                                 Object array)

### filterMap

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

### filterJSON

    protected Object filterJSON(org.cometd.Client from,
                                org.cometd.Channel to,
                                JSON.Generator generator)

### filterJSON

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

### filterObject

    protected Object filterObject(org.cometd.Client from,
                                  org.cometd.Channel to,
                                  Object obj)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1995-2008 Mort Bay Consulting. All Rights Reserved.