Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.0)

E13403-08

oracle.jdeveloper.audit.model
Class ModelAdapter

java.lang.Object
  extended by oracle.jdeveloper.audit.model.ModelAdapter
All Implemented Interfaces:
java.lang.Comparable, Located
Direct Known Subclasses:
ContainerModelAdapter, FileModelAdapter

public abstract class ModelAdapter
extends java.lang.Object
implements java.lang.Comparable, Located

An abstract adapter between the Audit framework and the object model associated with a particular IDE 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 tied to text nodes.

The IDE allows nodes and their object models to be accessed from multiple threads, and requires various sorts of locking protocols to ensure correctness. ModelAdapter exposes this to the Audit framework as two kinds of transactions: read and write. The Audit framework always accesses constructs inside a read transaction, and applies transforms inside a write transaction. The default implementations of the locking methods are empty.

The default implementations supplied in this class assume that workspace, project, and URL are not null. To reduce special case code in the Audit framework, however, root, workspace, project, and package ModelAdapter subclasses are provided in the framework which may have null workspace, project, package, or node. These subclasses override the default implementations.

See Also:
ModelType, ContainerModelAdapter, FileModelAdapter, TextFileModelAdapter

Field Summary
protected  int index
           
protected static Log log
           
 
Constructor Summary
protected ModelAdapter(ModelFactory factory, ModelType type)
          Creates a model adapter that adapts a root Workspaces element.
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 package directory node.
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)
          Creates a model adapter that adapts a @link oracle.ide.model.Project Project} node.
protected ModelAdapter(ModelFactory factory, ModelType type, Workspace workspace)
          Creates a model adapter that adapts a @link oracle.ide.model.Workspace Workspace} node.
 
Method Summary
protected  boolean acquireReadLock(WriteLockRequestListener listener)
          Acquires a read lock for this model.
 void beginRead()
          Begins a read transaction on this model for the current thread.
 boolean beginRead(WriteLockRequestListener listener)
          Begins a preemptable read transaction on this model for the current thread.
protected  void beginReadHook()
          A subclass hook invoked by beginRead() after it invokes acquireReadLock(oracle.javatools.buffer.WriteLockRequestListener).
 void cancelRead()
          Cancels any read transaction for any thread on this model.
protected static int compareSiblings(ModelAdapter d1, ModelAdapter d2)
           
abstract  int compareTo(java.lang.Object object)
          Gets whether this model is less than, equal to, or greater than another using the natural order defined by this class.
 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.
 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(WriteLockRequestListener listener)
          Ends the preemptable read transaction on this model for the current thread.
protected  void endReadHook()
          A subclass hook invoked by endRead() before it invokes releaseReadLock(oracle.javatools.buffer.WriteLockRequestListener).
 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 adapter.
 FileModelAdapter getFileAdapter()
          Gets the model adapter for the file containing this model, or null if this is a root, workspace, project, or package 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.
 Context getIdeContext()
          Creates an IDE context for this model.
 int getInitialLength()
          Gets the initial length 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()
           
 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.
abstract  java.lang.Object getRoot()
          Gets 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 getText(int offset, int length)
          Gets text from this model, or null if no text is available.
 ModelType getType()
          Gets the model type for this node.
abstract  java.net.URL getUrl()
          Gets the non-null URL corresponding to this model.
 java.net.URL getURL()
          Deprecated. use getUrl()
 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.
 javax.swing.Icon icon(Location location)
          Gets the icon for a location of this model.
abstract  javax.swing.Icon icon(java.lang.Object construct)
          Gets the icon for a construct of this model.
 boolean isEditable(Location location)
          Gets whether a location in this model is editable.
abstract  boolean isFile()
          Gets whether this model represents a "file".
 boolean isModifiable()
          Gets whether this model is modifiable.
 boolean isModified()
          Gets whether this model has been modified since this model adapter was created.
 boolean isModified(Location location)
          Gets whether a region of this model has been modified since this model adapter was created.
 java.lang.Object label(Location location)
          Gets the label for a location of this model.
abstract  java.lang.Object label(java.lang.Object construct)
          Gets the label for a construct of this model.
 void release()
          Releases resources used by 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.Object summary(Location location)
          Gets the summary for a location of this model.
abstract  java.lang.Object summary(java.lang.Object construct)
          Gets the summary for a construct of this model.
 java.lang.String toString()
           
 void verifyReadTransaction()
          Verifies that a read transaction is in progress for this model.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static final Log log

index

protected int index
Constructor Detail

ModelAdapter

protected ModelAdapter(ModelFactory factory,
                       ModelType type)
Creates a model adapter that adapts a root Workspaces element.


ModelAdapter

protected ModelAdapter(ModelFactory factory,
                       ModelType type,
                       Workspace workspace)
Creates a model adapter that adapts a @link oracle.ide.model.Workspace Workspace} node.


ModelAdapter

protected ModelAdapter(ModelFactory factory,
                       ModelType type,
                       ContainerModelAdapter workspace,
                       Project project)
Creates a model adapter that adapts a @link oracle.ide.model.Project Project} node.


ModelAdapter

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 package directory node. The folder will be null if the package was not created from a navigator selection (in particular, was created by a Project model adapter).


ModelAdapter

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.


ModelAdapter

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.

Method Detail

getDirectory

public ContentDirectory getDirectory()
Gets the package directory containing this model, or null if none.


getElement

public Element getElement()
Gets the IDE Element corresponding to this model, or null if none. Packages in particular often do not have an element.


getEndLocation

public Location getEndLocation()
Gets a location greater than any location in this model.


getFactory

public final ModelFactory getFactory()
Gets the factory for this model adapter.


getIdeContext

public Context getIdeContext()
Creates an IDE context for this model.


getInitialLength

public int getInitialLength()
Gets the initial length of this model. Gets Integer.MAX_VALUE if this node has not been opened. The default ModelAdapter implementation returns Integer.MAX_VALUE.


getLocation

public Location getLocation()
Gets a location less than or equal to any location in this model. Because longer locations sort before shorter locations with the same offset, the location returned encompasses the whole node.

Specified by:
getLocation in interface Located

getLocation

public Location getLocation(int offset,
                            int length)
Gets a location in this model.


getNode

public 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).


getProject

public Project getProject()
Gets the project containing this model.


getShortLabel

public java.lang.String getShortLabel()
Gets a short label for this model.


getType

public final ModelType getType()
Gets the model type for this node.


getUrl

public abstract java.net.URL getUrl()
Gets the non-null URL corresponding to this model.


getURL

public final java.net.URL getURL()
Deprecated. use getUrl()

Gets the non-null URL corresponding to this model.


getWorkspace

public Workspace getWorkspace()
Gets the workspace containing this model.


isFile

public abstract boolean isFile()
Gets whether this model represents a "file".


isModifiable

public boolean isModifiable()
Gets whether this model is modifiable. The default ModelAdapter implementation returns false.


isModified

public boolean isModified()
Gets whether this model has been modified since this model adapter was created. Note that this indicates nothing about whether this model is modified relative to its representation on disk.


isModified

public boolean isModified(Location location)
Gets whether a region of this model has been modified since this model adapter was created. Note that this indicates nothing about whether this region is modified relative to its representation on disk.


beginRead

public final void beginRead()
Begins a read transaction on this model for the current thread. No read transaction for this model should be active on the current thread.

The ModelAdapter implementation delegates to acquireReadLock(oracle.javatools.buffer.WriteLockRequestListener) to acquire locks, and delegates to beginReadHook() to allow subclasses to initialize transaction state.


beginRead

public final boolean beginRead(WriteLockRequestListener listener)
Begins a preemptable read transaction on this model for the current thread. No read transaction for this model should be active on the current thread.

The ModelAdapter implementation delegates to acquireReadLock(oracle.javatools.buffer.WriteLockRequestListener) to acquire locks and to add the listener, and delegates to beginReadHook() to allow subclasses to initialize transaction state.

Parameters:
listener - The listener to notify if a thread waits to acquire the write lock, or null if read transaction is not preemptable.
Returns:
whether other threads are already waiting for the write lock; always false if listener is null.

endRead

public final void endRead()
Ends the read transaction on this model for the current thread. No write transaction should be active for this model, and a read transaction for this model should be active on the current thread.

endRead() delegates to endReadHook() to allow subclasses to finalize transaction state, and delegates to releaseReadLock(oracle.javatools.buffer.WriteLockRequestListener) to release locks.


endRead

public final void endRead(WriteLockRequestListener listener)
Ends the preemptable read transaction on this model for the current thread. No write transaction should be active for this model, and a read transaction for this model should be active on the current thread.

endRead() delegates to endReadHook() to allow subclasses to finalize transaction state, and delegates to releaseReadLock(oracle.javatools.buffer.WriteLockRequestListener) to release locks and remove the listener.

Parameters:
listener - The listener to be notified if a thread waits to acquire a write lock, or null. Must be the same as given to the corresponding beginRead().

cancelRead

public void cancelRead()
Cancels any read transaction for any thread on this model. The ModelAdapter implementation does nothing.


acquireReadLock

protected boolean acquireReadLock(WriteLockRequestListener listener)
Acquires a read lock for this model. Invoked by beginRead() with no read transaction for this model active on the current thread. The client is assumed to be preemptable if it supplies the listener argument; non-preemptable if not. The default ModelAdapter implementation does nothing.

Parameters:
listener - The listener to notify if a thread waits to acquire the write lock, or null.
Returns:
whether other threads are already waiting for the write lock; always false if listener is null.

releaseReadLock

protected void releaseReadLock(WriteLockRequestListener listener)
Releases a read lock for this model. Invoked by 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.

Parameters:
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().

beginReadHook

protected void beginReadHook()
A subclass hook invoked by beginRead() after it invokes acquireReadLock(oracle.javatools.buffer.WriteLockRequestListener). The default ModelAdapter implementation does nothing.


endReadHook

protected void endReadHook()
A subclass hook invoked by endRead() before it invokes releaseReadLock(oracle.javatools.buffer.WriteLockRequestListener). The default ModelAdapter implementation does nothing.


getLock

protected ReadWriteLock getLock()

verifyReadTransaction

public final void verifyReadTransaction()
Verifies that a read transaction is in progress for this model. The ModelAdapter implementation normally does nothing.


isEditable

public boolean isEditable(Location location)
Gets whether a location in this model is editable. The default ModelAdapter implementation returns false.


edit

public boolean edit(Location location)
Edits a location in this model using an editor suitable for the model and location. The default ModelAdapter implementation does nothing and returns false.


getCharacter

public char getCharacter(int offset)
Gets a character from this model, or 0 if no text is available. A read transaction must be active on this node. The ModelAdapter implementation returns 0.

Parameters:
offset - The index of the character to return.

getColumnOffset

public 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. A read transaction must be active on this model. The ModelAdapter implementation returns the character offset.


getConstruct

public java.lang.Object getConstruct(Location location)
Gets the innermost construct containing a location in this model. The location must be in this model and a read transaction must be active on this model. The ModelAdapter implementation traverses from the root using getContainedConstructs(java.lang.Object) and the Location.contains(oracle.jdeveloper.audit.model.Location) method.

Parameters:
location - A location in this model.
Returns:
The innermost construct containing the location.

getConstruct

public java.lang.Object getConstruct(Location location,
                                     java.lang.Object parentConstruct)
Gets the outermost construct containing a location within a specified construct in this model. The location and the containing construct must be in this model, the location must be in the containing construct, and a read transaction must be active on this model.

The ModelAdapter implementation traverses from the containing construct using getContainedConstructs(java.lang.Object) and the Location.contains(oracle.jdeveloper.audit.model.Location) method.

Parameters:
location - A location contained within parentConstruct.
parentConstruct - A construct of this model, created by either getRoot() or getContainedConstructs(java.lang.Object)

getContainedConstructs

public abstract java.util.Iterator getContainedConstructs(java.lang.Object construct)
Gets the constructs contained by a construct in this model. A read transacton must be active on this model.

Implementations must return an iterator which iterates the constructs in document order.

Parameters:
construct - A construct of this model, created by either getRoot() or getContainedConstructs(java.lang.Object)
Returns:
An iterator over the constructs contained by the construct.

getDependency

public Dependency getDependency()
Gets a Dependency which tracks changes to this model. The default ModelAdapter implementation returns a null dependency.


getElementLocations

public abstract Location[] getElementLocations(Element element)
Gets the locations of the constructs in this model corresponding to an IDE element. A read transaction must be active on this model.

Implementations need only deal with IDE element types that are returned by the getRootElementTypes and getContainedElementTypes methods of the model type for this model.

Parameters:
element - an IDE Element of a type supported by this model.
Returns:
the locations corresponding to the element, or null or an empty array if none.

getFocusLocation

public Location getFocusLocation(java.lang.Object construct,
                                 Location location)
Gets the focus location for a construct in this model. This is a location within the construct location which should be highlighted. The default ModelAdapter implementation returns the construct location. A read transaction must be active on this node.

Parameters:
construct - a construct in this model, created by either getRoot() or getContainedConstructs(java.lang.Object).
location - the location of the construct.

getFocusLocation

public Location getFocusLocation(Location location)
Gets the focus location for a location in this model. This is a region within the location which should be highlighted. The default getFocusLocation(java.lang.Object, oracle.jdeveloper.audit.model.Location) implementation gets the whole location. A read transaction must be active on this node.

Parameters:
location - a location in this model.

getLine

public java.lang.String getLine(int offset)
Gets a line of text from this model, or null if no text is available. A read transaction must be active on this node. The ModelAdapter implementation returns null.

Parameters:
offset - The index of a character in the line to return.

getLineOffset

public 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. A read transaction must be active on this node. The ModelAdapter implementation returns 0.


getLocation

public 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. A read transaction must be active on this model.

Implementations must extract offset and length from the construct to create a Location.

Parameters:
construct - a construct in this model, created by either getRoot() or getContainedConstructs(java.lang.Object).

getRoot

public abstract java.lang.Object getRoot()
Gets the root construct of this model. A read transaction must be active on this model.


getText

public java.lang.String getText(int offset,
                                int length)
Gets text from this model, or null if no text is available. A read transaction must be active on this node. The ModelAdapter implementation returns null.

Parameters:
offset - The index of the first character to return.
length - The number of characters to return.

equals

public boolean equals(java.lang.Object object)
Gets whether this model is equal to an object. Model adapters created by different ModelFactory instances cannot be compared.

Overrides:
equals in class java.lang.Object

compareTo

public abstract int compareTo(java.lang.Object object)
Gets whether this model is less than, equal to, or greater than another using the natural order defined by this class. Model adapters created by different ModelFactory instances cannot be compared.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
object - The node with which to compare this node.
Throws:
java.lang.ClassCastException - if the object is not a ModelAdapter.

compareSiblings

protected static int compareSiblings(ModelAdapter d1,
                                     ModelAdapter d2)

contains

public boolean contains(Location location)
Gets whether this model contains a location.

Parameters:
location - The Location to test.

contains

public abstract boolean contains(ModelAdapter that)
Gets whether this model contains a model.

Parameters:
that - The ModelAdapter to test.

contains

public boolean contains(java.lang.Object construct,
                        Location location)
Gets whether a construct in this model contains a location.

Parameters:
construct - The construct in this node to test.
location - The Location to test.

getSecondaryCollationString

protected java.lang.String getSecondaryCollationString()
Gets the long string used to sort two model adapters when their short strings are equal. The default ModelAdapter implementation returns URLFileSystem.getPlatformPathName(getURL()).

Returns:
a string that uniquely identifies this node.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getPrimaryCollationKey

protected final java.text.CollationKey getPrimaryCollationKey()

getSecondaryCollationKey

protected java.text.CollationKey getSecondaryCollationKey()

getWorkspaceAdapter

public ContainerModelAdapter getWorkspaceAdapter()
Gets the model adapter for the workspace of this node, or null if this is a root model.


getProjectAdapter

public ContainerModelAdapter getProjectAdapter()
Gets the model adapter for the project containing this model, or null if this is root or workspace model.


getDirectoryAdapter

public ContainerModelAdapter getDirectoryAdapter()
Gets the model adapter for the directory containing this model, or null if this is a root, workspace, or project model.


getFileAdapter

public FileModelAdapter getFileAdapter()
Gets the model adapter for the file containing this model, or null if this is a root, workspace, project, or package model.


getContainingAdapter

public abstract ContainerModelAdapter getContainingAdapter()
Gets the model adapter containing this model adapter, or null if this is the root node.


label

public abstract java.lang.Object label(java.lang.Object construct)
Gets the label for a construct of this model. Note that the return type is Object, and Audit uses String.valueOf(Object) to get a string. Typically, implementations of this method will return a string, but the return type allows an implementation to return an object which defers expensive formatting to its toString() method. If necessary, the label should be localized.


summary

public abstract java.lang.Object summary(java.lang.Object construct)
Gets the summary for a construct of this model. The summary will be used, for example, as the tool tip text if the construct appears as a row in an Audit report. Note that the return type is Object, and Audit uses String.valueOf(Object) to get a string. Typically, implementations of this method will return a string, but the return type allows an implementation to return an object which defers expensive formatting to its toString() method. The summary should be localized.


icon

public abstract javax.swing.Icon icon(java.lang.Object construct)
Gets the icon for a construct of this model. If necessary, the icon should be localized.


label

public java.lang.Object label(Location location)
Gets the label for a location of this model. Note that the return type is Object, and Audit uses String.valueOf(Object) to get a string. Typically, implementations of this method will return a string, but the return type allows an implementation to return an object which defers expensive formatting to its toString() method. If necessary, the label should be localized.


summary

public java.lang.Object summary(Location location)
Gets the summary for a location of this model. The summary will be used, for example, as the tool tip text if the construct appears as a row in an Audit report. Note that the return type is Object, and Audit uses String.valueOf(Object) to get a string. Typically, implementations of this method will return a string, but the return type allows an implementation to return an object which defers expensive formatting to its toString() method. The summary should be localized.


icon

public javax.swing.Icon icon(Location location)
Gets the icon for a location of this model. If necessary, the icon should be localized.


setAttribute

public void setAttribute(java.lang.Object key,
                         java.lang.Object value)
Sets the value of an attribute in this model.

Parameters:
key - An object identifying the attribute to set.
value - The possibly null new value of the attribute.
See Also:
getAttribute(java.lang.Object)

getAttribute

public java.lang.Object getAttribute(java.lang.Object key)
Gets the value of an attribute in this model, or null if none.

Parameters:
key - An object identifying the attribute to get.
Returns:
The value of the attribute, or null if none.

release

public void release()
Releases resources used by this model.


contextDescription

public java.lang.String contextDescription(Location location)
Gets a description of a location of this model.

The ModelAdapter implementation includes the file name and offsets of the location.


enter

public void enter(AuditContext context)
Invoked as an auditor traversal enters this model. The auditor invokes this method after acquiring the read lock and getting the root construct and before invoking any analyzer enter methods for the root construct.

Parameters:
context - The audit context for the root construct of this model.

exit

public void exit(AuditContext context)
Invoked as an auditor traversal exits this model. The auditor invokes this method after invoking any analyzer exit methods for the root construct and before releasing the read lock.

Parameters:
context - The audit context for the root construct of this model.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.0)

E13403-08

Copyright © 1997, 2013, Oracle. All rights reserved.