org.netbeans.modules.xml.xam
Class AbstractModelFactory<M extends Model>

java.lang.Object
  extended by org.netbeans.modules.xml.xam.AbstractModelFactory<M>
Direct Known Subclasses:
BpelModelFactoryImpl, WSDLModelFactory

public abstract class AbstractModelFactory<M extends Model>
extends java.lang.Object

Author:
Chris Webster, Nam Nguyen

Field Summary
static int DELAY_DIRTY
           
static int DELAY_SYNCER
           
static java.lang.String MODEL_LOADED_PROPERTY
           
 
Constructor Summary
AbstractModelFactory()
           
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Adds property change listener on the factory to be notified on when new models are loaded by the factory.
 M createFreshModel(ModelSource modelSource)
          Create new model from given model source; returns null if there are errors during creation.
protected abstract  M createModel(ModelSource source)
           
static ModelAccessProvider getAccessProvider()
           
protected  java.lang.Object getKey(ModelSource source)
          This method extracts the key from the model source.
protected  M getModel(ModelSource source)
           
 java.util.List<M> getModels()
          Returns list of models currently cached by the factory.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Removes property change listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DELAY_SYNCER

public static final int DELAY_SYNCER
See Also:
Constant Field Values

DELAY_DIRTY

public static final int DELAY_DIRTY
See Also:
Constant Field Values

MODEL_LOADED_PROPERTY

public static final java.lang.String MODEL_LOADED_PROPERTY
See Also:
Constant Field Values
Constructor Detail

AbstractModelFactory

public AbstractModelFactory()
Method Detail

createModel

protected abstract M createModel(ModelSource source)

createFreshModel

public M createFreshModel(ModelSource modelSource)
Create new model from given model source; returns null if there are errors during creation. Note that, the returned model might not be valid, i.e., source is well-formed. Also, that the returned model is not cached and does not have background auto-sync support.


getKey

protected java.lang.Object getKey(ModelSource source)
This method extracts the key from the model source. A subclass can change the ModelSource lookup requirements and thus this method may be overridden to allow a different key to be used.


getAccessProvider

public static ModelAccessProvider getAccessProvider()

getModel

protected M getModel(ModelSource source)

getModels

public java.util.List<M> getModels()
Returns list of models currently cached by the factory.


addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds property change listener on the factory to be notified on when new models are loaded by the factory.


removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes property change listener.