|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.2) E13403-10 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.jdeveloper.audit.extension.ExtensionBean
oracle.jdeveloper.audit.analyzer.Rule
public class Rule
An Audit rule. A rule reifies a condition in source code which Audit can report. (A particular occurrence of such a condition is a violation
.)
The configurable state of an Audit rule is exposed through JavaBeans properties. Every rule has id, category, enabled, and severity properties. The id and categirt are read-only properties. The id uniquely identifies the rule and is not inteded for display.
Rules can expose additional properties which the Audit framework will discover by introspection and add to the appropriate Audit preferences panel. These properties should be bound properties, which in practice means that the setters should invoke the appropriate ExtensionBean.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object)
method.
Localized label, tool tip, description strings are returned by this class using the Localizer
supplied to the constructor and the following keys:
"rule." + name() + ".label"
"rule." + name() + ".tip"
"rule." + name() + ".description"
See ExtensionBean.labelOrId()
and ExtensionBean.description()
. The object which supplies properties for these strings is the Rule instance.
By default, localized violation message strings are returned by this class using the following key for the base (null) variation:
"rule." + name() + ".message"
See message(Violation)
. The object which supplies properties for message strings is a Violation
instance.
For some rules, not all violations of the rule can be described by the same message format string. A variation name can be set on a violation which will cause the following key to be tried before the default:
"rule." + name() + "." + violation.getVariation() + ".message"
Localizer
, Violation
Nested Class Summary | |
---|---|
static interface |
Rule.Parameter |
Field Summary | |
---|---|
static java.lang.String |
HTML_MESSAGE_KEY The key for the message text of a rule. |
static int |
MAX_TRANSFORM_COUNT The maximum number of transforms allowed by a rule. |
static java.lang.String |
MESSAGE_KEY The key for the message text of a rule. |
Fields inherited from class oracle.jdeveloper.audit.extension.ExtensionBean |
---|
DESCRIPTION_KEY, LABEL_KEY, SHORT_LABEL_KEY, TIP_KEY |
Constructor Summary | |
---|---|
Rule() Creates a rule. |
|
Rule(java.lang.String name, Category category, Severity severity, Localizer localizer) Creates a rule with no fixes |
|
Rule(java.lang.String name, Category category, Severity severity, Localizer localizer, Transform defaultTransform) Creates a rule with one, default fix. |
|
Rule(java.lang.String name, Category category, Severity severity, Localizer localizer, Transform[] transforms, Transform defaultTransform) Creates a rule. |
|
Rule(java.lang.String name, java.lang.String[] variations, Category category, Severity severity, Localizer localizer, Transform[] transforms, Transform defaultTransform) Creates a rule. |
|
Rule(java.lang.String id, java.lang.String extensionId, Category category, java.lang.String[] variations, Transform[] transforms, Transform defaultTransform) Creates a rule. |
|
Rule(java.lang.String name, java.lang.String extensionId, java.lang.String[] variations, Category category, Severity severity, Localizer localizer, Transform[] transforms, Transform defaultTransform) Creates a rule. |
Method Summary | |
---|---|
Category |
category() Gets the category of this rule. |
protected void |
copyInternalState(ExtensionBean copy, java.util.IdentityHashMap<java.lang.Object,java.lang.Object> context) Copies internal subclass state as part of creating a copy of this bean. |
boolean |
declarative() Gets whether this rule is declarative. |
Transform |
getDefaultTransform() Gets the default transform for this rule, or null if none. |
java.lang.String |
getDefaultTransformName() Gets the name of the default transform of this rule, or null if none. |
Severity |
getSeverity() Gets the severity of this rule. |
StyleCategory |
getStyle() Gets the style of this rule. |
Transform[] |
getTransforms() Gets the transforms which can be applied to violations of this rule. |
java.lang.String |
htmlMessage(Violation violation) Gets the localized HTML violation message for a violation of this rule from its localizer using this key for a default (null) variation: |
boolean |
isEnabled() Gets whether this rule is enabled. |
java.lang.String |
message(Violation violation) Gets the localized violation message for a violation of this rule from its localizer using this key for a default (null) variation: |
Rule.Parameter[] |
parameters() Gets the parameters declared by this rule, or an empty array if none. |
void |
setDefaultTransformName(java.lang.String newName) Sets the default transform for this rule by its name. |
void |
setEnabled(boolean newValue) Sets whether this rule is enabled. |
void |
setSeverity(Severity newValue) |
void |
setStyle(StyleCategory newValue) Sets the style of this rule. |
void |
setStyleCategory(StyleCategory newValue) Deprecated. |
protected void |
setTransforms(Transform[] transforms) Sets the transforms which can be applied to violations of this rule. |
java.lang.String |
toString() |
java.lang.String[] |
variations() Gets the variations supported by this rule, or an empty array if none. |
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, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String MESSAGE_KEY
message(oracle.jdeveloper.audit.service.Violation)
, Constant Field Valuespublic static final java.lang.String HTML_MESSAGE_KEY
htmlMessage(oracle.jdeveloper.audit.service.Violation)
, Constant Field Valuespublic static final int MAX_TRANSFORM_COUNT
Constructor Detail |
---|
public Rule()
The Audit framework uses this constructor for rules declared in an extension manifest, and then injects values for the ExtensionBean.id
, ExtensionBean.extensionId
, category
, variations
, parameters
transforms
, and defaultTransform
fields.
public Rule(java.lang.String name, Category category, Severity severity, Localizer localizer)
name
- The non-localized name of this rule.category
- The category of this rule.severity
- The severity of this rule.localizer
- The localizer which supplies localized strings for this rule.public Rule(java.lang.String name, Category category, Severity severity, Localizer localizer, Transform defaultTransform)
name
- The non-localized name of this rule.category
- The category of this rule.severity
- The severity of this rule.localizer
- The localizer which supplies localized strings for this rule.defaultTransform
- The name of the default, and only available, tranform for this rule.public Rule(java.lang.String name, Category category, Severity severity, Localizer localizer, Transform[] transforms, Transform defaultTransform)
name
- The non-localized name of this rule.category
- The category of this rule.severity
- The severity of this rule.localizer
- The localizer for this rule.transforms
- An array of names of available fixes for this rule.defaultTransform
- The name of the default fix for this rule, or null if none.java.lang.IllegalArgumentException
- if the default fix is not in fixes
.public Rule(java.lang.String name, java.lang.String[] variations, Category category, Severity severity, Localizer localizer, Transform[] transforms, Transform defaultTransform)
name
- The non-localized name of this rule.variations
- The variations supported by this rule.category
- The category of this rule.severity
- The severity of this rule.localizer
- The localizer for this rule.transforms
- An array of names of available fixes for this rule.defaultTransform
- The name of the default fix for this rule, or null if none.java.lang.IllegalArgumentException
- if the default fix is not in fixes
.public Rule(java.lang.String name, java.lang.String extensionId, java.lang.String[] variations, Category category, Severity severity, Localizer localizer, Transform[] transforms, Transform defaultTransform)
name
- The non-localized name of this rule.extensionId
- The id of the extension that defined this rule.variations
- The variations supported by this rule.category
- The category of this rule.severity
- The severity of this rule.localizer
- The localizer for this rule.transforms
- An array of names of available fixes for this rule.defaultTransform
- The name of the default fix for this rule, or null if none.java.lang.IllegalArgumentException
- if the default fix is not in fixes
.public Rule(java.lang.String id, java.lang.String extensionId, Category category, java.lang.String[] variations, Transform[] transforms, Transform defaultTransform)
id
- The id of this rule.extensionId
- The id of the extension that defined this rule.variations
- The variations supported by this rule.category
- The category of this rule.transforms
- An array of available transforms for this rule.defaultTransform
- The default fix for this rule, or null if none.java.lang.IllegalArgumentException
- if the default fix is not in fixes
.Method Detail |
---|
protected void copyInternalState(ExtensionBean copy, java.util.IdentityHashMap<java.lang.Object,java.lang.Object> context) throws java.lang.reflect.InvocationTargetException
ExtensionBean
copyInternalState
in class ExtensionBean
copy
- 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<java.lang.Object, java.lang.Object>)
public final boolean declarative()
public Category category()
public Rule.Parameter[] parameters()
public java.lang.String[] variations()
public java.lang.String message(Violation violation)
"rule." + getName() + ".message"
and the first defined of these keys for a named variation:
"rule." + getName() + "." + violation.getVariation() + ".message"
"rule." + getName() + ".message"
violation
- The violation for which to get a message.Localizer
public java.lang.String htmlMessage(Violation violation)
"rule." + getName() + ".html-message"
and the first defined of these keys for a named variation:
"rule." + getName() + "." + violation.getVariation() + ".html-message"
"rule." + getName() + ".message"
violation
- The violation for which to get a message.Localizer
public Transform getDefaultTransform()
public void setDefaultTransformName(java.lang.String newName)
newName
- The name of a transform of this rule, or null.public java.lang.String getDefaultTransformName()
public boolean isEnabled()
public void setEnabled(boolean newValue)
public Severity getSeverity()
public void setSeverity(Severity newValue)
public StyleCategory getStyle()
public void setStyle(StyleCategory newValue)
newValue
- The new style of this rule.public void setStyleCategory(StyleCategory newValue)
public Transform[] getTransforms()
Transform
s.getDefaultTransform()
protected void setTransforms(Transform[] transforms)
public java.lang.String toString()
toString
in class java.lang.Object
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.2) E13403-10 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |