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

E13403-04

oracle.jdeveloper.audit.transform
Class TransformAdapter

java.lang.Object
  extended by oracle.jdeveloper.audit.transform.TransformAdapter
Direct Known Subclasses:
JavaTransformAdapter, ProjectTransformAdapter, TextTransformAdapter

public abstract class TransformAdapter
extends java.lang.Object

An adapter between the Audit framework and transforms of a specific type. It allows the framework to create a transform context and to invoke type-specific setup and teardown code (e.g., for a model which requires that a transaction be created).


Nested Class Summary
 class TransformAdapter.ConstructRegion
           
 class TransformAdapter.LocationRegion
           
 class TransformAdapter.Region
           
 
Constructor Summary
TransformAdapter()
           
 
Method Summary
 void addHighlight(ModelAdapter model, java.lang.Object construct)
          Adds a highlight region for a construct in the model for this context.
 void addRemovedHighlight(ModelAdapter model, java.lang.Object construct)
          Adds a highlight region for an about-to-be-removed construct in the model for this context.
abstract  void beginTransform(TransformContext context)
          Begins a transform of this type.
 void beginTransform(TransformContext context, TransformSequenceContext sequenceContext)
          The default implementation simply calls beginTransform with the current transform context.
 void beginTransformSequence(TransformSequenceContext sequenceContext)
          Begins a transform sequence.
abstract  void cancelTransform(TransformContext context)
          Cancels a transform of this type.
 void cancelTransformSequence(TransformSequenceContext sequenceContext)
          Cancels a transform sequence of this type.
abstract  TransformContext createContext(Transform transform, Violation violation, Location location)
          Creates a context for a transform over a violation.
abstract  void endTransform(TransformContext context)
          Ends a transform of this type.
 void endTransformSequence(TransformSequenceContext sequenceContext)
          Ends a transform sequence.
abstract  java.lang.Class getContextClass()
          Gets the class of the context created by createContext(oracle.jdeveloper.audit.transform.Transform, oracle.jdeveloper.audit.service.Violation, oracle.jdeveloper.audit.model.Location).
 java.util.List getDeferredCommands()
          Gets the commands deferred by the apply method of a transform, or an empty list if none.
 java.util.Collection<Location> getHighlightRegions(TransformContext context)
          Gets the highlight regions set by the apply method of a transform for its model, or an empty list if none.
 Location getSelection()
          Gets the selection set by the apply method of a transform, or null if none.
 void invokeLater(Command command)
          Invokes a command after the command currently being executed by the Audit framework completes.
 void setPredecessorApplyData(TransformContext context, java.lang.Object applyData)
          Sets the predecessor apply data for a transform.
 void setSelection(Location location, int margin, int endMargin)
          Sets the selection to be set after a transform is applied.
 void setSelection(ModelAdapter model, java.lang.Object construct, int margin, int endMargin)
          Sets the selection to be set after a transform is applied.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransformAdapter

public TransformAdapter()
Method Detail

getContextClass

public abstract java.lang.Class getContextClass()
Gets the class of the context created by createContext(oracle.jdeveloper.audit.transform.Transform, oracle.jdeveloper.audit.service.Violation, oracle.jdeveloper.audit.model.Location).


createContext

public abstract TransformContext createContext(Transform transform,
                                               Violation violation,
                                               Location location)
Creates a context for a transform over a violation.


beginTransform

public abstract void beginTransform(TransformContext context)
                             throws java.lang.Exception
Begins a transform of this type. The framework ensures the following before invoking this method:

endTransform

public abstract void endTransform(TransformContext context)
                           throws java.lang.Exception
Ends a transform of this type. The framework ensures the following before invoking this method:

beginTransform

public void beginTransform(TransformContext context,
                           TransformSequenceContext sequenceContext)
                    throws java.lang.InterruptedException,
                           java.lang.Exception
The default implementation simply calls beginTransform with the current transform context. Subclasses that need support for transform sequences should therefore override this method.

Parameters:
context -
sequenceContext -
Throws:
java.lang.InterruptedException
java.lang.Exception

cancelTransform

public abstract void cancelTransform(TransformContext context)
                              throws java.lang.Exception
Cancels a transform of this type. The framework ensures the following before invoking this method:

setPredecessorApplyData

public void setPredecessorApplyData(TransformContext context,
                                    java.lang.Object applyData)
Sets the predecessor apply data for a transform. The framework invokes this method before invoking the second and subsequent apply methods in a multiple context transform.

Parameters:
context -
applyData -

beginTransformSequence

public void beginTransformSequence(TransformSequenceContext sequenceContext)
Begins a transform sequence. A transform sequence is a sequence of transforms which use the same TransformAdapter subclass and are applied in sequence to a single model. The sequence context is used to remember information about the state of the document, such as which imports were unused to begin with and which ones should be retained, in the case of Java files. The framework ensures the following before invoking this method:

endTransformSequence

public void endTransformSequence(TransformSequenceContext sequenceContext)
                          throws java.lang.Exception
Ends a transform sequence. Before invoking this method, the framework ensures that beginTransformSequence(oracle.jdeveloper.audit.transform.TransformSequenceContext) has been invoked and its preconditions still hold.

Parameters:
sequenceContext - A transform sequence context created by this adapter.
Throws:
java.lang.Exception

cancelTransformSequence

public void cancelTransformSequence(TransformSequenceContext sequenceContext)
                             throws java.lang.Exception
Cancels a transform sequence of this type. The framework ensures the following before invoking this method:

invokeLater

public void invokeLater(Command command)
Invokes a command after the command currently being executed by the Audit framework completes. This command is invoked inside a CommandProcessor batch command.


getDeferredCommands

public java.util.List getDeferredCommands()
Gets the commands deferred by the apply method of a transform, or an empty list if none. The framework invokes this method after successfully invoking endTransform(oracle.jdeveloper.audit.transform.TransformContext) and invokes the commands returned in order.

Returns:
a List of Commands.

setSelection

public void setSelection(ModelAdapter model,
                         java.lang.Object construct,
                         int margin,
                         int endMargin)
Sets the selection to be set after a transform is applied. Transforms invoke this method indirectly by invoking TransformContext.setSelection(java.lang.Object, int, int).

Parameters:
model - The model containing the construct to select.
construct - The construct at which to place the caret.
margin - Margin from start of construct to start of selection.
endMargin - Margin from end of construct to end of selection.

setSelection

public void setSelection(Location location,
                         int margin,
                         int endMargin)
Sets the selection to be set after a transform is applied. Transforms invoke this method indirectly by invoking TransformContext.setSelection(java.lang.Object, int, int).

Parameters:
location - The location to select.
margin - Margin from start of construct to start of selection.
endMargin - Margin from end of construct to end of selection.

getSelection

public Location getSelection()
Gets the selection set by the apply method of a transform, or null if none. The framework invokes this method after successfully invoking endTransform(oracle.jdeveloper.audit.transform.TransformContext).

Returns:
a Location of length 0.

addHighlight

public void addHighlight(ModelAdapter model,
                         java.lang.Object construct)
Adds a highlight region for a construct in the model for this context.

Parameters:
construct - The construct to highlight.

addRemovedHighlight

public void addRemovedHighlight(ModelAdapter model,
                                java.lang.Object construct)
Adds a highlight region for an about-to-be-removed construct in the model for this context.

Parameters:
construct - The construct to be removed.

getHighlightRegions

public java.util.Collection<Location> getHighlightRegions(TransformContext context)
Gets the highlight regions set by the apply method of a transform for its model, or an empty list if none. The framework invokes this method after successfully invoking endTransform(oracle.jdeveloper.audit.transform.TransformContext).

Parameters:
context - A transform context created by this adapter.
Returns:
a Collection of {#link Location}s.

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

E13403-04

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