Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

oracle.jdeveloper.audit.extension
Class ExtensionBean

java.lang.Object
  extended by oracle.jdeveloper.audit.extension.ExtensionBean
Direct Known Subclasses:
Category, Metric, Rule, Transform

public abstract class ExtensionBean
extends java.lang.Object

An abstract base class for a bean defined from an extension manifest.

This class defines methods to get id and extensionId, and to set and get bean and property labels and descriptions. These methods do not follow JavaBeans conventions, to avoid interfering with a subclass that wishes to define a JavaBeans property named, for example, "label".

Subclass properties should be bound, which means in practice that the setters should fire property change events. This class provides a complete set of firePropertyChange methods to make this convenient.

The id "property" is used to identify the bean for purposes of determining equality and for marshalling and unmarshalling instances.


Field Summary
static java.lang.String DESCRIPTION_KEY
          The key for the description of a bean or bean property.
static java.lang.String LABEL_KEY
          The key for the label of a bean or bean property.
 
Constructor Summary
protected ExtensionBean()
          Creates a bean.
protected ExtensionBean(BeanDefinition definition)
          Creates a bean.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
           
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.
 ExtensionBean createCopy(java.util.Map<java.lang.String,ExtensionBean> context)
          Creates a copy of this bean.
 BeanDefinition definition()
          Gets the definition of this bean.
 java.lang.String description()
          Gets the localized description of this bean.
 boolean equals(java.lang.Object object)
           
 java.lang.String extensionId()
          Gets the extension id that defines this bean, null if not declarative.
 int extensionLine()
          Gets the extension manifest line number that defines this bean, -1 if none.
 void firePropertyChange(java.lang.String propertyName, boolean oldValue, boolean newValue)
           
 void firePropertyChange(java.lang.String propertyName, double oldValue, double newValue)
           
 void firePropertyChange(java.lang.String propertyName, float oldValue, float newValue)
           
 void firePropertyChange(java.lang.String propertyName, int oldValue, int newValue)
           
 void firePropertyChange(java.lang.String propertyName, long oldValue, long newValue)
           
 void firePropertyChange(java.lang.String propertyName, java.lang.Object[] oldValue, java.lang.Object[] newValue)
           
 void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
           
 java.lang.String formattedString(java.lang.String name)
          Gets a formatted resource string for this bean.
 java.lang.String formattedString(java.lang.String name, java.lang.Object context)
          Gets a localized string for this bean.
 java.lang.String formattedString(java.lang.String name, java.lang.Object context, boolean erase)
          Gets a localized string for this bean.
 int hashCode()
           
 java.lang.String id()
          Gets the unique identifier of this bean.
 java.lang.String key(java.lang.String name)
          Gets the resource key for this bean.
 java.lang.String label()
          Gets the localized label of this bean, or null if none.
 java.lang.String labelOrId()
          Gets the localized label of this bean, or the id if none.
 void logError(java.lang.String message, java.lang.Object... parameters)
          Logs an error message related to this bean.
 void logError(java.lang.Throwable e, java.lang.String message, java.lang.Object... parameters)
          Logs an error message related to this bean.
 void logWarning(java.lang.String message, java.lang.Object... parameters)
          Logs an error message related to this bean.
 java.lang.String name()
          Gets the simple name of this bean.
 java.lang.String propertyDescription(java.lang.String propertyName)
          Gets the localized description of a property of this bean, or null if none.
 java.lang.String propertyLabel(java.lang.String propertyName)
          Gets the localized label of a property of this bean, or null if none.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
           
 java.util.Map<java.lang.String,DeferredSetter> setters()
          Gets the deferred setters for this bean.
 java.lang.String string(java.lang.String name)
          Gets a resource string for this bean.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LABEL_KEY

public static final java.lang.String LABEL_KEY
The key for the label of a bean or bean property.

See Also:
labelOrId(), propertyLabel(java.lang.String), Constant Field Values

DESCRIPTION_KEY

public static final java.lang.String DESCRIPTION_KEY
The key for the description of a bean or bean property.

See Also:
description(), propertyDescription(java.lang.String), Constant Field Values
Constructor Detail

ExtensionBean

protected ExtensionBean()
Creates a bean. This constructor assumes that the Audit framework will inject values for the id() and extensionId() fields.


ExtensionBean

protected ExtensionBean(BeanDefinition definition)
Creates a bean.

Parameters:
definition - The BeanDefinition of this bean.
Method Detail

createCopy

public ExtensionBean createCopy(java.util.Map<java.lang.String,ExtensionBean> context)
                         throws java.lang.reflect.InvocationTargetException
Creates a copy of this bean. The copy is created as follows:

Parameters:
context - A map which allows subclasses to preserve object identity when copying a graph of extension beans.
Returns:
A copy of this bean.
Throws:
java.lang.reflect.InvocationTargetException

copyInternalState

protected void copyInternalState(ExtensionBean copy,
                                 java.util.Map<java.lang.String,ExtensionBean> context)
                          throws java.lang.reflect.InvocationTargetException
Copies internal subclass state as part of creating a copy of this bean.

Parameters:
copy - The partially initialized copy.
context - A map which allows subclasses to preserve object identity when copying a graph of extension beans.
Throws:
java.lang.reflect.InvocationTargetException
See Also:
createCopy(java.util.Map)

id

public java.lang.String id()
Gets the unique identifier of this bean.


definition

public BeanDefinition definition()
Gets the definition of this bean.


name

public java.lang.String name()
Gets the simple name of this bean.


extensionId

public java.lang.String extensionId()
Gets the extension id that defines this bean, null if not declarative.


extensionLine

public int extensionLine()
Gets the extension manifest line number that defines this bean, -1 if none.


setters

public java.util.Map<java.lang.String,DeferredSetter> setters()
Gets the deferred setters for this bean.


logError

public void logError(java.lang.Throwable e,
                     java.lang.String message,
                     java.lang.Object... parameters)
Logs an error message related to this bean.


logError

public void logError(java.lang.String message,
                     java.lang.Object... parameters)
Logs an error message related to this bean.


logWarning

public void logWarning(java.lang.String message,
                       java.lang.Object... parameters)
Logs an error message related to this bean.


labelOrId

public final java.lang.String labelOrId()
Gets the localized label of this bean, or the id if none.

See Also:
label(), LABEL_KEY

label

public java.lang.String label()
Gets the localized label of this bean, or null if none.

See Also:
LABEL_KEY

description

public java.lang.String description()
Gets the localized description of this bean. If not set, gets null. The typical use of the description is in a help text area; HTML markup is expected.

See Also:
DESCRIPTION_KEY

propertyLabel

public java.lang.String propertyLabel(java.lang.String propertyName)
Gets the localized label of a property of this bean, or null if none.

See Also:
LABEL_KEY

propertyDescription

public java.lang.String propertyDescription(java.lang.String propertyName)
Gets the localized description of a property of this bean, or null if none.

See Also:
DESCRIPTION_KEY

string

public java.lang.String string(java.lang.String name)
Gets a resource string for this bean.

The default ExtensionBean implementation obtains the resource string using the resource bundle injected by the Audit framework and the key from key(String name).

Parameters:
name - bean-defined local name of the resource to get (e.g., "label").

key

public java.lang.String key(java.lang.String name)
Gets the resource key for this bean.

The default ExtensionBean implementation gets the key injected by the Audit framework, if any, or else returns #name()} + "." + name.

Parameters:
name - bean-defined local name of a resource (e.g., "label").

formattedString

public java.lang.String formattedString(java.lang.String name)
Gets a formatted resource string for this bean.

The default ExtensionBean implementation formats the string using formattedString(String, Object) with this extension bean as the context object.

Parameters:
name - bean-defined name of the localized string to get (e.g., "label").

formattedString

public java.lang.String formattedString(java.lang.String name,
                                        java.lang.Object context)
Gets a localized string for this bean.

Parameters:
name - bean-defined name of the localized string to get (e.g., "label").
context - context defining parameters in the string.

formattedString

public java.lang.String formattedString(java.lang.String name,
                                        java.lang.Object context,
                                        boolean erase)
Gets a localized string for this bean.

Parameters:
name - bean-defined name of the localized string to get (e.g., "label").
context - context defining parameters in the string.
erase - whether to erase unsatisfied parameter references

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)

addPropertyChangeListener

public void addPropertyChangeListener(java.lang.String propertyName,
                                      java.beans.PropertyChangeListener listener)

removePropertyChangeListener

public void removePropertyChangeListener(java.lang.String propertyName,
                                         java.beans.PropertyChangeListener listener)

firePropertyChange

public void firePropertyChange(java.lang.String propertyName,
                               java.lang.Object oldValue,
                               java.lang.Object newValue)

firePropertyChange

public void firePropertyChange(java.lang.String propertyName,
                               java.lang.Object[] oldValue,
                               java.lang.Object[] newValue)

firePropertyChange

public void firePropertyChange(java.lang.String propertyName,
                               boolean oldValue,
                               boolean newValue)

firePropertyChange

public void firePropertyChange(java.lang.String propertyName,
                               int oldValue,
                               int newValue)

firePropertyChange

public void firePropertyChange(java.lang.String propertyName,
                               long oldValue,
                               long newValue)

firePropertyChange

public void firePropertyChange(java.lang.String propertyName,
                               float oldValue,
                               float newValue)

firePropertyChange

public void firePropertyChange(java.lang.String propertyName,
                               double oldValue,
                               double newValue)

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

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