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

juzu.impl.request.EntityUnmarshaller Maven / Gradle / Ivy

/*
 * Copyright 2013 eXo Platform SAS
 *
 * 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 juzu.impl.request;

import juzu.request.ClientContext;
import juzu.request.RequestParameter;

import java.io.IOException;
import java.util.Map;

/**
 * The entity unmarshaller is used by Juzu for translating an HTTP entity into a request control arguments.
 *
 * @author Julien Viet
 */
// tag::class[]
public abstract class EntityUnmarshaller {

  /**
   * Decide wether or not this reader accept to read the specified mediaType argument.
   *
   * @param mediaType the media type to test
   * @return true if the media type is accepted
   */
  public abstract boolean accept(String mediaType);

  /**
   * Unmarshall the entity from the {@link juzu.request.ClientContext}. This unmarshaller can modify the
   * request control arguments:
   * 
    *
  • the contextual arguments can be iterated and the value updated
  • *
  • the parameter arguments map can be freely modified
  • *
* * @param mediaType the request media type * @param context the client context for reading the entity * @param contextualArguments the contextual arguments * @param parameterArguments the contextual parameters * @throws IOException anything preventing the read operation to succeed */ public abstract void unmarshall( String mediaType, ClientContext context, Iterable> contextualArguments, Map parameterArguments) throws IOException; } // end::class[]




© 2015 - 2024 Weber Informatics LLC | Privacy Policy