All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.primefaces.push.Decoder Maven / Gradle / Ivy

There is a newer version: 14.0.0-RC3
Show newest version
/*
 * Copyright 2009-2014 PrimeTek.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.primefaces.push;

/**
 * Decode a message in order to invoke a class annotated with {@link org.primefaces.push.annotation.PushEndpoint} with a method
 * annotated with {@link org.primefaces.push.annotation.OnMessage}. For example:
 * 

     public final class StringBufferDecoder implements Decoder {

         @Override
         public StringBuffer decode(String s) {
             return  new StringBuffer(s);
         }
     }
 * 
* will decode a String into a StringBuffer. The decoded object will then be used to invoke a method annotated with @Message *

     @Message(decoders = {StringBufferDecoder.class})
     public void message(StringBuffer m) {
         message.set(m.toString());
     }
 * 
* You can chain Decoders. They will be invoked in the order they are defined and the last decoded value will be used to invoke the * @Message annotated method. * @param * @param */ public interface Decoder extends org.atmosphere.config.managed.Decoder{ // Atmosphere Proxy /** * Decode the specified object of type U into object of type T * * @param s a object of type U * @return a new object of type T */ //@Override T decode(U s); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy