UC Berkeley Group for User Interface Research
Updated November 17, 2000

edu.berkeley.guir.lib.properties
Class PropertySchema

java.lang.Object
  |
  +--edu.berkeley.guir.lib.properties.PropertySchema
All Implemented Interfaces:
PropertyConstants

public class PropertySchema
extends Object
implements PropertyConstants

Specifies a single schema for a property in the FlexProperties class.

There are three methods you may want to override:

This software is distributed under the Berkeley Software License.

 Revisions:  - GUIRLib-v1.0-1.0.0, Jun 02 2000, JH
               Created class
             - GUIRLib-v1.2-1.0.0, Jun 22 2000, JH
               Touched for GUIRLib release
             - GUIRLib-v1.3-1.0.0, Aug 11 2000, JH
               Touched for GUIRLib release
             - GUIRLib-v1.4-1.0.0, Aug 31 2000, JH
               Touched for GUIRLib release
 

Since:
JDK 1.3
Version:
GUIRLib-v1.4-1.0.0, Aug 31 2000
Author:
Jason Hong ( jasonh@cs.berkeley.edu )

Fields inherited from interface edu.berkeley.guir.lib.properties.PropertyConstants
PROPERTY_BOUND, PROPERTY_CONSTRAINED, PROPERTY_INDEXED, PROPERTY_SIMPLE
 
Constructor Summary
PropertySchema(String newPropertyName)
           
PropertySchema(String newPropertyName, int propertyType)
           
 
Method Summary
 boolean acceptValue(Object oldVal, Object newVal)
          Check if this value acceptable for this property.
 String getPropertyName()
          Get the name of this property.
 int getPropertyType()
           
 boolean isBoundProperty()
           
 boolean isConstrainedProperty()
           
 boolean isIndexedProperty()
           
 boolean isSimpleProperty()
           
 void onIllegalArgumentException(IllegalArgumentException e, Object oldVal, Object newVal)
          Occurs if acceptValue(Object, Object) fails.
 void onPropertyVetoException(PropertyVetoException e, Object oldVal, Object newVal)
          Occurs if one of the veto change listeners throws a hissy fit.
 void setBoundProperty()
           
 void setConstrainedProperty()
           
 void setIndexedProperty()
           
 void setPropertyName(String newPropertyName)
           
 void setPropertyType(int type)
           
 void setSimpleProperty()
           
 String toString()
          Get a String version of this schema.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertySchema

public PropertySchema(String newPropertyName)

PropertySchema

public PropertySchema(String newPropertyName,
                      int propertyType)
Method Detail

acceptValue

public boolean acceptValue(Object oldVal,
                           Object newVal)
Check if this value acceptable for this property. An IllegalArgumentException will be thrown automatically if this fails.

Override this method to specify valid types and values.


onIllegalArgumentException

public void onIllegalArgumentException(IllegalArgumentException e,
                                       Object oldVal,
                                       Object newVal)
Occurs if acceptValue(Object, Object) fails. The current value of the property will still be oldVal. Default behavior is to print exception to System.err.

Override this method to a new behavior for exception handling.

Parameters:
e - is the exception thrown.
oldVal - is the original and current value.
newVal - is the proposed value that caused the exception.

onPropertyVetoException

public void onPropertyVetoException(PropertyVetoException e,
                                    Object oldVal,
                                    Object newVal)
Occurs if one of the veto change listeners throws a hissy fit. The current value of the property will still be oldVal. Default behavior is to print exception to System.err.

Override this method to a new behavior for exception handling.

Parameters:
e - is the exception thrown.
oldVal - is the original and current value.
newVal - is the proposed value that caused the exception.

setPropertyName

public void setPropertyName(String newPropertyName)

getPropertyName

public String getPropertyName()
Get the name of this property.

setPropertyType

public void setPropertyType(int type)

getPropertyType

public int getPropertyType()

setSimpleProperty

public void setSimpleProperty()

isSimpleProperty

public boolean isSimpleProperty()

setBoundProperty

public void setBoundProperty()

isBoundProperty

public boolean isBoundProperty()

setConstrainedProperty

public void setConstrainedProperty()

isConstrainedProperty

public boolean isConstrainedProperty()

setIndexedProperty

public void setIndexedProperty()

isIndexedProperty

public boolean isIndexedProperty()

toString

public String toString()
Get a String version of this schema.
Overrides:
toString in class Object

Copyright Information