001    // SECTION-START[License Header]
002    // <editor-fold defaultstate="collapsed" desc=" Generated License ">
003    /*
004     *   Copyright (c) 2010 The JOMC Project
005     *   Copyright (c) 2005 Christian Schulte <schulte2005@users.sourceforge.net>
006     *   All rights reserved.
007     *
008     *   Redistribution and use in source and binary forms, with or without
009     *   modification, are permitted provided that the following conditions
010     *   are met:
011     *
012     *     o Redistributions of source code must retain the above copyright
013     *       notice, this list of conditions and the following disclaimer.
014     *
015     *     o Redistributions in binary form must reproduce the above copyright
016     *       notice, this list of conditions and the following disclaimer in
017     *       the documentation and/or other materials provided with the
018     *       distribution.
019     *
020     *   THIS SOFTWARE IS PROVIDED BY THE JOMC PROJECT AND CONTRIBUTORS "AS IS"
021     *   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
022     *   THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
023     *   PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE JOMC PROJECT OR
024     *   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
025     *   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
026     *   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
027     *   OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
028     *   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
029     *   OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
030     *   ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
031     *
032     *   $Id: SequenceMapper.java 2247 2010-06-29 08:01:42Z schulte2005 $
033     *
034     */
035    // </editor-fold>
036    // SECTION-END
037    package org.jomc.sequences.ri;
038    
039    import org.jomc.sequences.Sequence;
040    import org.jomc.sequences.SequencesSystemException;
041    import org.jomc.sequences.model.SequenceType;
042    
043    // SECTION-START[Documentation]
044    // <editor-fold defaultstate="collapsed" desc=" Generated Documentation ">
045    /**
046     * Maps model classes.
047     *
048     * <p>
049     *   This specification declares a multiplicity of {@code Many}.
050     *   An application assembler may provide multiple implementations of this specification (including none).
051     * </p>
052     *
053     * <p>
054     *   Use of class {@link org.jomc.ObjectManager ObjectManager} is supported for accessing implementations.
055     *   <pre>
056     * SequenceMapper[] objects = ObjectManagerFactory.getObjectManager( getClass().getClassLoader() ).getObject( SequenceMapper[].class );
057     * SequenceMapper object = ObjectManagerFactory.getObjectManager( getClass().getClassLoader() ).getObject( SequenceMapper.class, "<i>implementation name</i>" );
058     *   </pre>
059     * </p>
060     *
061     * <p>
062     *   This specification does not apply to any scope. A new object is returned whenever requested.
063     * </p>
064     *
065     * @author <a href="mailto:schulte2005@users.sourceforge.net">Christian Schulte</a> 1.0
066     * @version $Id: SequenceMapper.java 2247 2010-06-29 08:01:42Z schulte2005 $
067     */
068    // </editor-fold>
069    // SECTION-END
070    // SECTION-START[Annotations]
071    // <editor-fold defaultstate="collapsed" desc=" Generated Annotations ">
072    @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.0", comments = "See http://jomc.sourceforge.net/jomc/1.0/jomc-tools" )
073    // </editor-fold>
074    // SECTION-END
075    public interface SequenceMapper
076    {
077        // SECTION-START[SequenceMapper]
078    
079        /**
080         * Maps a {@code SequenceType} instance to a {@code Sequence} instance.
081         *
082         * @param sequenceType The instance to map.
083         * @param sequence The target instance to map {@code sequenceType} to.
084         *
085         * @return {@code sequenceType} mapped to {@code sequence}.
086         *
087         * @throws SequencesSystemException if mapping fails unexpectedly.
088         */
089        Sequence map( SequenceType sequenceType, Sequence sequence ) throws SequencesSystemException;
090    
091        /**
092         * Maps a {@code Sequence} instance to a {@code SequenceType} instance.
093         *
094         * @param sequence The instance to map.
095         * @param sequenceType The target instance to map {@code sequence} to.
096         *
097         * @return {@code sequence} mapped to {@code sequenceType}.
098         *
099         * @throws SequencesSystemException if mapping fails unexpectedly.
100         */
101        SequenceType map( Sequence sequence, SequenceType sequenceType ) throws SequencesSystemException;
102    
103        // SECTION-END
104    }