javax.net.websocket.annotations.WebSocketPathParam Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javax.net.websocket-api Show documentation
Show all versions of javax.net.websocket-api Show documentation
JSR 356:Java API for WebSocket
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package javax.net.websocket.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* This annotation may be used to annotate method parameters on web socket POJOs
* where a URI-template has been used in the path-mapping of the WebSocketEndpoint
* annotation.
For example:-
* * For example:
*
*  @WebSocketEndpoint("/bookings/{guest-id}");
* public class BookingServer {
*
*   @WebSocketMessage
*  public void processBookingRequest(@WebSocketPathParam("guest-id") String guestID, String message, Session session) {
*    // process booking from the given guest here
*  }
* }
*
*
* @author dannycoward
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
public @interface WebSocketPathParam {
/** The name of the variable used in the URI-template. If the name does
not match a path variable in the URI-template, the value of the method parameter
this annotation annotates is null.
@return the value */
public String value();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy