Class JSONDataFilter

    • Constructor Detail

      • JSONDataFilter

        public JSONDataFilter()
    • Method Detail

      • init

        public void init​(java.lang.Object init)
      • filter

        public java.lang.Object filter​(ServerSession session,
                                       ServerChannel channel,
                                       java.lang.Object data)
        Description copied from interface: DataFilter

        Modifies the given message data.

        Returning null or throwing DataFilter.AbortException results in the message processing being interrupted and the message itself discarded.

        If the returned object is different (as returned by the != operator) from the data parameter then it is set as the new message data via Message.Mutable.setData(Object).

        Specified by:
        filter in interface DataFilter
        session - the ServerSession that sends the data
        channel - the channel the data is being sent on
        data - the data being sent
        the transformed data or null if the message should be ignored
      • filterString

        protected java.lang.Object filterString​(ServerSession session,
                                                ServerChannel channel,
                                                java.lang.String string)
      • filterBoolean

        protected java.lang.Object filterBoolean​(ServerSession session,
                                                 ServerChannel channel,
                                                 java.lang.Boolean bool)
      • filterNumber

        protected java.lang.Object filterNumber​(ServerSession session,
                                                ServerChannel channel,
                                                java.lang.Number number)
      • filterArray

        protected java.lang.Object filterArray​(ServerSession session,
                                               ServerChannel channel,
                                               java.lang.Object array)
      • filterList

        protected java.lang.Object filterList​(ServerSession session,
                                              ServerChannel channel,
                                              java.util.List<java.lang.Object> list)
      • filterCollection

        protected java.lang.Object filterCollection​(ServerSession session,
                                                    ServerChannel channel,
                                                    java.util.Collection<java.lang.Object> collection)
      • filterMap

        protected java.lang.Object filterMap​(ServerSession session,
                                             ServerChannel channel,
                                             java.util.Map<java.lang.String,​java.lang.Object> map)
      • filterObject

        protected java.lang.Object filterObject​(ServerSession session,
                                                ServerChannel channel,
                                                java.lang.Object data)