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

E17493-01

oracle.jdeveloper.audit.extension
Class TopLevelDefinition

java.lang.Object
  extended by oracle.jdeveloper.audit.extension.Definition
      extended by oracle.jdeveloper.audit.extension.TopLevelDefinition
All Implemented Interfaces:
org.xml.sax.Locator
Direct Known Subclasses:
BeanDefinition, ProfileDefinition

public abstract class TopLevelDefinition
extends Definition


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.
 
Method Summary
 void addDeprecatedId(java.lang.String id)
           
 void addString(java.lang.String key, java.lang.String value)
           
 java.lang.String description()
          Gets the localized description of a defined bean.
 boolean equals(java.lang.Object that)
           
 java.lang.String formattedString(java.lang.String name, java.lang.Object context)
          Gets a localized string for a defined bean.
 java.lang.String formattedString(java.lang.String name, java.lang.Object context, boolean erase)
          Gets a localized string for a defined bean.
 java.util.List<java.lang.String> getDeprecatedIds()
           
 java.lang.String getElementName()
           
 ExtensionBundle getExtensionBundle()
           
 java.lang.String getId()
           
 java.lang.String getName()
           
 java.util.Map<java.lang.String,java.lang.String> getStrings()
           
protected static java.lang.Object getValue(java.lang.String string, int first, int last, java.lang.Object bean)
          Gets the value of a property of an object.
 int hashCode()
           
static java.lang.String instantiate(java.lang.String message, java.lang.Object bean, boolean erase)
          Instantiate a localized string from a template string and an object.
 java.lang.String key(java.lang.String name)
          Gets the resource key for a defined bean.
 java.lang.String label()
          Gets the localized label of a defined bean, or null if none.
 java.lang.String labelOrId()
          Gets the localized label of a defined bean, or the id if none.
 java.lang.String propertyDescription(java.lang.String propertyName)
          Gets the localized description of a property of a defined bean, or null if none.
 java.lang.String propertyLabel(java.lang.String propertyName)
          Gets the localized label of a property of a defined bean, or null if none.
 java.lang.String propertyString(java.lang.String propertyName, java.lang.String kind)
          Gets a localized string for a property of a defined bean.
 void setStrings(java.util.Map<java.lang.String,java.lang.String> strings)
           
 java.lang.String string(java.lang.String name)
          Gets a resource string for a defined bean.
 java.lang.String toString()
           
 
Methods inherited from class oracle.jdeveloper.audit.extension.Definition
getColumnNumber, getExtensionId, getLineNumber, getPublicId, getSystemId, isExtensionLoaded, log, log
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, 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
Method Detail

getExtensionBundle

public ExtensionBundle getExtensionBundle()

getId

public java.lang.String getId()

getName

public java.lang.String getName()

getDeprecatedIds

public java.util.List<java.lang.String> getDeprecatedIds()

addDeprecatedId

public void addDeprecatedId(java.lang.String id)

getStrings

public java.util.Map<java.lang.String,java.lang.String> getStrings()

setStrings

public void setStrings(java.util.Map<java.lang.String,java.lang.String> strings)

addString

public void addString(java.lang.String key,
                      java.lang.String value)

labelOrId

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

See Also:
label(), LABEL_KEY

label

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

See Also:
LABEL_KEY

description

public java.lang.String description()
Gets the localized description of a defined 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 a defined 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 a defined bean, or null if none.

See Also:
DESCRIPTION_KEY

string

public java.lang.String string(java.lang.String name)
Gets a resource string for a defined 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 a defined 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,
                                        java.lang.Object context)
Gets a localized string for a defined 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 a defined 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

propertyString

public java.lang.String propertyString(java.lang.String propertyName,
                                       java.lang.String kind)
Gets a localized string for a property of a defined bean.

Parameters:
kind - the bean-defined kind of localized string to get.
propertyName - the name of the property.

instantiate

public static java.lang.String instantiate(java.lang.String message,
                                           java.lang.Object bean,
                                           boolean erase)
Instantiate a localized string from a template string and an object. The template string is copied to the instantiated string except for property names enclosed in braces, which are replaced in the instantiated string by the result of invoking getValue(java.lang.String, int, int, java.lang.Object) with the property name and the object.

If erase is true and getValue returns null, immediately surrounding pairs of single or double quotes are erased and extra spaces are collapsed. This behavior in many cases allows a template string to instantiate acceptably both when properties are available and when they are not.


getValue

protected static java.lang.Object getValue(java.lang.String string,
                                           int first,
                                           int last,
                                           java.lang.Object bean)
Gets the value of a property of an object.
  • For objects which do not implement Violation or Map, the value is the value returned by the getter method corresponding to the property name, or null if no getter method exists or if it throws an exception.
  • For objects which implement Violation, the value is determined as follows:
    • If the property "name" is actually a number, the value is the parameter of the Violation with the indicated index, or null if the index is too large.
    • Otherwise, if the property name matches the name of a parameter of the Violation, the value is the value of that parameter.
    • Otherwise, the value is the value returned by the getter method corresponding to the property name, or null if no getter method exists or if it throws an exception.
  • For objects which implement Map, the value is the value returned by Map.get(java.lang.Object) using the property name as the key.

Parameters:
string - A string containing the property name.
first - The index of the first character of the property name.
last - The index of the first character following the property name.
bean - The object from which to get property values.

getElementName

public java.lang.String getElementName()

equals

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

hashCode

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

toString

public java.lang.String toString()
Overrides:
toString in class Definition

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

E17493-01

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