|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.wpi.cs.dsrg.xmldb.xat.common.operator.XATPropertiesImp
Provides an abstract implementation of the XATProperties interface. Any type that wants to make use of Properties should derive from this type. Note, in order to make use of the StatisticsGatherer and Statistics the type should derive from XATQueryObjectImp b/c this type does not provide an interface to the StatisticsGatherer.
The setProperty method is abstract so that implementing classes can provide some validation. This class provides some basic validation- ensuring values are non zero. If more is required, it should be provided by the lower classes.
Each class that extends this class should set the initial properties in the setDefaultProperties method using addProperty.
The properties are used to configure the various objects in the system and this class provides a standard means to access the properties. The properties only support Strings for both name and value.
Constructor Summary | |
XATPropertiesImp()
Create a new Properties, and calls setDefaultProperties(). |
Method Summary | |
protected void |
addProperty(java.lang.String name,
java.lang.String defaultValue)
Adds a new property that will be supported with a given default value. |
java.util.Enumeration |
getProperties()
Returns an enumeration of property names supported by this query object |
java.lang.String |
getProperty(java.lang.String name)
retrieve the value of the property with the given name. |
boolean |
isValidPropertyName(java.lang.String nameToCheck)
Checks if the given property is valid for this QueryObject. |
protected void |
setDefaultProperties()
called by the constructor. |
protected void |
setNewPropertyValue(java.lang.String name,
java.lang.String value)
This method actually sets the property value. |
void |
setProperty(java.lang.String name,
java.lang.String value)
sets the given property to the new value. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public XATPropertiesImp()
Method Detail |
protected void addProperty(java.lang.String name, java.lang.String defaultValue)
name
- java.lang.String the name of the propertydefaultValue
- java.lang.String its default value.public java.util.Enumeration getProperties()
public java.lang.String getProperty(java.lang.String name)
name
- the name of the property to returnpublic boolean isValidPropertyName(java.lang.String nameToCheck)
protected void setDefaultProperties()
protected void setNewPropertyValue(java.lang.String name, java.lang.String value)
name
- java.lang.Stringvalue
- java.lang.Stringpublic void setProperty(java.lang.String name, java.lang.String value) throws java.lang.Exception
Once it is known that the object supports the property, the value must be validated. Each implementor of XATStatistics has a set of properties that are common to all of its types and some that are specific to types. For example, all XATOperators (which implement XATStatistics) have certain properties while an individual XATOperator has specific properties. The indivual types should only validate their own specific types. If the caller is trying to set a common type, it should be validated by the super class by calling super.setProperty(name, value). This will reduce duplicate code.
When it is determined the name / value pair is correct, the pair is updated using setNewPropertyValue()
XATStatisticsImp provides default validation by checking to see if the property's value is
>=0. propertyValues that are Strings will just be set. If the property requires more strict constraints than this,
it is up to the subclass that created the property to validate it (as described above).
name
- the name of the property to setvalue
- the new value of the property
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |