001: /*
002: * This file is part of PFIXCORE.
003: *
004: * PFIXCORE is free software; you can redistribute it and/or modify
005: * it under the terms of the GNU Lesser General Public License as published by
006: * the Free Software Foundation; either version 2 of the License, or
007: * (at your option) any later version.
008: *
009: * PFIXCORE is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012: * GNU Lesser General Public License for more details.
013: *
014: * You should have received a copy of the GNU Lesser General Public License
015: * along with PFIXCORE; if not, write to the Free Software
016: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
017: *
018: */
019:
020: package de.schlund.pfixxml.multipart;
021:
022: import de.schlund.pfixxml.RequestParam;
023: import de.schlund.pfixxml.RequestParamType;
024:
025: /**
026: *
027: *
028: */
029:
030: public abstract class PartData implements RequestParam {
031:
032: protected String primaryType = null;
033: protected String subType = null;
034: protected String fieldname = null;
035: protected String value = null;
036: protected RequestParamType type;
037: private boolean synthetic = false;
038:
039: public boolean isTrue() {
040: if (value != null) {
041: return (value.equals("true") || value.equals("1") || value
042: .equals("yes"));
043: }
044: return false;
045: }
046:
047: public boolean isSynthetic() {
048: return synthetic;
049: }
050:
051: public void setSynthetic(boolean synthetic) {
052: this .synthetic = synthetic;
053: }
054:
055: /**
056: * Constructor for PartData.
057: */
058: public PartData() {
059: }
060:
061: /**
062: * Gets the fieldname.
063: * @return Returns a String
064: */
065: public String getFieldname() {
066: return fieldname;
067: }
068:
069: /**
070: * Sets the fieldname.
071: * @param fieldname The fieldname to set
072: */
073: protected void setFieldname(String fieldname) {
074: this .fieldname = fieldname;
075: }
076:
077: /**
078: * Gets the type.
079: * @return Returns a int
080: */
081: public RequestParamType getType() {
082: return type;
083: }
084:
085: protected void setType(RequestParamType type) {
086: this .type = type;
087: }
088:
089: /**
090: * Gets the baseType.
091: * @return Returns a String
092: */
093: public String getPrimaryType() {
094: return primaryType;
095: }
096:
097: /**
098: * Sets the baseType.
099: * @param baseType The baseType to set
100: */
101: protected void setPrimaryType(String primaryType) {
102: this .primaryType = primaryType;
103: }
104:
105: /**
106: * Gets the subType.
107: * @return Returns a String
108: */
109: public String getSubType() {
110: return subType;
111: }
112:
113: /**
114: * Sets the subType.
115: * @param subType The subType to set
116: */
117: public void setSubType(String subType) {
118: this .subType = subType;
119: }
120:
121: /**
122: * Gets the value.
123: * @return Returns a String
124: */
125: public String getValue() {
126: return value;
127: }
128:
129: public String toString() {
130: return getValue();
131: }
132:
133: /**
134: * Sets the value.
135: * @param value The value to set
136: */
137: public void setValue(String value) {
138: this.value = value;
139: }
140:
141: }
|