/* * Copyright 2014 Jeanfrancois Arcand * * 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.atmosphere.stomp.protocol; /** * <p> * This interfaces defines methods that allows to convert a {@code String} object into a {@link Frame} object and vice-versa. * </p> * * @author Guillaume DROUET * @since 0.1 * @version 1.0 */ public interface StompFormat { /** * <p> * Takes the given {@code String} and converts it to a {@link Frame}. * </p> * * @param str the {@code String} representation * @return the frame * @throws ParseException if {@code String} is not correct */ Frame parse(String str) throws ParseException; /** * <p> * Takes the given {@link Frame} and converts it to a {@code String} representation. * </p> * * @param msg the frame * @return the {@code String} representation */ String format(Frame msg); }