Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.1.0)

E13403-02

oracle.ide.db.model
Class DBObjectNodeUtil

java.lang.Object
  extended by oracle.ide.db.model.DBObjectNodeUtil

public final class DBObjectNodeUtil
extends java.lang.Object

Utility methods for dealing with DBObjectNode instances. The various methods can make the job of handling DnD of nodes easier by providing quick test methods to see if the object in question is a valid node that matches a given object type. Specific tests are also provided for Relations as they could be objects of a number of types.


Method Summary
static java.lang.String decode(java.lang.String name, boolean store)
          Decodes the given String to get out the connection name (or alternatively store name).
static java.lang.String getConnectionName(java.lang.Object node)
          Returns the name of the connection if it is retrievable from the given object (node).
static java.lang.String getStoreName(java.lang.Object node)
          Returns the name of the store if it is retrievable from the given object (node).
static boolean isNodeOfType(java.lang.String type, java.lang.Object node)
          Returns true if the given object is a valid DBObjectNode that contains an object with the given type.
static boolean isOnlineNode(java.lang.Object node)
          Returns true if the given object is a valid DBObjectNode that has come from a live (online) database connection.
static boolean isOnlineNodeOfType(java.lang.String type, java.lang.Object node)
          Returns true if the given object is a valid DBObjectNode that contains an object with the given type AND that object has come from a live (online) database connection.
static boolean isOnlineRelationNode(java.lang.Object node)
          Returns true if the given object is a valid DBObjectNode that contains a Relation object (i.e.
static boolean isOnlineRelationNode(java.lang.Object node, boolean unwrapSynonym)
          Returns true if the given object is a valid DBObjectNode that contains a Relation object (i.e.
static boolean isRelationNode(java.lang.Object node)
          Returns true if the given object is a valid DBObjectNode that contains a Relation object (i.e.
static boolean isRelationNode(java.lang.Object node, boolean unwrapSynonym)
          Returns true if the given object is a valid DBObjectNode that contains a Relation object (i.e.
static boolean isSynonymNode(java.lang.Object node)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isNodeOfType

public static boolean isNodeOfType(java.lang.String type,
                                   java.lang.Object node)
Returns true if the given object is a valid DBObjectNode that contains an object with the given type.

Parameters:
type - the type of object we're looking for
node - the node to test for the object
Returns:
true if there's a match.

isOnlineNodeOfType

public static boolean isOnlineNodeOfType(java.lang.String type,
                                         java.lang.Object node)
Returns true if the given object is a valid DBObjectNode that contains an object with the given type AND that object has come from a live (online) database connection.

Parameters:
type - the type of object we're looking for
node - the node to test for the object
Returns:
true if there's a match.

isOnlineNode

public static boolean isOnlineNode(java.lang.Object node)
Returns true if the given object is a valid DBObjectNode that has come from a live (online) database connection.

Parameters:
node - the node to test for the object
Returns:
true if there's a match.

isRelationNode

public static boolean isRelationNode(java.lang.Object node)
Returns true if the given object is a valid DBObjectNode that contains a Relation object (i.e. Table, View or Materialized View).

Parameters:
node - the node to test for a Relation
Returns:
true if there's a match.
See Also:
isNodeOfType(java.lang.String, java.lang.Object)

isRelationNode

public static boolean isRelationNode(java.lang.Object node,
                                     boolean unwrapSynonym)
Returns true if the given object is a valid DBObjectNode that contains a Relation object (i.e. Table, View or Materialized View).

Parameters:
node - the node to test for a Relation
unwrapSynonym - resolve referenced object for Synonyms
Returns:
true if there's a match.
See Also:
isNodeOfType(java.lang.String, java.lang.Object)

isSynonymNode

public static boolean isSynonymNode(java.lang.Object node)

isOnlineRelationNode

public static boolean isOnlineRelationNode(java.lang.Object node)
Returns true if the given object is a valid DBObjectNode that contains a Relation object (i.e. Table, View or Materialized View) AND that Relation has come from a live (online) database connection.

Parameters:
node - the node to test for a Relation
Returns:
true if there's a match.
See Also:
isOnlineNodeOfType(java.lang.String, java.lang.Object)

isOnlineRelationNode

public static boolean isOnlineRelationNode(java.lang.Object node,
                                           boolean unwrapSynonym)
Returns true if the given object is a valid DBObjectNode that contains a Relation object (i.e. Table, View or Materialized View) AND that Relation has come from a live (online) database connection.

Parameters:
node - the node to test for a Relation
unwrapSynonym - resolve referenced object for Synonyms
Returns:
true if there's a match.
See Also:
isOnlineNodeOfType(java.lang.String, java.lang.Object)

getStoreName

public static java.lang.String getStoreName(java.lang.Object node)
Returns the name of the store if it is retrievable from the given object (node). This is not a full proof way of getting a store because some Views have an implicit store.

Parameters:
node - the node to to check
Returns:
the name of the store if implied by the node
See Also:
DatabaseConnectionStores.getCurrentStore()

getConnectionName

public static java.lang.String getConnectionName(java.lang.Object node)
Returns the name of the connection if it is retrievable from the given object (node).

Parameters:
node - the node to to check
Returns:
the name of the store if implied by the node
See Also:
DatabaseConnectionStores.getCurrentConnection(oracle.ide.Context)

decode

public static java.lang.String decode(java.lang.String name,
                                      boolean store)
Decodes the given String to get out the connection name (or alternatively store name). If the decoded string contains a '#' it is assumed that the store name preceeds it, and the connection name follows it.

Parameters:
name - the string to decode
store - if true, on decoding the string the store name is returned.
Returns:

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.1.0)

E13403-02

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