com.sage.accpac.sm
Class Property

java.lang.Object
  extended by com.sage.accpac.sm.Property

@NotThreadSafe
public class Property
extends java.lang.Object

Provides access to a persisted property shared over the whole system.
The easiest way to create a property object is by calling PropertyBag.getProperty

See Also:
the PropertyBag class, the constructor
Thread safety
Not thread-safe.

Method Summary
 void clear()
          Clears the property.
 java.lang.Object getValue()
          gets the value of the property.
 void setValue(java.lang.Object o)
          sets the value of the property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

clear

public void clear()
Clears the property.
Attempting to get a property that has been cleared returns a null reference.
Clearing a property that is already clear is not an error.

Throws:
java.lang.NullPointerException - if the underlying program has been disposed
A4wapiGenericError - on a variety of other occasions such as inability to create the underlying tables etc.

setValue

public void setValue(java.lang.Object o)
sets the value of the property.

Parameters:
o - an object defining the value of the property. This must be a serializable object.
Throws:
java.io.InvalidClassException - if the serialised object is too large to store.

getValue

public java.lang.Object getValue()
gets the value of the property. If there is no such property (either because it has been cleared or it has never been set in the first place) then a null reference will be returned.

Throws:
A4wapiGenericError
java.lang.RuntimeException - wrapping either a ClassNotFoundException if the property includes a class not present here or wrapping a java.io.IOException if there is an IOException while converting the property back into an object.


Copyright © 2010 Sage Software, Inc. All rights reserved.