projectviewer.persist
Class DeferredProperty

java.lang.Object
  extended byprojectviewer.persist.DeferredProperty

public class DeferredProperty
extends java.lang.Object

Defers the loading of a property until it's requested. This avoids ClassCastExceptions and ClassNotFoundErrors when loading PV, since the plugins that set "object" properties might not be available.

Since in a perfect world only the plugin that set the property will try to load it, the implementing class of the serialized object will most probably be available when the property is requested from the project.

This requires special treatment in VPTProject.

Since:
PV 2.1.2
Version:
$Id: DeferredProperty.java 7059 2006-09-17 20:58:10Z ezust $
Author:
Marcelo Vanzin

Constructor Summary
DeferredProperty(java.lang.String data, java.lang.String name)
           
 
Method Summary
protected  java.lang.String getData()
          Returns the original string with the serialized object.
 java.lang.Object getValue()
          Tries to load the object represented by the serialized data; returns the object, or "this" if loading failed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeferredProperty

public DeferredProperty(java.lang.String data,
                        java.lang.String name)
Method Detail

getData

protected java.lang.String getData()
Returns the original string with the serialized object. This will be null if the object was instantiated.


getValue

public java.lang.Object getValue()
Tries to load the object represented by the serialized data; returns the object, or "this" if loading failed. An error message is logged to the activity log in the latter case.