001/* ========================================================================
002 * JCommon : a free general purpose class library for the Java(tm) platform
003 * ========================================================================
004 *
005 * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors.
006 * 
007 * Project Info:  http://www.jfree.org/jcommon/index.html
008 *
009 * This library is free software; you can redistribute it and/or modify it 
010 * under the terms of the GNU Lesser General Public License as published by 
011 * the Free Software Foundation; either version 2.1 of the License, or 
012 * (at your option) any later version.
013 *
014 * This library is distributed in the hope that it will be useful, but 
015 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
016 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 
017 * License for more details.
018 *
019 * You should have received a copy of the GNU Lesser General Public
020 * License along with this library; if not, write to the Free Software
021 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
022 * USA.  
023 *
024 * [Java is a trademark or registered trademark of Sun Microsystems, Inc. 
025 * in the United States and other countries.]
026 * 
027 * ----------------------
028 * ManualMappingInfo.java
029 * ----------------------
030 * (C)opyright 2003, 2004, by Thomas Morgner and Contributors.
031 *
032 * Original Author:  Thomas Morgner;
033 * Contributor(s):   David Gilbert (for Object Refinery Limited);
034 *
035 * $Id: ManualMappingInfo.java,v 1.2 2005/10/18 13:32:37 mungady Exp $
036 *
037 * Changes 
038 * -------------------------
039 * 12.11.2003 : Initial version
040 *  
041 */
042
043package org.jfree.xml.generator.model;
044
045/**
046 * The manual mapping describes, how a certain class is handled in the parser.
047 * This defines the read and write handler implementations to be used to handle
048 * the instantiation or serialisation of the described type.
049 * <p>
050 * Manual mappings will not be created by the generator, they have to be defined
051 * manually. The parser will print warnings, if the definitions are invalid.
052 * <p>
053 * Manual mappings will always override automatic mappings. 
054 */
055public class ManualMappingInfo {
056    
057    /** The base class. */
058    private Class baseClass;
059    
060    /** The read handler. */
061    private Class readHandler;
062    
063    /** The write handler. */
064    private Class writeHandler;
065    
066    /** The comments. */
067    private Comments comments;
068    
069    /** The source. */
070    private String source;
071
072    /**
073     * Creates a new manual mapping instance.
074     * 
075     * @param baseClass  the base class.
076     * @param readHandler  the read handler class.
077     * @param writeHandler  the write handler class.
078     */
079    public ManualMappingInfo(final Class baseClass, final Class readHandler, final Class writeHandler) {
080        this.baseClass = baseClass;
081        this.readHandler = readHandler;
082        this.writeHandler = writeHandler;
083    }
084
085    /**
086     * Returns the base class.
087     * 
088     * @return The base class.
089     */
090    public Class getBaseClass() {
091        return this.baseClass;
092    }
093
094    /**
095     * Returns the read handler class.
096     * 
097     * @return The read handler class.
098     */
099    public Class getReadHandler() {
100        return this.readHandler;
101    }
102
103    /**
104     * Returns the write handler class.
105     * 
106     * @return The write handler class.
107     */
108    public Class getWriteHandler() {
109        return this.writeHandler;
110    }
111
112    /**
113     * Returns the comments.
114     * 
115     * @return The comments.
116     */
117    public Comments getComments() {
118        return this.comments;
119    }
120
121    /**
122     * Sets the comments.
123     * 
124     * @param comments  the comments.
125     */
126    public void setComments(final Comments comments) {
127        this.comments = comments;
128    }
129
130    /**
131     * Returns the source.
132     * 
133     * @return The source.
134     */
135    public String getSource() {
136        return this.source;
137    }
138
139    /**
140     * Sets the source.
141     * 
142     * @param source  the source.
143     */
144    public void setSource(final String source) {
145        this.source = source;
146    }
147}