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