Source for org.jfree.xml.generator.model.ManualMappingInfo

   1: /* ========================================================================
   2:  * JCommon : a free general purpose class library for the Java(tm) platform
   3:  * ========================================================================
   4:  *
   5:  * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors.
   6:  * 
   7:  * Project Info:  http://www.jfree.org/jcommon/index.html
   8:  *
   9:  * This library is free software; you can redistribute it and/or modify it 
  10:  * under the terms of the GNU Lesser General Public License as published by 
  11:  * the Free Software Foundation; either version 2.1 of the License, or 
  12:  * (at your option) any later version.
  13:  *
  14:  * This library is distributed in the hope that it will be useful, but 
  15:  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
  16:  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 
  17:  * License for more details.
  18:  *
  19:  * You should have received a copy of the GNU Lesser General Public
  20:  * License along with this library; if not, write to the Free Software
  21:  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
  22:  * USA.  
  23:  *
  24:  * [Java is a trademark or registered trademark of Sun Microsystems, Inc. 
  25:  * in the United States and other countries.]
  26:  * 
  27:  * ----------------------
  28:  * ManualMappingInfo.java
  29:  * ----------------------
  30:  * (C)opyright 2003, 2004, by Thomas Morgner and Contributors.
  31:  *
  32:  * Original Author:  Thomas Morgner;
  33:  * Contributor(s):   David Gilbert (for Object Refinery Limited);
  34:  *
  35:  * $Id: ManualMappingInfo.java,v 1.2 2005/10/18 13:32:37 mungady Exp $
  36:  *
  37:  * Changes 
  38:  * -------------------------
  39:  * 12.11.2003 : Initial version
  40:  *  
  41:  */
  42: 
  43: package org.jfree.xml.generator.model;
  44: 
  45: /**
  46:  * The manual mapping describes, how a certain class is handled in the parser.
  47:  * This defines the read and write handler implementations to be used to handle
  48:  * the instantiation or serialisation of the described type.
  49:  * <p>
  50:  * Manual mappings will not be created by the generator, they have to be defined
  51:  * manually. The parser will print warnings, if the definitions are invalid.
  52:  * <p>
  53:  * Manual mappings will always override automatic mappings. 
  54:  */
  55: public class ManualMappingInfo {
  56:     
  57:     /** The base class. */
  58:     private Class baseClass;
  59:     
  60:     /** The read handler. */
  61:     private Class readHandler;
  62:     
  63:     /** The write handler. */
  64:     private Class writeHandler;
  65:     
  66:     /** The comments. */
  67:     private Comments comments;
  68:     
  69:     /** The source. */
  70:     private String source;
  71: 
  72:     /**
  73:      * Creates a new manual mapping instance.
  74:      * 
  75:      * @param baseClass  the base class.
  76:      * @param readHandler  the read handler class.
  77:      * @param writeHandler  the write handler class.
  78:      */
  79:     public ManualMappingInfo(final Class baseClass, final Class readHandler, final Class writeHandler) {
  80:         this.baseClass = baseClass;
  81:         this.readHandler = readHandler;
  82:         this.writeHandler = writeHandler;
  83:     }
  84: 
  85:     /**
  86:      * Returns the base class.
  87:      * 
  88:      * @return The base class.
  89:      */
  90:     public Class getBaseClass() {
  91:         return this.baseClass;
  92:     }
  93: 
  94:     /**
  95:      * Returns the read handler class.
  96:      * 
  97:      * @return The read handler class.
  98:      */
  99:     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: }