Extension SDK 9.0.5

oracle.jdeveloper.audit.analyzer
Class Rule

java.lang.Object
  extended byoracle.jdeveloper.audit.analyzer.Profileable
      extended byoracle.jdeveloper.audit.analyzer.Rule

public class Rule
extends Profileable

An Audit rule. The configurable state of an Audit rule is exposed through JavaBeans properties. Every rule has category, enabled, name, priority, and severity properties. The name and severity are read-only properties. The name is not intended for display and is typically used as a resource bundle key. Rules can expose additional properties which the Audit framework will discover by introspection and add to the appropriate Audit preferences panel. The properties should be bound properties, which in practice means that the setters should invoke the firePropertyChange method.

Localized label, tool tip, violation message, and 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() + ".message"
   "rule." + name() + ".description"
The bean context for label, tip, and description messages is a Rule instance; the bean context for a message is a Violation instance.

See Also:
Localizer

Constructor Summary
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.
 
Method Summary
 java.lang.String description()
          Gets the localized description text for this rule from its localizer using the key "rule." + getName() + ".label".
 Category getCategory()
          Gets the category of this profileable.
 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.
 Priority getPriority()
          Gets the priority of this rule.
 Severity getSeverity()
          Gets the severity of this rule.
 Transform[] getTransforms()
          Gets the transforms which can be applied to violations of this rule.
 boolean isEnabled()
          Gets whether this rule is enabled.
 java.lang.String label()
          Gets the localized label text for this rule from its localizer using the key "rule." + getName() + ".label".
 java.lang.String message(Violation violation)
          Gets the localized violation message for a violation of this rule from its localizer using the key "rule." + getName() + ".message".
 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 setPriority(Priority newValue)
          Sets the priority of this rule.
protected  void setTransforms(Transform[] transforms)
          Sets the transforms which can be applied to violations of this rule.
 java.lang.String tip()
          Gets the localized tool tip text for this rule from its localizer using the key "rule." + getName() + ".tip".
 java.lang.String toString()
           
 
Methods inherited from class oracle.jdeveloper.audit.analyzer.Profileable
addPropertyChangeListener, addPropertyChangeListener, context, context, equals, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, hashCode, name, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Rule

public Rule(java.lang.String name,
            Category category,
            Severity severity,
            Localizer localizer)
Creates a rule with no fixes

Parameters:
category - The category of this rule.
name - The name of this rule.
severity - The severity of this rule.
localizer - The localizer which supplies localized strings for this rule.

Rule

public Rule(java.lang.String name,
            Category category,
            Severity severity,
            Localizer localizer,
            Transform defaultTransform)
Creates a rule with one, default, fix.

Parameters:
category - The category of this rule.
name - The name 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.

Rule

public Rule(java.lang.String name,
            Category category,
            Severity severity,
            Localizer localizer,
            Transform[] transforms,
            Transform defaultTransform)
Creates a rule.

Parameters:
category - The category of this rule.
name - The name 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.
Throws:
java.lang.IllegalArgumentException - if the default fix is not in fixes.
Method Detail

getSeverity

public Severity getSeverity()
Gets the severity of this rule.


label

public java.lang.String label()
Gets the localized label text for this rule from its localizer using the key "rule." + getName() + ".label".

Specified by:
label in class Profileable
See Also:
Localizer

tip

public java.lang.String tip()
Gets the localized tool tip text for this rule from its localizer using the key "rule." + getName() + ".tip".

Specified by:
tip in class Profileable
See Also:
Localizer

description

public java.lang.String description()
Gets the localized description text for this rule from its localizer using the key "rule." + getName() + ".label".

Specified by:
description in class Profileable
See Also:
Localizer

message

public java.lang.String message(Violation violation)
Gets the localized violation message for a violation of this rule from its localizer using the key "rule." + getName() + ".message".

Parameters:
violation - The violation for which to get a message.
See Also:
Localizer

getDefaultTransform

public Transform getDefaultTransform()
Gets the default transform for this rule, or null if none.


setDefaultTransformName

public void setDefaultTransformName(java.lang.String newName)
Sets the default transform for this rule by its name. This method exists only to support saving and restoring profiles.

Parameters:
newName - The name of a transform of this rule, or null.

getDefaultTransformName

public java.lang.String getDefaultTransformName()
Gets the name of the default transform of this rule, or null if none. This method exists to support saving and restoring profiles.


getTransforms

public Transform[] getTransforms()
Gets the transforms which can be applied to violations of this rule.

Returns:
An array of Transforms.
See Also:
getDefaultTransform()

setTransforms

protected void setTransforms(Transform[] transforms)
Sets the transforms which can be applied to violations of this rule. Typically, this is set in the constructor. However, a subclass may want to alter the set of fixes from the setter of another property.


getPriority

public Priority getPriority()
Gets the priority of this rule.


setPriority

public void setPriority(Priority newValue)
Sets the priority of this rule.

Parameters:
newValue - The new priority of this rule.

toString

public java.lang.String toString()

getCategory

public Category getCategory()
Gets the category of this profileable.


isEnabled

public boolean isEnabled()
Gets whether this rule is enabled.


setEnabled

public void setEnabled(boolean newValue)
Sets whether this rule is enabled.


Extension SDK

 

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