Skip navigation links

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

E52944-01


oracle.jdeveloper.audit.model
Class ContainerModelAdapter

java.lang.Object
  extended by oracle.jdeveloper.audit.model.ModelAdapter
      extended by oracle.jdeveloper.audit.model.ContainerModelAdapter

All Implemented Interfaces:
java.lang.Comparable, Located
Direct Known Subclasses:
DirectoryModelAdapter, ProjectModelAdapter, RootModelAdapter, WorkspaceModelAdapter

public abstract class ContainerModelAdapter
extends ModelAdapter

An abstract ModelAdapter which adapts an Element which contains elements.

See Also:
ModelAdapter

Constructor Summary
protected ContainerModelAdapter(ModelFactory factory, ModelType type, ContainerModelAdapter workspace, ContainerModelAdapter project, ContainerModelAdapter directory, ContentDirectory element, java.net.URL url)
           
protected ContainerModelAdapter(ModelFactory factory, ModelType type, ContainerModelAdapter workspace, Project project)
           
protected ContainerModelAdapter(ModelFactory factory, ModelType type, Workspace workspace)
           
protected ContainerModelAdapter(ModelFactory factory, ModelType type, Workspaces applications)
           

 

Method Summary
protected  void addContainedElement(Element element, java.net.URL url)
          Gets the models for an element contained by the root construct of this model, and adds them to the models contained by this model.
 boolean addContainedModel(ModelAdapter model)
          Adds a model to the set contained by this model.
 void addEmbeddedModel(ModelAdapter embeddedModel, ModelAdapter baseModel)
          Adds an embedded model to the set contained by this model.
protected abstract  void collectContainedElements()
          Collects the contained Elements of the root construct.
 java.lang.Object getConstruct(Location location)
          Gets the innermost construct containing a location in this model.
 java.util.Iterator getContainedConstructs(java.lang.Object construct)
          Gets the constructs contained by a construct in this model.
 java.util.Iterator<Element> getContainedUnauditableElements()
          Gets the unauditable elements contained by the root construct of this model.
 Location[] getElementLocations(Element element)
          Gets the locations of the constructs in this model corresponding to an IDE element.
 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 getRoot()
          Gets the root construct of this model.
 boolean isFile()
          Gets whether this model represents a "file".

 

Methods inherited from class oracle.jdeveloper.audit.model.ModelAdapter
acquireReadLock, beginRead, beginRead, beginReadHook, cancelRead, compareSiblings, compareTo, contains, contains, contains, contains, contextDescription, edit, endRead, endRead, endReadHook, enter, equals, exit, getAttribute, getCharacter, getColumnOffset, getConstruct, getContainingAdapter, getDependency, getDirectory, getDirectoryAdapter, getElement, getEndLocation, getFactory, getFileAdapter, getFocusLocation, getFocusLocation, getIdeContext, getInitialLength, getLine, getLineOffset, getLocation, getLocation, getLock, getNode, getPrimaryCollationKey, getProject, getProjectAdapter, getSecondaryCollationKey, getSecondaryCollationString, getShortLabel, getText, getType, getUrl, getURL, getWorkspace, getWorkspaceAdapter, hashCode, icon, icon, isEditable, isModifiable, isModified, isModified, isReadLockHeld, isWriteLockHeld, label, label, release, releaseReadLock, setAttribute, summary, summary, toString, verifyReadTransaction

 

Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

 

Constructor Detail

ContainerModelAdapter

protected ContainerModelAdapter(ModelFactory factory,
                                ModelType type,
                                Workspaces applications)

ContainerModelAdapter

protected ContainerModelAdapter(ModelFactory factory,
                                ModelType type,
                                Workspace workspace)

ContainerModelAdapter

protected ContainerModelAdapter(ModelFactory factory,
                                ModelType type,
                                ContainerModelAdapter workspace,
                                Project project)

ContainerModelAdapter

protected ContainerModelAdapter(ModelFactory factory,
                                ModelType type,
                                ContainerModelAdapter workspace,
                                ContainerModelAdapter project,
                                ContainerModelAdapter directory,
                                ContentDirectory element,
                                java.net.URL url)

Method Detail

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.

getRoot

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

The default ContainerModelAdapter implementation returns the Element corresponding to this model.

Specified by:
getRoot in class ModelAdapter
Returns:

isFile

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

The default ContainerModelAdapter implementation returns false.

Specified by:
isFile in class ModelAdapter

addContainedModel

public boolean addContainedModel(ModelAdapter model)
Adds a model to the set contained by this model.
Parameters:
model - An adapter for a model contained by the root construct of this model.

getContainedConstructs

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

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

The default ContainerModelAdapter implementation requires that the construct be the root construct of this model and returns an iterator over the model adapters contained by this model adapter. On first invocation, it invokes collectContainedElements() unless the Audit framework has already invoked addContainedModel at least once to configure a subset.

Implementations must return an iterator which iterates the model adapters in their natural order.

Specified by:
getContainedConstructs in class ModelAdapter
Parameters:
construct - The root construct of this model.
Returns:
An iterator over model adapters for the elements contained by the root construct of this model.

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.

If the construct is the root construct, implementations must return ModelAdapter.getLocation(); otherwise implementations must extract offset and length from the construct to create a Location (typically with ModelAdapter.getLocation(int, int)).

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

getConstruct

public java.lang.Object getConstruct(Location location)
Description copied from class: ModelAdapter
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 ModelAdapter.getContainedConstructs(java.lang.Object) and the Location.contains(oracle.jdeveloper.audit.model.Location) method.
Overrides:
getConstruct in class ModelAdapter
Parameters:
location - A location in this model.
Returns:
The innermost construct containing the location.

getContainedUnauditableElements

public java.util.Iterator<Element> getContainedUnauditableElements()
Gets the unauditable elements contained by the root construct of this model.

collectContainedElements

protected abstract void collectContainedElements()
Collects the contained Elements of the root construct. Implementations must call addContainedElement(oracle.ide.model.Element, java.net.URL) for each contained element. This method is invoked by the first invocation of getContainedConstructs(java.lang.Object) or #getContainedUnauditableElements, unless {@link #addContainedModel} has already been invoked.

The Audit framework invokes this method with a read transaction active on this model.

Parameters:
construct - The root construct of this model.

addContainedElement

protected void addContainedElement(Element element,
                                   java.net.URL url)
Gets the models for an element contained by the root construct of this model, and adds them to the models contained by this model.

This method should only be invoked from subclass collectContainedElements() methods.

Parameters:
element - An element contained by the root construct of this model.
url - The URL of the element, null to extract from element.

addEmbeddedModel

public void addEmbeddedModel(ModelAdapter embeddedModel,
                             ModelAdapter baseModel)
Adds an embedded model to the set contained by this model.
Parameters:
embeddedModel - An adapter for an embedded model created from a model already contained by this model.
baseModel - The base model for the embedded model, contained by this model.

Skip navigation links

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

E52944-01


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