Apache JMeter
1.9

org.apache.jmeter.testelement.property
Class AbstractProperty

java.lang.Object
  |
  +--org.apache.jmeter.testelement.property.AbstractProperty
All Implemented Interfaces:
Cloneable, Comparable, JMeterProperty, Serializable
Direct Known Subclasses:
BooleanProperty, FunctionProperty, MultiProperty, NullProperty, NumberProperty, StringProperty

public abstract class AbstractProperty
extends Object
implements JMeterProperty

Version:
$Revision: 1.11 $
See Also:
Serialized Form

Field Summary
protected static org.apache.log.Logger log
           
 
Constructor Summary
AbstractProperty()
           
AbstractProperty(String name)
           
 
Method Summary
 void clearTemporary(TestElement owner)
          Tells the property that it should clear information regarding the temporary attribute for the given owner.
 Object clone()
           
 int compareTo(Object arg0)
           
protected  JMeterProperty convertObject(Object item)
           
 boolean equals(Object o)
           
protected  JMeterProperty getBlankProperty()
           
 boolean getBooleanValue()
          Returns false if string is invalid or null.
 double getDoubleValue()
          Returns 0 if string is invalid or null.
 float getFloatValue()
          Returns 0 if string is invalid or null.
 int getIntValue()
          Returns 0 if string is invalid or null.
 long getLongValue()
          Returns 0 if string is invalid or null.
 String getName()
          The name of the property.
protected  Class getPropertyType()
          Get the property type for this property.
protected  boolean isEqualType(JMeterProperty prop)
           
 boolean isRunningVersion()
          Returns whether the property is a running version.
 boolean isTemporary(TestElement owner)
          Indicates whether the property is a temporary property.
 void mergeIn(JMeterProperty prop)
          Take the given property object and merge it's value with the current property object.
protected  Collection normalizeList(Collection coll)
           
protected  Map normalizeMap(Map coll)
          Given a Map, it converts the Map into a collection of JMeterProperty objects, appropriate for a MapProperty object.
 void recoverRunningVersion(TestElement owner)
          Tell the property to revert to the state at the time setRunningVersion(true) was called.
 void setName(String name)
          Set the property name.
 void setRunningVersion(boolean runningVersion)
          Make the property a running version or turn it off as the running version.
 void setTemporary(boolean temporary, TestElement owner)
          A property newly created and added to a test element that is currently a running version should be made temporary.
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.jmeter.testelement.property.JMeterProperty
getObjectValue, getStringValue, setObjectValue
 

Field Detail

log

protected static org.apache.log.Logger log
Constructor Detail

AbstractProperty

public AbstractProperty(String name)

AbstractProperty

public AbstractProperty()
Method Detail

isEqualType

protected boolean isEqualType(JMeterProperty prop)

isRunningVersion

public boolean isRunningVersion()
Description copied from interface: JMeterProperty
Returns whether the property is a running version.

Specified by:
isRunningVersion in interface JMeterProperty
Returns:
boolean

getName

public String getName()
Description copied from interface: JMeterProperty
The name of the property. Typically this should match the name that keys the property's location in the test elements Map.

Specified by:
getName in interface JMeterProperty
Returns:
String

setName

public void setName(String name)
Description copied from interface: JMeterProperty
Set the property name.

Specified by:
setName in interface JMeterProperty
Parameters:
name -

setRunningVersion

public void setRunningVersion(boolean runningVersion)
Description copied from interface: JMeterProperty
Make the property a running version or turn it off as the running version. A property that is made a running version will preserve the current state in such a way that it is retrievable by a future call to 'recoverRunningVersion()'. Additionally, a property that is a running version will resolve all functions prior to returning it's property value. A non-running version property will return functions as their uncompiled string representation.

Specified by:
setRunningVersion in interface JMeterProperty
Parameters:
runningVersion -

isTemporary

public boolean isTemporary(TestElement owner)
Description copied from interface: JMeterProperty
Indicates whether the property is a temporary property. A property newly created and added to a test element that is currently a running version should be made temporary.

Specified by:
isTemporary in interface JMeterProperty
Returns:
boolean

mergeIn

public void mergeIn(JMeterProperty prop)
Description copied from interface: JMeterProperty
Take the given property object and merge it's value with the current property object. For most property types, this will simply be ignored. But for collection properties and test element properties, more complex behavior is required.

Specified by:
mergeIn in interface JMeterProperty
Parameters:
prop -

setTemporary

public void setTemporary(boolean temporary,
                         TestElement owner)
Description copied from interface: JMeterProperty
A property newly created and added to a test element that is currently a running version should be made temporary. This indicates it is not part of the running version of the test element and will be deleted when the test element recovers state.

Specified by:
setTemporary in interface JMeterProperty
Parameters:
temporary -

clearTemporary

public void clearTemporary(TestElement owner)
Description copied from interface: JMeterProperty
Tells the property that it should clear information regarding the temporary attribute for the given owner.

Specified by:
clearTemporary in interface JMeterProperty
Parameters:
owner -

clone

public Object clone()
Specified by:
clone in interface JMeterProperty
Overrides:
clone in class Object

getIntValue

public int getIntValue()
Returns 0 if string is invalid or null.

Specified by:
getIntValue in interface JMeterProperty
See Also:
JMeterProperty.getIntValue()

getLongValue

public long getLongValue()
Returns 0 if string is invalid or null.

Specified by:
getLongValue in interface JMeterProperty
See Also:
JMeterProperty.getLongValue()

getDoubleValue

public double getDoubleValue()
Returns 0 if string is invalid or null.

Specified by:
getDoubleValue in interface JMeterProperty
See Also:
JMeterProperty.getDoubleValue()

recoverRunningVersion

public void recoverRunningVersion(TestElement owner)
Description copied from interface: JMeterProperty
Tell the property to revert to the state at the time setRunningVersion(true) was called.

Specified by:
recoverRunningVersion in interface JMeterProperty
See Also:
JMeterProperty.recoverRunningVersion(TestElement)

getFloatValue

public float getFloatValue()
Returns 0 if string is invalid or null.

Specified by:
getFloatValue in interface JMeterProperty
See Also:
JMeterProperty.getFloatValue()

getBooleanValue

public boolean getBooleanValue()
Returns false if string is invalid or null.

Specified by:
getBooleanValue in interface JMeterProperty
See Also:
JMeterProperty.getBooleanValue()

equals

public boolean equals(Object o)
Specified by:
equals in interface JMeterProperty
Overrides:
equals in class Object

compareTo

public int compareTo(Object arg0)
Specified by:
compareTo in interface Comparable

getPropertyType

protected Class getPropertyType()
Get the property type for this property. Used to convert raw values into JMeterProperties.


getBlankProperty

protected JMeterProperty getBlankProperty()

normalizeList

protected Collection normalizeList(Collection coll)

normalizeMap

protected Map normalizeMap(Map coll)
Given a Map, it converts the Map into a collection of JMeterProperty objects, appropriate for a MapProperty object.


convertObject

protected JMeterProperty convertObject(Object item)

toString

public String toString()
Overrides:
toString in class Object

Apache JMeter
1.9

Copyright © 1998-2003 Apache Software Foundation. All Rights Reserved.