View Javadoc
1   /*
2    * Copyright 2002-2013 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.springframework.web.socket.sockjs.frame;
18  
19  /**
20   * Applies a transport-specific format to the content of a SockJS frame resulting
21   * in a content that can be written out. Primarily for use in HTTP server-side
22   * transports that push data.
23   *
24   * <p>Formatting may vary from simply appending a new line character for XHR
25   * polling and streaming transports, to a jsonp-style callback function,
26   * surrounding script tags, and more.
27   *
28   * <p>For the various SockJS frame formats in use, see implementations of
29   * {@link  org.springframework.web.socket.sockjs.transport.handler.AbstractHttpSendingTransportHandler#getFrameFormat(org.springframework.http.server.ServerHttpRequest) AbstractHttpSendingTransportHandler.getFrameFormat}
30   *
31   * @author Rossen Stoyanchev
32   * @since 4.0
33   */
34  public interface SockJsFrameFormat {
35  
36  	String format(SockJsFrame frame);
37  
38  }