|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.3.0) E17493-04 |
|||||||||
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 an Issue
or violation
: Audit originally used the term violation but that does not fit advisories and incompletes, so issue is now preferred.)
Rules are defined in extension manifests by <rule-definition> elements of an <audit-hook>. The definition specifies id, category, severity, and enabled properties. The id and category are immutable properties. The id uniquely identifies the rule. The Audit profile panel allows the user to change the enabled and severity properties. The definition of a rule can additionally specify a Rule
subclass for the rule and define additional properties which the user will also be allowed to change. 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.
The definition defines, implicitly or explicitly, label and description strings for the rule. See ExtensionBean.labelOrId()
and ExtensionBean.description()
. The object which supplies properties for these strings is the Rule instance.
The definition also defines, implicitly or explicitly, the message string used to describe an issue. 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 a variation key to be tried before the default tree.
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 |
Constructor Summary | |
---|---|
Rule() Creates a rule. |
Method Summary | |
---|---|
boolean |
assist() Gets whether this rule is an assist. |
Category |
category() Gets the category of this rule. |
protected void |
copyInternalState(ExtensionBean copy, java.util.Map<java.lang.String,ExtensionBean> context) Copies internal subclass state as part of creating a copy of this bean. |
RuleDefinition |
definition() Gets the definition of this bean. |
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() Gets the unformatted template for the message which reports a violation of this rule. |
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. |
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, extensionLine, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, formattedString, formattedString, formattedString, hashCode, id, key, label, labelOrId, logError, logError, logWarning, name, propertyDescription, propertyLabel, removePropertyChangeListener, removePropertyChangeListener, setters, string |
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()
, 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.
Method Detail |
---|
protected void copyInternalState(ExtensionBean copy, java.util.Map<java.lang.String,ExtensionBean> 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.Map<java.lang.String, oracle.jdeveloper.audit.extension.ExtensionBean>)
public RuleDefinition definition()
definition
in class ExtensionBean
public final boolean assist()
public Category category()
public Rule.Parameter[] parameters()
public java.lang.String[] variations()
public java.lang.String message()
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.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.public final 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 final boolean isEnabled()
public final void setEnabled(boolean newValue)
public final Severity getSeverity()
public final void setSeverity(Severity newValue)
public final StyleCategory getStyle()
public final void setStyle(StyleCategory newValue)
newValue
- The new style of this rule.public final Transform[] getTransforms()
Transform
s.getDefaultTransform()
public java.lang.String toString()
toString
in class java.lang.Object
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.3.0) E17493-04 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |