public abstract class ModelAdapter extends java.lang.Object implements java.lang.Comparable<ModelAdapter>, Located
Element (usually, an IDE Node). A ModelAdapter knows how to get the constructs in the model,
 and works with the Location class to identify and track constructs 
 as the model evolves. Each concrete model adapter subclass is associated 
 with a specific model type and a corresponding concrete ModelType 
 subclass.
 A typical model adapter corresponds to a file node in the IDE and identifies a workspace, a project, a package, and a node. If two projects are audited which contain the same node, two model adapters will be created and each will be traversed once. Model adapters have a natural order defined by comparing, in order, the names of workspace, project, package, and node.
 Typically, Audit works with text nodes. The TextFileModelAdapter
 subclass is an abstract class that provides specific support for writing
 model adapters for models corresponding to text nodes. For uniformity, the
 Audit framework also supplies ModelAdapter subclasses for the root,
 workspace, projects, and directories.
 
 The IDE allows nodes and their content to be accessed from multiple threads,
 and requires various sorts of locking protocols to ensure correctness. 
 ModelAdapter maps these protocols to the Audit framework as two 
 kinds of transactions: read and write, with associated begin, end, and 
 cancel methods. The Audit framework always accesses content inside a read
 transaction, and modifies content (i.e., applies transforms) inside a write
 transaction. The ModelAdapter methods that access content are
 documented to require that a read transaction for the current thread be
 active, and generally will throw IllegalStateException if one is not.
 
 Accessing content usually implies I/O, and the consqequent possibility of
 failure. When a ModelAdapter method implementation which accesses 
 content encounters an exception which prevents it from fulfilling its 
 contract, it should throw a ModelAccessError that wraps the 
 underlying exception, created through createModelAccessError().
| Modifier | Constructor and Description | 
|---|---|
protected  | 
ModelAdapter(ModelFactory factory,
            ModelType type,
            ContainerModelAdapter workspace,
            ContainerModelAdapter project,
            ContainerModelAdapter directory,
            ContentDirectory element,
            java.net.URL url)
Creates a model adapter that adapts a  
ContentDirectory element. | 
protected  | 
ModelAdapter(ModelFactory factory,
            ModelType type,
            ContainerModelAdapter workspace,
            ContainerModelAdapter project,
            ContainerModelAdapter directory,
            Node node,
            java.net.URL url)
Creates a model adapter that adapts a file  
Node. | 
protected  | 
ModelAdapter(ModelFactory factory,
            ModelType type,
            ContainerModelAdapter workspace,
            ContainerModelAdapter project,
            ContainerModelAdapter directory,
            Node node,
            java.net.URL url,
            java.lang.String primaryCollationString)
Creates a model adapter that adapts a file  
Node. | 
protected  | 
ModelAdapter(ModelFactory factory,
            ModelType type,
            ContainerModelAdapter workspace,
            Project project,
            java.net.URL url)
Creates a model adapter that adapts a  
Project node. | 
protected  | 
ModelAdapter(ModelFactory factory,
            ModelType type,
            Workspaces workspaces,
            java.net.URL url)
Creates a model adapter that adapts a root  
Workspaces element. | 
protected  | 
ModelAdapter(ModelFactory factory,
            ModelType type,
            Workspace workspace,
            java.net.URL url)
Creates a model adapter that adapts a  
Workspace node. | 
| Modifier and Type | Method and Description | 
|---|---|
protected void | 
acquireReadLock(LockPolicy policy)
Acquires a read lock for this model. 
 | 
protected void | 
acquireReadLock(WriteLockRequestListener listener)
Acquires a read lock for this model. 
 | 
protected void | 
acquireReadLock(WriteLockRequestListener listener,
               boolean retryPreferred)
Acquires a read lock for this model. 
 | 
void | 
beginRead()
Begins a read transaction on this model for the current thread. 
 | 
void | 
beginRead(LockPolicy policy)
Begins a read transaction on this model for the current thread. 
 | 
protected void | 
beginReadHook()
A subclass hook invoked by  
beginRead() after it invokes
 acquireReadLock(oracle.jdeveloper.audit.model.LockPolicy). | 
void | 
cancelRead()
Cancels any read transaction for any thread on this model. 
 | 
protected static int | 
compareSiblings(ModelAdapter d1,
               ModelAdapter d2)  | 
abstract int | 
compareTo(ModelAdapter that)
Gets whether this model is less than, equal to, or greater than another
 using the natural order defined by this class. 
 | 
protected static boolean | 
contains(int offset1,
        int length1,
        Location location2)
Gets whether a range contains a location, specifically for use by
 subclasses implementing  
contains(Object, Location). | 
boolean | 
contains(Location location)
Gets whether this model contains a location. 
 | 
abstract boolean | 
contains(ModelAdapter that)
Gets whether this model contains a model. 
 | 
boolean | 
contains(java.lang.Object construct,
        Location location)
Gets whether a construct in this model contains a location. 
 | 
java.lang.String | 
contextDescription(Location location)
Gets a description of a location of this model. 
 | 
ModelAccessError | 
createModelAccessError()
Creates an exception to report a model access error. 
 | 
ModelAccessError | 
createModelAccessError(AuditContext context)
Creates an exception to report a model access error based on a  
AuditContext.getLocation() failure. | 
ModelAccessError | 
createModelAccessError(java.lang.Throwable cause)
Creates an exception to report a model access error based on an exception. 
 | 
boolean | 
edit(Location location)
Edits a location in this model using an editor suitable for the model and
 location. 
 | 
void | 
endRead()
Ends the read transaction on this model for the current 
 thread. 
 | 
void | 
endRead(LockPolicy policy)
Ends the read transaction on this model for the current
 thread. 
 | 
protected void | 
endReadHook()
A subclass hook invoked by  
endRead() before it invokes
 releaseReadLock(oracle.jdeveloper.audit.model.LockPolicy). | 
void | 
enter(AuditContext context)
Invoked as an auditor traversal enters this model. 
 | 
boolean | 
equals(java.lang.Object object)
Gets whether this model is equal to an object. 
 | 
void | 
exit(AuditContext context)
Invoked as an auditor traversal exits this model. 
 | 
java.lang.Object | 
getAttribute(java.lang.Object key)
Gets the value of an attribute in this model, or null if
 none. 
 | 
char | 
getCharacter(int offset)
Gets a character from this model, or  
0 if no text is
 available. | 
int | 
getColumnOffset(int offset)
Gets the zero-based column offset of a character offset in this model,
 or the character offset if this model does not have lines and columns. 
 | 
java.lang.Object | 
getConstruct(Location location)
Gets the innermost construct containing a location in this model. 
 | 
java.lang.Object | 
getConstruct(Location location,
            java.lang.Object parentConstruct)
Gets the outermost construct containing a location within a specified
 construct in this model. 
 | 
abstract java.util.Iterator | 
getContainedConstructs(java.lang.Object construct)
Gets the constructs contained by a construct in this model. 
 | 
abstract ContainerModelAdapter | 
getContainingAdapter()
Gets the model adapter containing this model adapter, or null if this is 
 the root node. 
 | 
Dependency | 
getDependency()
Gets a  
Dependency which tracks changes to this model. | 
ContentDirectory | 
getDirectory()
Gets the package directory containing this model, or null if none. 
 | 
ContainerModelAdapter | 
getDirectoryAdapter()
Gets the model adapter for the directory containing this model, or null if 
 this is a root, workspace, or project model. 
 | 
Element | 
getElement()
Gets the IDE  
Element corresponding to this model, or null if none. | 
abstract Location[] | 
getElementLocations(Element element)
Gets the locations of the constructs in this model corresponding to an
 IDE element. 
 | 
Location | 
getEndLocation()
Gets a location greater than any location in this model. 
 | 
ModelFactory | 
getFactory()
Gets the factory for this model. 
 | 
FileModelAdapter | 
getFileAdapter()
Gets the model adapter for the file containing this model, or null if this 
 is a root, workspace, project, or directory model. 
 | 
Location | 
getFocusLocation(Location location)
Gets the focus location for a location in this model. 
 | 
Location | 
getFocusLocation(java.lang.Object construct,
                Location location)
Gets the focus location for a construct in this model. 
 | 
javax.swing.Icon | 
getIcon(Location location)
Gets the icon for a location of this model. 
 | 
abstract javax.swing.Icon | 
getIcon(java.lang.Object construct)
Gets the icon for a construct of this model. 
 | 
Context | 
getIdeContext()
Creates an  
IDE context for this model. | 
int | 
getInitialLength()
Gets the initial length of this model. 
 | 
java.lang.Object | 
getLabel(Location location)
Gets the label for a location of this model. 
 | 
abstract java.lang.Object | 
getLabel(java.lang.Object construct)
Gets the label for a construct of this model. 
 | 
java.lang.String | 
getLine(int offset)
Gets a line of text from this model, or null if no text is available. 
 | 
int | 
getLineOffset(int offset)
Gets the zero-based line offset of a character offset in this model,
 or  
0 if this model does not have lines and columns. | 
Location | 
getLocation()
Gets a location less than or equal to any location in this model. 
 | 
Location | 
getLocation(int offset,
           int length)
Gets a location in this model. 
 | 
abstract Location | 
getLocation(java.lang.Object construct)
Gets the location for a construct in this model, or null if the object
 is not a construct in this model. 
 | 
protected ReadWriteLock | 
getLock()  | 
oracle.ide.navigation.NavigationPoint | 
getNavigationPoint(Location location)
Gets a  
NavigationPoint to navigate to a location in this model, or
 null if the location is not navigable. | 
Node | 
getNode()
Gets the IDE  
Node corresponding to this model, or null if none
 (in particular, if this is the root or a directory model). | 
protected java.text.CollationKey | 
getPrimaryCollationKey()  | 
Project | 
getProject()
Gets the project containing this model. 
 | 
ContainerModelAdapter | 
getProjectAdapter()
Gets the model adapter for the project containing this model, or null if 
 this is root or workspace model. 
 | 
java.lang.Object | 
getRoot()
Gets the root construct of this model. 
 | 
abstract java.lang.Object | 
getRootHook()
A subclass hook invoked by  
getRoot() to get the root construct of
 this model. | 
protected java.text.CollationKey | 
getSecondaryCollationKey()  | 
protected java.lang.String | 
getSecondaryCollationString()
Gets the long string used to sort two model adapters when their short 
 strings are equal. 
 | 
java.lang.String | 
getShortLabel()
Gets a short label for this model. 
 | 
java.lang.String | 
getSimpleName()
Gets the simple name of this model. 
 | 
java.lang.Object | 
getSummary(Location location)
Gets the summary for a location of this model. 
 | 
abstract java.lang.Object | 
getSummary(java.lang.Object construct)
Gets the summary for a construct of this model. 
 | 
java.lang.String | 
getText(int offset,
       int length)
Gets text from this model, or null if the model is not a text model. 
 | 
ModelType | 
getType()
Gets the model type for this node. 
 | 
java.net.URL | 
getUrl()
Gets the non-null URL corresponding to this model. 
 | 
java.net.URL | 
getURL()
Deprecated. 
 
use  
getUrl() | 
java.net.URL | 
getUrl(Location location)
Gets the URL of a construct in this model. 
 | 
Workspace | 
getWorkspace()
Gets the workspace containing this model. 
 | 
ContainerModelAdapter | 
getWorkspaceAdapter()
Gets the model adapter for the workspace of this node, or null if this is
 a root model. 
 | 
int | 
hashCode()  | 
boolean | 
isAccessible()  | 
abstract boolean | 
isFile()
Gets whether this model represents a "file". 
 | 
boolean | 
isModifiable()
Gets whether this model is modifiable. 
 | 
boolean | 
isModified()
Gets whether the model has been modified since this representation of it
 was created. 
 | 
boolean | 
isModified(Location location)
Gets whether a region of this model has been modified since this 
 model adapter was created. 
 | 
boolean | 
isNavigable(Location location)
Gets whether a location in this model is navigable. 
 | 
protected boolean | 
isReadLockHeld()  | 
protected boolean | 
isWriteLockHeld()  | 
void | 
release()
Releases resources used by this model. 
 | 
protected void | 
releaseReadLock(LockPolicy policy)
Releases a read lock for this model. 
 | 
protected void | 
releaseReadLock(WriteLockRequestListener listener)
Releases a read lock for this model. 
 | 
void | 
setAttribute(java.lang.Object key,
            java.lang.Object value)
Sets the value of an attribute in this model. 
 | 
java.lang.String | 
toString()  | 
void | 
verifyModelAccess()
Verifies that this model is accessible. 
 | 
void | 
verifyReadTransaction()
Verifies that a read transaction is in progress for this model. 
 | 
protected ModelAdapter(ModelFactory factory, ModelType type, Workspaces workspaces, java.net.URL url)
Workspaces element.protected ModelAdapter(ModelFactory factory, ModelType type, Workspace workspace, java.net.URL url)
Workspace node.protected ModelAdapter(ModelFactory factory, ModelType type, ContainerModelAdapter workspace, Project project, java.net.URL url)
Project node.protected ModelAdapter(ModelFactory factory, ModelType type, ContainerModelAdapter workspace, ContainerModelAdapter project, ContainerModelAdapter directory, ContentDirectory element, java.net.URL url)
ContentDirectory element.protected ModelAdapter(ModelFactory factory, ModelType type, ContainerModelAdapter workspace, ContainerModelAdapter project, ContainerModelAdapter directory, Node node, java.net.URL url)
Node.protected ModelAdapter(ModelFactory factory, ModelType type, ContainerModelAdapter workspace, ContainerModelAdapter project, ContainerModelAdapter directory, Node node, java.net.URL url, java.lang.String primaryCollationString)
Node.public ContentDirectory getDirectory()
public Element getElement()
Element corresponding to this model, or null if none.public Location getEndLocation()
public final ModelFactory getFactory()
public Context getIdeContext()
IDE context for this model.public int getInitialLength()
Integer.MAX_VALUE
 if this node has not been opened. The default ModelAdapter 
 implementation returns Integer.MAX_VALUE.public final Location getLocation()
getLocation in interface Locatedpublic Location getLocation(int offset, int length)
public Node getNode()
Node corresponding to this model, or null if none
 (in particular, if this is the root or a directory model).public Project getProject()
public java.lang.String getShortLabel()
public java.lang.String getSimpleName()
ModelAdapter
 implementation returns URLFileSystem.getFileName(getUrl()).public final ModelType getType()
public java.net.URL getUrl()
public final java.net.URL getURL()
getUrl()public Workspace getWorkspace()
public abstract boolean isFile()
public boolean isModifiable()
ModelAdapter
 implementation returns false.public boolean isModified()
ModelAdapter implementation returns false.public boolean isModified(Location location)
public final void beginRead()
                     throws java.lang.InterruptedException
ModelAdapter implementation delegates to beginRead(LockPolicy) with policy LockPolicy#DEFAULT).ModelAccessError - if model content is inaccessible.java.lang.InterruptedException - if the current thread is in or gets put in the
 interrupted state. The interrupted state is cleared when this exception is
 thrown.public final void beginRead(LockPolicy policy) throws java.lang.InterruptedException
ModelAdapter implementation delegates to acquireReadLock(LockPolicy) to acquire locks and to beginReadHook()
 to allow subclasses to initialize transaction state.policy - The lock policy for the transaction.ModelAccessError - if model content is inaccessible.java.lang.InterruptedException - if the current thread is in or gets put in
 the interrupted state or, depending on lock policy, if implementationthe read lock is not
 immediately available or if other threads have requested the write lock.
 The interrupted state is cleared when this exception is thrown.public final void endRead()
ModelAdapter implementation delegates to endRead(LockPolicy) with policy LockPolicy#DEFAULT)public final void endRead(LockPolicy policy)
 endRead() delegates to endReadHook() to allow subclasses to
 finalize transaction state, and delegates to releaseReadLock(LockPolicy) to release locks.
policy - The lock policy for the transaction. Must be the same as
               given to the corresponding beginRead().public void cancelRead()
ModelAdapter implementation does nothing.
 
 The Audit framework invokes this method when asynchronously cancelling
 an audit which has begun a read transaction on this model. This allows
 model adapters to cancel model-specific long-running operations invoked
 by the model adapter (e.g., a compilation). Asynchronous cancellation is 
 inherently racy, so an implementation must be careful not to fail if
 called  after the transaction has actually ended.protected void acquireReadLock(LockPolicy policy) throws java.lang.InterruptedException
beginRead() with
 no read transaction for this model active on the current thread. The
 default ModelAdapter implementation delegates to acquireReadLock(WriteLockRequestListener, boolean) to ensure backward
 compatibility for subclasses.policy - The lock policy for the transaction.java.lang.InterruptedException - if the current thread is in or gets put in the
 interrupted state, if policy.isRetryPreferred() is true and the
 implementation elects to retry, or if policy.getLockListener()
 is not null and other threads are already waiting for a write lock. The
 interrupted state is cleared when this exception is thrown.protected void acquireReadLock(WriteLockRequestListener listener, boolean retryPreferred) throws java.lang.InterruptedException
acquireReadLock(LockPolicy) with no read transaction for this model
 active on the current thread. The default ModelAdapter implementation
 delegates to acquireReadLock(WriteLockRequestListener) to ensure
 backward compatibility for subclasses.listener - A listener for write lock requests from other threads.retryPreferred - Whether retry can be forced if a lock is unavailable.java.lang.InterruptedException - if the current thread is in or gets put in the
 interrupted state, if retryPreferred is true and the implementation
 elects to retry, or if listener is not null and other threads are
 already waiting for a write lock. The interrupted state is cleared when
 this exception is thrown.protected void acquireReadLock(WriteLockRequestListener listener) throws java.lang.InterruptedException
beginRead() with
 no read transaction for this model active on the current thread. The
 default ModelAdapter implementation does nothing.listener - The listener to notify if a thread requests the write lock,
                 or null.java.lang.InterruptedException - if the current thread is in or gets put in the
 interrupted state, or if listener is not null and other threads are
 already waiting for a write lock. The interrupted state is cleared when
 this exception is thrown.protected void releaseReadLock(LockPolicy policy)
endRead() with
 no write transaction for this model active on the current thread, and a 
 read transaction for this model active on the current thread. The
 default ModelAdapter implementation delegates to releaseReadLock(WriteLockRequestListener) to ensure backward
 compatibility for subclasses.policy - The lock policy for the transaction. Must be the same as
               given to the corresponding acquireReadLock(oracle.jdeveloper.audit.model.LockPolicy).protected void releaseReadLock(WriteLockRequestListener listener)
endRead() with
 no write transaction for this model active on the current thread, and a
 read transaction for this model active on the current thread. The
 default ModelAdapter implementation does nothing.listener - The listener to notify if a thread waits to acquire
                  a write lock, or null. Must be the same as given to the
                  corresponding beginRead().protected void beginReadHook()
                      throws java.lang.InterruptedException
beginRead() after it invokes
 acquireReadLock(oracle.jdeveloper.audit.model.LockPolicy). The default ModelAdapter implementation
 does nothing.java.lang.InterruptedExceptionprotected void endReadHook()
endRead() before it invokes
 releaseReadLock(oracle.jdeveloper.audit.model.LockPolicy). The default ModelAdapter implementation
 does nothing.protected ReadWriteLock getLock()
protected boolean isReadLockHeld()
protected boolean isWriteLockHeld()
public void verifyReadTransaction()
ModelAdapter implementation does nothing.public boolean isAccessible()
public void verifyModelAccess()
ModelAdapter
 implementation does nothing if isAccessible() returns true
 and throws ModelAccessError if it returns false.public final ModelAccessError createModelAccessError()
public final ModelAccessError createModelAccessError(java.lang.Throwable cause)
cause - The exception associated with the cause of the error.public final ModelAccessError createModelAccessError(AuditContext context)
AuditContext.getLocation() failure.public boolean isNavigable(Location location)
ModelAdapter implementation returns true if getNavigationPoint(Location) returns a non-null value.java.lang.IllegalArgumentException - if the location is not of this model.public oracle.ide.navigation.NavigationPoint getNavigationPoint(Location location)
NavigationPoint to navigate to a location in this model, or
 null if the location is not navigable.  The default ModelAdapter
 implementation returns null.java.lang.IllegalArgumentException - if the location is not of this model.public boolean edit(Location location)
ModelAdapter implementation invokes getNavigationPoint(oracle.jdeveloper.audit.model.Location) and navigates to the navigation point it returns.java.lang.IllegalArgumentException - if the location is not of this model.public char getCharacter(int offset)
0 if no text is
 available. A read transaction must be active on this node. The
 ModelAdapter implementation returns 0.offset - The index of the character to return.ModelAccessError - if model content is inaccessible.public int getColumnOffset(int offset)
ModelAdapter
 implementation returns the character offset.ModelAccessError - if model content is inaccessible.public java.lang.Object getConstruct(Location location)
ModelAdapterimplementation traverses from the root using
 getContainedConstructs(java.lang.Object)and the Location.contains(oracle.jdeveloper.audit.model.Location)method.location - A location in this model.ModelAccessError - if model content is inaccessible.public java.lang.Object getConstruct(Location location, java.lang.Object parentConstruct)
 The ModelAdapter implementation traverses from the containing 
 construct using getContainedConstructs(java.lang.Object) and the Location.contains(oracle.jdeveloper.audit.model.Location) method.
location - A location contained within parentConstruct.parentConstruct - A construct of this model, obtained from getRoot() or getContainedConstructs(java.lang.Object)ModelAccessError - if the model is inaccessibile.public abstract java.util.Iterator getContainedConstructs(java.lang.Object construct)
Implementations must return an iterator which iterates the constructs in document order.
construct - A construct of this model, created by either
                  getRoot() or getContainedConstructs(java.lang.Object)ModelAccessError - if model content is inaccessible.public Dependency getDependency()
Dependency which tracks changes to this model. A read
 transaction may or may not be active on this model.
 
 The default ModelAdapter implementation returns a null dependency.
ModelAccessError - if model content is inaccessible.public abstract Location[] getElementLocations(Element element)
 Implementations need only deal with IDE element types that are returned
 by the getRootElementTypes and
 getContainedElementTypes methods
 of the model type for this model.
element - an IDE Element of a type supported by this model.ModelAccessError - if model content is inaccessible.public Location getFocusLocation(java.lang.Object construct, Location location)
ModelAdapter implementation returns the construct location. A
 read transaction must be active on this node.construct - a construct in this model, created by either
                  getRoot() or getContainedConstructs(java.lang.Object).location - the location of the construct.ModelAccessError - if model content is inaccessible.public Location getFocusLocation(Location location)
getFocusLocation(java.lang.Object, oracle.jdeveloper.audit.model.Location) implementation gets the whole location. A read
 transaction must be active on this node.location - a location in this model.ModelAccessError - if model content is inaccessible.public java.lang.String getLine(int offset)
ModelAdapter
 implementation returns null.offset - The index of a character in the line to return.ModelAccessError - if model content is inaccessible.public int getLineOffset(int offset)
0 if this model does not have lines and columns. A read
 transaction must be active on this node. The ModelAdapter
 implementation returns 0.ModelAccessError - if model content is inaccessible.public abstract Location getLocation(java.lang.Object construct)
 If the construct is the root construct, implementations must return getLocation(); otherwise implementations must extract offset and length
 from the construct to create a Location (typically with getLocation(int, int)).
construct - a construct in this model, created by either getRoot() or getContainedConstructs(java.lang.Object).ModelAccessError - if model content is inaccessible.public java.lang.Object getRoot()
ModelAdapter implementation throws
 ModelAccessError if the associated Element
 has been renamed, gets the root object using getRootHook(), and
 throws ModelAccessError if the returned object is null.ModelAccessError - if model content is inaccessible.public abstract java.lang.Object getRootHook()
                                      throws java.lang.Exception
getRoot() to get the root construct of
 this model. A read transaction must be active on this model.
 
 If an implementation cannot access its content and can provide a useful
 description of the cause, it should throw ModelAccessError with
 that localized description. Otherwise, it should return null, and getRoot() will probe the file and construct and throw the exception based 
 on its findings.java.lang.Exceptionpublic java.lang.String getText(int offset,
                                int length)
ModelAdapter implementation returns null.offset - The index of the first character to return.length - The number of characters to return.ModelAccessError - if model content is inaccessible.public java.net.URL getUrl(Location location)
ModelAdapter
 implementation returns the URL of the model.ModelAccessError - if model content is inaccessible.public abstract java.lang.Object getLabel(java.lang.Object construct)
Object, and Audit waits until
 the String is needed to invoke String.valueOf(Object) to get a
 string. Typically, implementations of this method do return a string, but
 the return type allows returning an object which defers expensive
 formatting to its toString() method. If necessary, the string
 should be localized.ModelAccessError - if model content is inaccessible.public abstract java.lang.Object getSummary(java.lang.Object construct)
Object, and Audit waits until
 the String is needed to invoke String.valueOf(Object) to get a
 string. Typically, implementations of this method do return a string, but
 the return type allows returning an object which defers expensive
 formatting to its toString() method. The string should be
 localized.ModelAccessError - if model content is inaccessible.public abstract javax.swing.Icon getIcon(java.lang.Object construct)
ModelAccessError - if model content is inaccessible.public java.lang.Object getLabel(Location location)
Object, and Audit waits until
 the String is needed to invoke String.valueOf(Object) to get a
 string. Typically, implementations of this method do return a string, but
 the return type allows returning an object which defers expensive
 formatting to its toString() method. If necessary, the string
 should be localized.ModelAccessError - if model content is inaccessible.public java.lang.Object getSummary(Location location)
Object, and Audit waits until
 the String is needed to invoke String.valueOf(Object) to get a
 string. Typically, implementations of this method do return a string, but
 the return type allows returning an object which defers expensive
 formatting to its toString() method. The string should be
 localized.ModelAccessError - if model content is inaccessible.public javax.swing.Icon getIcon(Location location)
ModelAccessError - if model content is inaccessible.public boolean equals(java.lang.Object object)
ModelFactory instances cannot be compared.equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic abstract int compareTo(ModelAdapter that)
ModelFactory instances cannot be compared.compareTo in interface java.lang.Comparable<ModelAdapter>that - The model to which to compare this model.java.lang.ClassCastException - if the object is not a ModelAdapter.protected static int compareSiblings(ModelAdapter d1, ModelAdapter d2)
public boolean contains(Location location)
location - The Location to test.public abstract boolean contains(ModelAdapter that)
that - The ModelAdapter to test.public boolean contains(java.lang.Object construct,
                        Location location)
ModelAdapter location returns true if the construct is
 this or the location returned for the construct by getLocation(Object) contains the construct
 (getLocation(construct).contains(location).
 
 Subclasses that can determine containment trivially for some constructs,
 or can extract offset and length directly from some constructs and so
 avoid the expense of creating a  object should override this
 method, delegating to super for any constructs they can't optimize. To
 determine containment of the location by an offset and length, use
 contains(int, int, Location) to ensure correct results for
 containment of an empty location.construct - The construct in this node to test.location - The Location to test.protected static final boolean contains(int offset1,
                                        int length1,
                                        Location location2)
contains(Object, Location). A location at 
 either range boundary that was created empty (as opposed to became empty 
 through deletion) is only contained if the containing range is itself 
 empty.protected java.lang.String getSecondaryCollationString()
ModelAdapter implementation returns
 URLFileSystem.getPlatformPathName(getURL()).public java.lang.String toString()
toString in class java.lang.Objectprotected final java.text.CollationKey getPrimaryCollationKey()
protected java.text.CollationKey getSecondaryCollationKey()
public ContainerModelAdapter getWorkspaceAdapter()
public ContainerModelAdapter getProjectAdapter()
public ContainerModelAdapter getDirectoryAdapter()
public FileModelAdapter getFileAdapter()
public abstract ContainerModelAdapter getContainingAdapter()
public void setAttribute(java.lang.Object key,
                         java.lang.Object value)
key - An object identifying the attribute to set.value - The possibly null new value of the attribute.getAttribute(java.lang.Object)public java.lang.Object getAttribute(java.lang.Object key)
key - An object identifying the attribute to get.public void release()
public java.lang.String contextDescription(Location location)
 The ModelAdapter implementation includes the file name and offsets 
 of the location.
public void enter(AuditContext context)
ModelAdapter implementation does nothing.context - The audit context for the root construct of this model.public void exit(AuditContext context)
OutOfMemoryError. Implementations should be written accordingly.
 
 Tbe default ModelAdapter implementation does nothing.context - The audit context for the root construct of this model.