org.netbeans.modules.xml.xam
Class ModelSource

java.lang.Object
  extended by org.netbeans.modules.xml.xam.ModelSource
All Implemented Interfaces:
Lookup.Provider

public class ModelSource
extends java.lang.Object
implements Lookup.Provider

This is the class that encapsulates the physical file for each model.

Author:
girix

Constructor Summary
ModelSource(Lookup lookup, boolean editable)
          Create a model source object given the lookup context.
 
Method Summary
 Lookup getLookup()
          Returns the lookup object associated with this ModelSource.
 boolean isEditable()
          States if the backing file can be edited.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelSource

public ModelSource(Lookup lookup,
                   boolean editable)
Create a model source object given the lookup context. If editable is false the model cannot be mutated. Note that editable is static attribute of the model source, and does not reflect the access attribute of the associated file.

Parameters:
lookup - Lookup object associated with this ModelSource. Lookup minimally contains a File path of the backing file of the model and a javax.swing.text.Document object.
editable - whether the model is supposed to be mutated.
Method Detail

getLookup

public Lookup getLookup()
Returns the lookup object associated with this ModelSource. Lookup minimally contains a File absolute path or FileObject of the backing file of the model and javax.swing.text.Document object. If model is DOM, the lookup should also contains javax.xml.transform.Source object for use in cases of relative resolution of resource such as validation.

Specified by:
getLookup in interface Lookup.Provider
Returns:
fully initialized lookup instance provided by this object

isEditable

public boolean isEditable()
States if the backing file can be edited.

Returns:
true if the model source file is writable.