/**
 * Copyright 2013 DuraSpace, Inc.
 *
 * 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.fcrepo.serialization;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import javax.jcr.RepositoryException;
import javax.jcr.Session;

import org.fcrepo.FedoraObject;
import org.fcrepo.exception.InvalidChecksumException;
import org.springframework.stereotype.Component;

@Component
public interface FedoraObjectSerializer {

    String getKey();

    String getMediaType();

    void serialize(final FedoraObject obj, final OutputStream out)
        throws RepositoryException, IOException;

    void deserialize(final Session session, final String path,
            final InputStream stream) throws IOException, RepositoryException,
        InvalidChecksumException;

}

@@ -978,170 +978,1004 @@
     
-String getKey();%0A%0A    String getMediaType();%0A%0A    void serialize(final FedoraObject obj, final OutputStream out)%0A        throws RepositoryException, IOException;%0A
+/**%0A     * Get the key for the serializer (that will be%0A     * used at the REST API to identify the format)%0A     * @return%0A     */%0A    String getKey();%0A%0A    /**%0A     * Get the media type for the serialized output%0A     * (so we can send the right mime type as appropriate)%0A     * @return%0A     */%0A    String getMediaType();%0A%0A    /**%0A     * Serialize a FedoraObject into some format, and write it%0A     * to the given OutputStream%0A     *%0A     * @param obj%0A     * @param out%0A     * @throws RepositoryException%0A     * @throws IOException%0A     */%0A    void serialize(final FedoraObject obj, final OutputStream out)%0A        throws RepositoryException, IOException;%0A%0A    /**%0A     * Read the given InputStream and de-serialize the content%0A     * into new nodes in the given session using the given path%0A     * as the parent node%0A     *%0A     * @param session%0A     * @param path%0A     * @param stream%0A     * @throws IOException%0A     * @throws RepositoryException%0A     * @throws InvalidChecksumException%0A     */
 %0A   

add javadocs to the FedoraObjectSerializer