|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.1.0) E13403-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.jdeveloper.audit.extension.ExtensionBean
oracle.jdeveloper.audit.transform.Transform
public abstract class Transform
A source code transform. Concrete subclasses of this class implement
single source transformations at one or more source locations. This base
class supplies name and label methods which allow the Audit framework to
describe the transform. Concrete subclasses must supply one or more
apply
methods that apply the transform, and can supply
isApplicable
methods that evaluate whether the transform is
currently applicable, query
methods that query the user
for transforms that require user input, and isQueryRequired
methods that, when a query method is present, evaluate whether the user
really needs to be queried. The Audit framework discovers transforms through
the Rule
s that are registered with
it, and determines what apply
, isApplicable
,
isQueryRequired
, and query
methods are present
through introspection.
A transform addresses a single violation and each violation is associated
with a construct in an object model. Different object models handle the
details of mutating an object model (locks, transaction, and so forth)
differently, so the Audit framework delegates this to an implementation of
the abstract TransformAdapter
class. A transform is constructed with
an appropriate transform adapter; for example, a transform for the JDeveloper
Java model (oracle.javatools.parser.java.v2.model
) would be constructed
with a JavaTransformAdapter
. The
apply
, isApplicable
, isQueryRequired
,
and query
methods all require access to the construct, and to
parameters of the violation, so they take two arguments, a
TransformContext
argument, and a construct argument. The actual
declared class of the transform context argument can be a subclass of
TransformContext
, and the actual declared class of the construct
argument can be its class or any supertype of its class. If more than one '
apply
, isApplicable
, isQueryRequired
,
or query
) method is present, the one with the most specific
matching construct type is invoked.
Localized label, tool tip, and description strings are returned by this
class using the Localizer
supplied to the constructor and the
following keys:
See
"transform." + name() + ".label"
"transform." + name() + ".context.label"
"transform." + name() + ".tip"
"transform." + name() + ".context.tip"
"transform." + name() + ".description"
ExtensionBean.labelOrId()
, boundLabel(TransformContext)
, ExtensionBean.description()
.
Field Summary | |
---|---|
static java.lang.String |
BOUND_LABEL_KEY
The key for the bound label of a transform. |
Fields inherited from class oracle.jdeveloper.audit.extension.ExtensionBean |
---|
DESCRIPTION_KEY, LABEL_KEY, SHORT_LABEL_KEY, TIP_KEY |
Constructor Summary | |
---|---|
protected |
Transform(java.lang.String id,
java.lang.String extensionId,
TransformAdapter adapter)
Creates a transform. |
protected |
Transform(TransformAdapter adapter)
Creates a transform. |
protected |
Transform(TransformAdapter adapter,
java.lang.String name)
Creates a transform. |
protected |
Transform(TransformAdapter adapter,
java.lang.String name,
Localizer localizer)
Creates a transform. |
Method Summary | |
---|---|
TransformAdapter |
adapter()
Gets the transform adapter used by this transform. |
java.lang.String |
boundLabel(TransformContext context)
Gets the contextual localized label text for this transform. |
DeferredExpression |
condition()
Gets the condition for this transform, or null if none. |
protected void |
copyInternalState(ExtensionBean bean,
java.util.IdentityHashMap<java.lang.Object,java.lang.Object> context)
Copies internal subclass state as part of creating a copy of this bean. |
TransformContext[] |
createContexts(Violation violation)
Creates the transform contexts for this transform, or null or an empty array if the contexts cannot be created. |
boolean |
isEnabled()
Gets whether this transform is enabled. |
Localizer |
localizer()
Gets the localizer which supplies localized strings for this transform. |
void |
setEnabled(boolean enabled)
Sets whether this transform is enabled. |
java.lang.String |
unboundLabel()
ExtensionBean.label() , but erases missing parameters,
making it possible to reuse a transform label, which uses parameters
supplied from a violation, as generic label in the Audit profile panel. |
Methods inherited from class oracle.jdeveloper.audit.extension.ExtensionBean |
---|
addPropertyChangeListener, addPropertyChangeListener, createCopy, description, equals, extensionId, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, formattedString, formattedString, hashCode, id, label, labelOrId, logError, logWarning, propertyDescription, propertyLabel, propertyString, propertyTip, removePropertyChangeListener, removePropertyChangeListener, setCompatibilityBundle, setStrings, setters, shortLabel, string, strings, tip |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String BOUND_LABEL_KEY
boundLabel(oracle.jdeveloper.audit.transform.TransformContext)
,
Constant Field ValuesConstructor Detail |
---|
protected Transform(TransformAdapter adapter)
ExtensionBean.id
, ExtensionBean.extensionId
, condition
, and ExtensionBean.setters
fields.
adapter
- The adapter for the mutation model used by this transform.protected Transform(TransformAdapter adapter, java.lang.String name)
adapter
- The adapter for the mutation model used by this transform.name
- The unlocalized name of this transform.protected Transform(java.lang.String id, java.lang.String extensionId, TransformAdapter adapter)
id
- The id of this transform.extensionId
- The id of the extension that defined this transform.adapter
- The adapter for the mutation model used by this transform.protected Transform(TransformAdapter adapter, java.lang.String name, Localizer localizer)
adapter
- The adapter for the mutation model used by this transform.name
- The unlocalized name of this transform.localizer
- The localizer which supplies localized strings for this
transform.Method Detail |
---|
protected void copyInternalState(ExtensionBean bean, java.util.IdentityHashMap<java.lang.Object,java.lang.Object> context) throws java.lang.reflect.InvocationTargetException
ExtensionBean
copyInternalState
in class ExtensionBean
bean
- The partially initialized copy.context
- A map which allows subclasses to preserve object identity
when copying a graph of extension beans.
java.lang.reflect.InvocationTargetException
ExtensionBean.createCopy(java.util.IdentityHashMap)
public TransformContext[] createContexts(Violation violation)
The default Transform
implementation invokes the
TransformAdapter.createContext(oracle.jdeveloper.audit.transform.Transform, oracle.jdeveloper.audit.service.Violation, oracle.jdeveloper.audit.model.Location)
method of its transform adapter to
create a context for this transform at the violation location, i.e.:
adapter().createContext(this, violation, violation.getLocation())
A transform can override this method to delegate to a different transform at a different location, or this transform at several locations, etcetera. The Audit framework will aggregate the transform isApplicable, query, and apply methods.
public TransformAdapter adapter()
public DeferredExpression condition()
public boolean isEnabled()
public void setEnabled(boolean enabled)
public Localizer localizer()
public java.lang.String unboundLabel()
ExtensionBean.label()
, but erases missing parameters,
making it possible to reuse a transform label, which uses parameters
supplied from a violation, as generic label in the Audit profile panel.
public java.lang.String boundLabel(TransformContext context)
Transform
implementation invokes the Localizer
using the first defined of these keys:
"transform." + name() + ".context.label"
"transform." + name() + ".label"
The text template can reference parameters of the violation and properties
of the transform.
For example, a concrete Transform named "rename-field" for which the
violation is expected to have name
and suggestedName
parameters might have the following in its resource bundle:
transform.rename-field.label=Rename Field
transform.rename-field.context.label=Rename Field "{name}" to "{suggestedName}"
Localizer
,
ExtensionBean.labelOrId()
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.1.0) E13403-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |