001: /*
002: * $Id: ModelParam.java,v 1.2 2003/12/13 16:39:55 ajzeneski Exp $
003: *
004: * Copyright (c) 2001, 2002 The Open For Business Project - www.ofbiz.org
005: *
006: * Permission is hereby granted, free of charge, to any person obtaining a
007: * copy of this software and associated documentation files (the "Software"),
008: * to deal in the Software without restriction, including without limitation
009: * the rights to use, copy, modify, merge, publish, distribute, sublicense,
010: * and/or sell copies of the Software, and to permit persons to whom the
011: * Software is furnished to do so, subject to the following conditions:
012: *
013: * The above copyright notice and this permission notice shall be included
014: * in all copies or substantial portions of the Software.
015: *
016: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
017: * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
018: * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
019: * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
020: * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
021: * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
022: * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
023: *
024: */
025: package org.ofbiz.service;
026:
027: /**
028: * Generic Service Model Parameter
029: *
030: * @author <a href="mailto:jaz@ofbiz.org">Andy Zeneski</a>
031: * @author <a href="mailto:jonesde@ofbiz.org">David E. Jon</a>
032: * @version $Revision: 1.2 $
033: * @since 2.0
034: */
035: public class ModelParam {
036:
037: /** Parameter name */
038: public String name;
039:
040: /** Paramater type */
041: public String type;
042:
043: /** Parameter mode (IN/OUT/INOUT) */
044: public String mode;
045:
046: /** The form label */
047: public String formLabel;
048:
049: /** The entity name */
050: public String entityName;
051:
052: /** The entity field name */
053: public String fieldName;
054:
055: /** Parameter prefix for creating an attribute Map */
056: public String stringMapPrefix;
057:
058: /** Parameter sufix for creating an attribute List */
059: public String stringListSuffix;
060:
061: /** Is this Parameter required or optional? Default to false, or required */
062: public boolean optional = false;
063: public boolean overrideOptional = false;
064:
065: /** Is this parameter to be displayed via the form tool? */
066: public boolean formDisplay = true;
067: public boolean overrideFormDisplay = false;
068:
069: /** Is this Parameter set internally? */
070: public boolean internal = false;
071:
072: public ModelParam() {
073: }
074:
075: public ModelParam(ModelParam param) {
076: this .name = param.name;
077: this .type = param.type;
078: this .mode = param.mode;
079: this .formLabel = param.formLabel;
080: this .entityName = param.entityName;
081: this .fieldName = param.fieldName;
082: this .stringMapPrefix = param.stringMapPrefix;
083: this .stringListSuffix = param.stringListSuffix;
084: this .optional = param.optional;
085: this .overrideOptional = param.overrideOptional;
086: this .formDisplay = param.formDisplay;
087: this .overrideFormDisplay = param.overrideFormDisplay;
088: this .internal = param.internal;
089: }
090:
091: public String toString() {
092: StringBuffer buf = new StringBuffer();
093: buf.append(name + "::");
094: buf.append(type + "::");
095: buf.append(mode + "::");
096: buf.append(formLabel + "::");
097: buf.append(entityName + "::");
098: buf.append(fieldName + "::");
099: buf.append(stringMapPrefix + "::");
100: buf.append(stringListSuffix + "::");
101: buf.append(optional + "::");
102: buf.append(overrideOptional + "::");
103: buf.append(formDisplay + "::");
104: buf.append(overrideFormDisplay + "::");
105: buf.append(internal);
106: return buf.toString();
107: }
108:
109: public boolean equals(ModelParam model) {
110: if (model.name.equals(this .name))
111: return true;
112: return false;
113: }
114: }
|