Extension SDK 9.0.5

oracle.jdeveloper.audit.analyzer
Class Attribute

java.lang.Object
  extended byoracle.jdeveloper.audit.analyzer.Profileable
      extended byoracle.jdeveloper.audit.analyzer.Attribute
Direct Known Subclasses:
Column, Metric

public abstract class Attribute
extends Profileable

An attribute of constructs of the Audit object model. An attribute can be thought of as supplying data for one column of a table (or tree table) in which the rows are constructs from the Audit object model. Rows can also be violations, for which an attribute can (less commonly) also supply data.

The configurable state of an attribute is exposed through JavaBeans properties. Every attribute has five default properties: name, type, enabled, category, and threshold. category, name, and enabled are inherited from Profileable); category, name, and type are read-only. The name is used internally, primarily as a resource key. The type indicates the most-specific type common to the values of the attribute. The category is used to group attributes for presentation purposes. The threshold, if any, indicates the largest acceptable value of the attribute. An attribute can expose additional properties which the Audit framework will discover by introspection and add to the appropriate Audit preferences panel. Attributes are registered with the AuditManager at startup by IDE extensions.

For some attributes, the values for all constructs may computed and and stored to the AuditModel during the traversal of the construct hierarchy. For other attributes, however, the values are computed by querying an external source or by aggregating other, already computed, values. For these attributes, a couple of approaches are supported:


Field Summary
protected  java.util.Comparator comparator
           
protected  java.lang.Object threshold
           
protected  java.lang.Class type
           
 
Constructor Summary
protected Attribute(java.lang.String name, Category category, java.lang.Class type, java.lang.Object threshold)
          Creates a metric.
 
Method Summary
 java.util.Comparator comparator()
          Gets a comparator for values of this attribute, or null if the values are not comparable.
 Category getCategory()
          Gets the category of this profileable.
 Evaluator getEvaluator(java.lang.Class type)
          Gets the evaluator of this attribute for a construct type or Violation.class.
 java.lang.Object getThreshold()
          Gets the error threshold of this metric, or null if none.
 java.lang.Class getType()
          Gets the type of this attribute.
 boolean isEnabled()
          Gets whether this rule is enabled.
 void setEnabled(boolean newValue)
          Sets whether this rule is enabled.
 void setThreshold(java.lang.Object newValue)
          Sets the error threshold of this metric.
 
Methods inherited from class oracle.jdeveloper.audit.analyzer.Profileable
addPropertyChangeListener, addPropertyChangeListener, context, context, description, equals, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, hashCode, label, name, removePropertyChangeListener, removePropertyChangeListener, tip
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

protected java.lang.Class type

threshold

protected java.lang.Object threshold

comparator

protected java.util.Comparator comparator
Constructor Detail

Attribute

protected Attribute(java.lang.String name,
                    Category category,
                    java.lang.Class type,
                    java.lang.Object threshold)
Creates a metric.

Parameters:
name - The name of this metric.
type - The type of this metric.
category - The category of this metric.
threshold - The threshold of this metric.
Throws:
java.lang.IllegalArgumentException - if the threshold is not null and not of the attribute type.
Method Detail

getThreshold

public java.lang.Object getThreshold()
Gets the error threshold of this metric, or null if none.


setThreshold

public void setThreshold(java.lang.Object newValue)
Sets the error threshold of this metric.

Parameters:
newValue - The value at which a measurement is considered an error, or null if none.

getType

public java.lang.Class getType()
Gets the type of this attribute.


getEvaluator

public Evaluator getEvaluator(java.lang.Class type)
Gets the evaluator of this attribute for a construct type or Violation.class. The default implementation supplied by Attribute returns an evaluator which always returns null, which is adequate for attributes for which all values are computed by an analyzer or by AuditModelListener methods.


comparator

public java.util.Comparator comparator()
Gets a comparator for values of this attribute, or null if the values are not comparable. The Attribute implementation returns a default comparator if the attribute type is naturally ordered (i.e., implements Comparable) and returns null otherwise.


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.