001 /*
002 * jDTAUS Core API
003 * Copyright (c) 2005 Christian Schulte
004 *
005 * Christian Schulte, Haldener Strasse 72, 58095 Hagen, Germany
006 * <schulte2005@users.sourceforge.net> (+49 2331 3543887)
007 *
008 * This library is free software; you can redistribute it and/or
009 * modify it under the terms of the GNU Lesser General Public
010 * License as published by the Free Software Foundation; either
011 * version 2.1 of the License, or any later version.
012 *
013 * This library is distributed in the hope that it will be useful,
014 * but WITHOUT ANY WARRANTY; without even the implied warranty of
015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
016 * Lesser General Public License for more details.
017 *
018 * You should have received a copy of the GNU Lesser General Public
019 * License along with this library; if not, write to the Free Software
020 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
021 *
022 */
023 package org.jdtaus.core.container;
024
025 import java.io.Serializable;
026
027 /**
028 * Base model object.
029 *
030 * @author <a href="mailto:schulte2005@users.sourceforge.net">Christian Schulte</a>
031 * @version $Id: ModelObject.java 8044 2009-07-02 01:29:05Z schulte2005 $
032 */
033 public class ModelObject implements Serializable
034 {
035 //--Constants---------------------------------------------------------------
036
037 /** Serial version UID for backwards compatibility with 1.5.x classes. */
038 private static final long serialVersionUID = 994580334374636235L;
039
040 //---------------------------------------------------------------Constants--
041 //--ModelObject-------------------------------------------------------------
042
043 /**
044 * The model version of the object.
045 * @serial
046 */
047 private String modelVersion;
048
049 /**
050 * The documentation of the object.
051 * @serial
052 */
053 private Text documentation;
054
055 /**
056 * Gets the model version of the object.
057 *
058 * @return the model version of the object.
059 */
060 public String getModelVersion()
061 {
062 return this.modelVersion;
063 }
064
065 /**
066 * Setter for property {@code modelVersion}.
067 *
068 * @param value the new model version of the object.
069 */
070 public void setModelVersion( final String value )
071 {
072 this.modelVersion = value;
073 }
074
075 /**
076 * Gets the documentation of the object.
077 *
078 * @return the documentation of the object.
079 */
080 public Text getDocumentation()
081 {
082 if ( this.documentation == null )
083 {
084 this.documentation = new Text();
085 }
086
087 return this.documentation;
088 }
089
090 /**
091 * Setter for property {@code documentation}.
092 *
093 * @param value the new documentation of the object.
094 */
095 public void setDocumentation( final Text value )
096 {
097 this.documentation = value;
098 }
099
100 /**
101 * Creates a string representing the properties of an instance.
102 *
103 * @param modelObject the instance to create a string for.
104 *
105 * @return a string representing the properties of {@code modelObject}.
106 */
107 String internalString( final ModelObject modelObject )
108 {
109 return new StringBuffer( 500 ).append( "modelVersion=" ).append(
110 modelObject.getModelVersion() ).
111 append( ", documentation=" ).
112 append( modelObject.getDocumentation() ).toString();
113
114 }
115 //-------------------------------------------------------------ModelObject--
116 }