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:
043: package 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: */
055: public 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,
080: final Class readHandler, final Class writeHandler) {
081: this .baseClass = baseClass;
082: this .readHandler = readHandler;
083: this .writeHandler = writeHandler;
084: }
085:
086: /**
087: * Returns the base class.
088: *
089: * @return The base class.
090: */
091: public Class getBaseClass() {
092: return this .baseClass;
093: }
094:
095: /**
096: * Returns the read handler class.
097: *
098: * @return The read handler class.
099: */
100: public Class getReadHandler() {
101: return this .readHandler;
102: }
103:
104: /**
105: * Returns the write handler class.
106: *
107: * @return The write handler class.
108: */
109: public Class getWriteHandler() {
110: return this .writeHandler;
111: }
112:
113: /**
114: * Returns the comments.
115: *
116: * @return The comments.
117: */
118: public Comments getComments() {
119: return this .comments;
120: }
121:
122: /**
123: * Sets the comments.
124: *
125: * @param comments the comments.
126: */
127: public void setComments(final Comments comments) {
128: this .comments = comments;
129: }
130:
131: /**
132: * Returns the source.
133: *
134: * @return The source.
135: */
136: public String getSource() {
137: return this .source;
138: }
139:
140: /**
141: * Sets the source.
142: *
143: * @param source the source.
144: */
145: public void setSource(final String source) {
146: this.source = source;
147: }
148: }
|