001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: *
017: */
018:
019: package org.apache.jmeter.testelement.property;
020:
021: import org.apache.jmeter.testelement.TestElement;
022:
023: /**
024: * A null property.
025: *
026: */
027: public final class NullProperty extends AbstractProperty {
028: private JMeterProperty tempValue; // TODO - why does null property have a value?
029:
030: public NullProperty(String name) {
031: super (name);
032: }
033:
034: public NullProperty() {
035: super ();
036: }
037:
038: /**
039: * @see JMeterProperty#getStringValue()
040: */
041: public String getStringValue() {
042: if (tempValue != null) {
043: return tempValue.getStringValue();
044: }
045: return "";
046: }
047:
048: public void setObjectValue(Object v) {
049: }
050:
051: /**
052: * @see JMeterProperty#getObjectValue()
053: */
054: public Object getObjectValue() {
055: return null;
056: }
057:
058: /**
059: * @see JMeterProperty#isRunningVersion()
060: */
061: public boolean isRunningVersion() {
062: return false;
063: }
064:
065: /**
066: * see JMeterProperty#isTemporary(TestElement)
067: */
068: public boolean isTemporary(TestElement owner) {
069: return true;
070: }
071:
072: /**
073: * @see JMeterProperty#mergeIn(JMeterProperty)
074: */
075: public void mergeIn(JMeterProperty prop) {
076: tempValue = prop;
077: }
078:
079: public final Object clone() {
080: return this ;
081: }
082:
083: /**
084: * @see JMeterProperty#getBooleanValue()
085: */
086: public boolean getBooleanValue() {
087: return false;
088: }
089:
090: /**
091: * @see JMeterProperty#getDoubleValue()
092: */
093: public double getDoubleValue() {
094: return 0;
095: }
096:
097: /**
098: * @see JMeterProperty#getFloatValue()
099: */
100: public float getFloatValue() {
101: return 0;
102: }
103:
104: /**
105: * @see JMeterProperty#getIntValue()
106: */
107: public int getIntValue() {
108: return 0;
109: }
110:
111: /**
112: * @see JMeterProperty#getLongValue()
113: */
114: public long getLongValue() {
115: return 0;
116: }
117:
118: /**
119: * @see JMeterProperty#recoverRunningVersion(TestElement)
120: */
121: public void recoverRunningVersion(TestElement owner) {
122: tempValue = null;
123: }
124:
125: }
|