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

Constructor Detail

### JSONDataFilter

    public JSONDataFilter()

Method Detail

### init

    public void init(java.lang.Object init)

### filter

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

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

### 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(org.cometd.Client from,
                                           org.cometd.Channel to,
                                           java.lang.Object array)

### filterMap

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

### filterJSON

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

### filterJSON

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

### filterObject

    protected java.lang.Object filterObject(org.cometd.Client from,
                                            org.cometd.Channel to,
                                            java.lang.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-2010 Mort Bay Consulting. All Rights Reserved.