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

E13403-07

oracle.jdeveloper.audit.transform
Class TransformContext

java.lang.Object
  extended by oracle.jdeveloper.audit.transform.TransformContext
All Implemented Interfaces:
Violation
Direct Known Subclasses:
JavaTransformContext, NullTransformContext, ProjectTransformContext, TextTransformContext

public class TransformContext
extends java.lang.Object
implements Violation

A context in which a Transform can be applied to a Violation. Contexts are created by the Audit framework when it needs to invoke transform methods, and discarded immediately after use. A context has properties derived from the violation: in particular, rule, location, and parameters. The location can be set differently than the location of the violation, though typically it will at least be a related location of the violation.

See Also:
Violation, Transform

Constructor Summary
TransformContext(TransformAdapter adapter, Transform transform, Violation violation, Location location)
          Creates a transform context for a transform to be applied to a violation.
 
Method Summary
 void addHighlight(java.lang.Object construct)
          Adds a highlight region for a construct in the model for this context.
 void addRemovedHighlight(java.lang.Object construct)
          Adds a highlight region for an about-to-be-removed construct in the model for this context.
 TransformAdapter getAdapter()
          Gets the transform adapter for the transform of this context.
 java.lang.Object getAttribute(java.lang.String name)
          Gets the value of an attribute.
 Transform getDefaultTransform()
          Gets the default transform of this violation, or null if none.
 Location getFocusLocation()
          Gets the focus location of the violation, or null if none.
 Context getIdeContext()
          Gets an IDE context in which this transform is being applied.
 Location getLocation()
          Gets the location to be transformed.
 ModelAdapter getModel()
          Gets the model to be transformed.
 ModelAdapter getModelAdapter()
          Deprecated. use getModel()
 Node getNode()
          Gets the node to be transformed.
 java.lang.Object getParameter(java.lang.String name)
          Gets the value of a parameter added to the violation or a property of the transform, or null if none.
 int getParameterCount()
          Gets the number of parameters of this violation.
 java.lang.String getParameterName(int index)
          Gets the name of a parameter of this violation.
 java.lang.Object getParameterValue(int index)
          Gets the value of a parameter of this violation.
 java.lang.Object getParameterValue(java.lang.String name)
          Gets the value of a parameter of this violation by name.
 java.lang.Object getPredecessorApplyData()
          Gets the data that was returned by the apply method of the immediate predecessor in a multiple context transform.
 Project getProject()
          Gets the project containing the model to be transformed.
 Rule getRule()
          Gets the rule violated by this violation.
 int getSerialNumber()
          Gets the serial number of this violation.
 Transform getTransform()
          Gets the transform of this context.
 Transform getTransform(int index)
          Gets a transform of this violation.
 int getTransformCount()
          Gets the number of transforms of this violation.
 Location getTransformFocusLocation(int index)
          Gets the applicable location of a transform of this violation, or null if none.
 java.lang.String getVariation()
          Gets the variation in the rule violated, or null if the default.
 Violation getViolation()
          Gets the violation associated with the transform.
 Workspace getWorkspace()
          Gets the workspace containing the model to be transformed.
 void invokeLater(Command command)
          Invokes a command after the command currently being executed by the Audit framework completes.
 void setAttribute(java.lang.String name, java.lang.Object value)
          Sets the value of an attribute.
protected  void setPredecessorApplyData(java.lang.Object applyData)
          Sets the data that was returned by the apply method of the immediate predecessor in a multiple context transform.
 void setSelection(ModelAdapter model, java.lang.Object construct, boolean before, boolean after)
          Deprecated. Use {@link #setSelection(ModelAdapter, Object, int, int)
 void setSelection(ModelAdapter model, java.lang.Object construct, int margin, int endMargin)
          Sets the selection after the transform is applied to a construct in a specified model.
 void setSelection(java.lang.Object construct, boolean before, boolean after)
          Deprecated. Use {@link #setSelection(Object, int, int)
 void setSelection(java.lang.Object construct, int margin, int endMargin)
          Sets the selection after the transform is applied to a construct in the model for this context.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TransformContext

public TransformContext(TransformAdapter adapter,
                        Transform transform,
                        Violation violation,
                        Location location)
Creates a transform context for a transform to be applied to a violation.

Parameters:
adapter -
transform -
violation -
location -
Method Detail

getAdapter

public TransformAdapter getAdapter()
Gets the transform adapter for the transform of this context.


getTransform

public Transform getTransform()
Gets the transform of this context.


getViolation

public Violation getViolation()
Gets the violation associated with the transform.


getLocation

public Location getLocation()
Gets the location to be transformed.

Specified by:
getLocation in interface Violation

getModel

public ModelAdapter getModel()
Gets the model to be transformed.


getModelAdapter

public ModelAdapter getModelAdapter()
Deprecated. use getModel()

Gets the model to be transformed.


getNode

public Node getNode()
Gets the node to be transformed.


getProject

public Project getProject()
Gets the project containing the model to be transformed.


getWorkspace

public Workspace getWorkspace()
Gets the workspace containing the model to be transformed.


getIdeContext

public Context getIdeContext()
Gets an IDE context in which this transform is being applied. The view is null in this context, which could be remedied if necessary.


getRule

public Rule getRule()
Description copied from interface: Violation
Gets the rule violated by this violation.

Specified by:
getRule in interface Violation

getVariation

public java.lang.String getVariation()
Gets the variation in the rule violated, or null if the default.

Specified by:
getVariation in interface Violation

getParameter

public java.lang.Object getParameter(java.lang.String name)
Gets the value of a parameter added to the violation or a property of the transform, or null if none.

Parameters:
name - The name given to the parameter.
See Also:
ViolationReport.addParameter(java.lang.String, java.lang.Object)

getFocusLocation

public Location getFocusLocation()
Description copied from interface: Violation
Gets the focus location of the violation, or null if none.

Specified by:
getFocusLocation in interface Violation

getParameterCount

public int getParameterCount()
Description copied from interface: Violation
Gets the number of parameters of this violation.

Specified by:
getParameterCount in interface Violation

getParameterName

public java.lang.String getParameterName(int index)
Description copied from interface: Violation
Gets the name of a parameter of this violation.

Specified by:
getParameterName in interface Violation
Parameters:
index - The index of the parameter.

getParameterValue

public java.lang.Object getParameterValue(int index)
Description copied from interface: Violation
Gets the value of a parameter of this violation.

Specified by:
getParameterValue in interface Violation
Parameters:
index - The index of the parameter.

getParameterValue

public java.lang.Object getParameterValue(java.lang.String name)
Description copied from interface: Violation
Gets the value of a parameter of this violation by name.

Specified by:
getParameterValue in interface Violation

getTransformCount

public int getTransformCount()
Description copied from interface: Violation
Gets the number of transforms of this violation.

Specified by:
getTransformCount in interface Violation

getTransform

public Transform getTransform(int index)
Description copied from interface: Violation
Gets a transform of this violation.

Specified by:
getTransform in interface Violation
Parameters:
index - The index of the transform.

getTransformFocusLocation

public Location getTransformFocusLocation(int index)
Description copied from interface: Violation
Gets the applicable location of a transform of this violation, or null if none.

Specified by:
getTransformFocusLocation in interface Violation
Parameters:
index - The index of the transform.

getDefaultTransform

public Transform getDefaultTransform()
Description copied from interface: Violation
Gets the default transform of this violation, or null if none.

Specified by:
getDefaultTransform in interface Violation

getSerialNumber

public int getSerialNumber()
Description copied from interface: Violation
Gets the serial number of this violation.

Specified by:
getSerialNumber in interface Violation

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Sets the value of an attribute.


getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Gets the value of an attribute.


getPredecessorApplyData

public java.lang.Object getPredecessorApplyData()
Gets the data that was returned by the apply method of the immediate predecessor in a multiple context transform.


setSelection

public void setSelection(java.lang.Object construct,
                         int margin,
                         int endMargin)
Sets the selection after the transform is applied to a construct in the model for this context.

Parameters:
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(ModelAdapter model,
                         java.lang.Object construct,
                         int margin,
                         int endMargin)
Sets the selection after the transform is applied to a construct in a specified model.

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.

addHighlight

public void addHighlight(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(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.

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.


setPredecessorApplyData

protected void setPredecessorApplyData(java.lang.Object applyData)
Sets the data that was returned by the apply method of the immediate predecessor in a multiple context transform.


toString

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

setSelection

public void setSelection(java.lang.Object construct,
                         boolean before,
                         boolean after)
Deprecated. Use {@link #setSelection(Object, int, int)

Sets the selection after the transform is applied to a construct in the model for this context. If before is true, the caret is positioned at the beginning of the construct; otherwise at the end of the construct.

Parameters:
construct - The construct at which to place the caret.
before - Whether to place the caret at the beginning of the construct.
after - Whether to place the caret at the end of the construct.

setSelection

public void setSelection(ModelAdapter model,
                         java.lang.Object construct,
                         boolean before,
                         boolean after)
Deprecated. Use {@link #setSelection(ModelAdapter, Object, int, int)

Sets the selection after the transform is applied to a construct in a specified model. If before is true, the caret is positioned at the beginning of the construct; otherwise at the end of the construct.

Parameters:
model - The model containing the construct to select.
construct - The construct at which to place the caret.
before - Whether to place the caret at the beginning of the construct.
after - Whether to place the caret at the end of the construct.

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

E13403-07

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