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

E13403-03

oracle.jdeveloper.audit.java
Class JavaSourceModelAdapter

java.lang.Object
  extended by oracle.jdeveloper.audit.model.ModelAdapter
      extended by oracle.jdeveloper.audit.model.FileModelAdapter
          extended by oracle.jdeveloper.audit.model.TextFileModelAdapter
              extended by oracle.jdeveloper.audit.java.JavaSourceModelAdapter
All Implemented Interfaces:
java.lang.Comparable, Located

public class JavaSourceModelAdapter
extends TextFileModelAdapter

A ModelAdapter which adapts the Audit framework to the model of a JavaSourceNode.


Field Summary
 
Fields inherited from class oracle.jdeveloper.audit.model.ModelAdapter
index, log
 
Method Summary
protected  void beginReadHook()
          A subclass hook invoked by ModelAdapter.beginRead() after it invokes ModelAdapter.acquireReadLock(oracle.javatools.buffer.WriteLockRequestListener).
 void cancelRead()
          Cancels any read transaction for any thread on this model.
 boolean contains(java.lang.Object construct, Location location)
          Gets whether a construct in this model contains a location.
protected  void endReadHook()
          A subclass hook invoked by ModelAdapter.endRead() before it invokes ModelAdapter.releaseReadLock(oracle.javatools.buffer.WriteLockRequestListener).
 java.util.Iterator getContainedConstructs(java.lang.Object construct)
          Gets the constructs contained by a construct in this model.
 Location[] getElementLocations(Element element)
          Gets the locations of the constructs in this model corresponding to an IDE element.
 Location getFocusLocation(java.lang.Object construct, Location location)
          Gets the focus location for a construct in this model.
 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.
 java.lang.Object getRootImplementation()
           
 javax.swing.Icon icon(Location location)
          Gets the icon for a location of this model.
 javax.swing.Icon icon(java.lang.Object construct)
          Gets the icon for a construct of this model.
 java.lang.Object label(Location location)
          Gets the label for a location of this model.
 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.
 java.lang.Object summary(Location location)
          Gets the summary for a location of this model.
 java.lang.Object summary(java.lang.Object construct)
          Gets the summary for a construct of this model.
 
Methods inherited from class oracle.jdeveloper.audit.model.TextFileModelAdapter
acquireReadLock, contextDescription, edit, getCharacter, getColumnOffset, getDeltaLength, getDeltaOffset, getFocusLocation, getInitialLength, getLine, getLineOffset, getLocation, getRoot, getText, getTextBuffer, getTextNode, isEditable, isModifiable, isModified, isModified, releaseReadLock
 
Methods inherited from class oracle.jdeveloper.audit.model.FileModelAdapter
compareTo, contains, getContainingAdapter, getDependency, getFileAdapter, getUrl, isFile
 
Methods inherited from class oracle.jdeveloper.audit.model.ModelAdapter
beginRead, beginRead, compareSiblings, contains, endRead, endRead, equals, getAttribute, getConstruct, getConstruct, getDirectory, getDirectoryAdapter, getElement, getEndLocation, getFactory, getIdeContext, getLocation, getLock, getNode, getPrimaryCollationKey, getProject, getProjectAdapter, getSecondaryCollationKey, getSecondaryCollationString, getShortLabel, getType, getURL, getWorkspace, getWorkspaceAdapter, setAttribute, toString, verifyReadTransaction
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

beginReadHook

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

The TextFileModelAdapter implementation pins the text buffer for use during the read transaction. Subclasses should not invoke this method from inside a synchronized block, on peril of deadlock!

Overrides:
beginReadHook in class TextFileModelAdapter
See Also:
ModelAdapter.beginRead(), TextFileModelAdapter.endReadHook()

endReadHook

protected void endReadHook()
Description copied from class: TextFileModelAdapter
A subclass hook invoked by ModelAdapter.endRead() before it invokes ModelAdapter.releaseReadLock(oracle.javatools.buffer.WriteLockRequestListener). The default ModelAdapter implementation does nothing. The TextFileModelAdapter implementation unpins the text buffer.

Overrides:
endReadHook in class TextFileModelAdapter
See Also:
ModelAdapter.endRead(), TextFileModelAdapter.beginReadHook()

cancelRead

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

Overrides:
cancelRead in class ModelAdapter

getRootImplementation

public java.lang.Object getRootImplementation()
Specified by:
getRootImplementation in class TextFileModelAdapter

getElementLocations

public Location[] getElementLocations(Element element)
Description copied from class: ModelAdapter
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.

Specified by:
getElementLocations in class ModelAdapter
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.

getLocation

public Location getLocation(java.lang.Object construct)
Description copied from class: ModelAdapter
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.

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

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.

The JavaSourceModelAdapter implementation narrows the focus location for some constructs:

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

getContainedConstructs

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

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

contains

public boolean contains(java.lang.Object construct,
                        Location location)
Description copied from class: ModelAdapter
Gets whether a construct in this model contains a location.

Overrides:
contains in class ModelAdapter
Parameters:
construct - The construct in this node to test.
location - The Location to test.

release

public void release()
Description copied from class: ModelAdapter
Releases resources used by this model.

Overrides:
release in class TextFileModelAdapter

label

public java.lang.Object label(java.lang.Object construct)
Description copied from class: ModelAdapter
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.

Specified by:
label in class ModelAdapter

summary

public java.lang.Object summary(java.lang.Object construct)
Description copied from class: ModelAdapter
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.

Specified by:
summary in class ModelAdapter

icon

public javax.swing.Icon icon(java.lang.Object construct)
Description copied from class: ModelAdapter
Gets the icon for a construct of this model. If necessary, the icon should be localized.

Specified by:
icon in class ModelAdapter

label

public java.lang.Object label(Location location)
Description copied from class: ModelAdapter
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.

Overrides:
label in class ModelAdapter

summary

public java.lang.Object summary(Location location)
Description copied from class: ModelAdapter
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.

Overrides:
summary in class ModelAdapter

icon

public javax.swing.Icon icon(Location location)
Description copied from class: ModelAdapter
Gets the icon for a location of this model. If necessary, the icon should be localized.

Overrides:
icon in class ModelAdapter

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

E13403-03

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