Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Business Rules
11g Release 1 (11.1.1.5.0)

E10663-05


oracle.rules.sdk2.datamodel
Class ClassBrowser

java.lang.Object
  extended by oracle.rules.sdk2.datamodel.Browser
      extended by oracle.rules.sdk2.datamodel.ClassBrowser


public class ClassBrowser
extends Browser

Provides browsing for collections of Java class files. Any class accessed by the ClassBrowser may be imported into the datamodel of a RuleDictionary. Once Java classes have been imported, the class may be used as a FactType for an Oracle Business Rule.

Classes may be in Jar files or inside a directory containing .class files. Any class file not in a jar must be in a containing directory that is not part of the package hierarchy. For example, if the the class X is part of a package named javapkg.u.v, the ClassBrowser would expect the class file to be located in a directory structure like: containting-dir/javapkg/u/v/X.class .
The browsed classes need not be in the current RuleDictionary's DataModel.
Classes and jars are browsable after they have been made visible to ClassBrowser's classpath by use of the addClassPath method.
Each java class or package is represented by an instance of a JClassNode or JavaPackageNode.

Package Hierarchies

The JavaNode and JavaPackageNode instances are organized into a collection that is returned by the NestedNodeTable property. NodeTable's contain the Nodes representing the immedidate children. NodeTable hierarchies are created by adding to the ClassPath list. The addClassPath, removeClassPath, clearClassPath methods add, delete, and clear entries of the class path list. The class hierarchy is represented by nested NodeTable's. Each successive hierachy level is represented by a NodeTable. JavaPackageNode's have a NodeTable representing its children. The children of a JPackage are other JPackage's and JClassNode's. A JavaNode has no children and therefore does not have a node table.
Loading of a particular class into the datamodel is the responsibility of JClassNode and JPackageNode classes. Invoking the JClass load() or the JPackage load() methods cause the class or package to be loaded into the current DataModel.


Nested Class Summary
static class ClassBrowser.FailedClasspathAdd
           

 

Constructor Summary
ClassBrowser(RuleDictionary rd)
           
ClassBrowser(RuleDictionary rd, java.lang.String cpr)
          Deprecated. 
ClassBrowser(RuleDictionary rd, java.net.URI classpathPathRoot)
           

 

Method Summary
 void addClassPath(java.net.URI uri)
          Add the specified path to the set of paths that are searched for Java Classes to be browsed.
 void addFailedAdd(java.lang.String pathToAdd, SDKException ex)
           
 void clearClassPath()
          Remove all user created entries from the class path list used to create the list of packages and classes.
 java.util.List<java.net.URI> getClassPath()
          Return the list of class paths created by addClassPath.
 java.lang.String getClasspathPathRoot()
           
 java.util.List<ClassBrowser.FailedClasspathAdd> getFailedClasspathAdds()
           
 void removeClassPath(java.net.URI uriToRemove)
          remove the specified class path from the the classpath list.
 void setClasspathPathRoot(java.lang.String cpr)
          Deprecated. 
 void setClasspathPathRoot(java.net.URI cpr)
          Set the directory in which to put compiled JAXB class files in

 

Methods inherited from class oracle.rules.sdk2.datamodel.Browser
getDictionary, getNodeTable

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

ClassBrowser

public ClassBrowser(RuleDictionary rd)
             throws SDKException
Throws:
SDKException

ClassBrowser

public ClassBrowser(RuleDictionary rd,
                    java.net.URI classpathPathRoot)
             throws SDKException
Throws:
SDKException

ClassBrowser

@Deprecated
public ClassBrowser(RuleDictionary rd,
                               java.lang.String cpr)
             throws SDKException
Deprecated. 
create a ClassBrowser, with a RuleDictionary.
Throws:
SDKException

Method Detail

setClasspathPathRoot

public void setClasspathPathRoot(java.net.URI cpr)
Set the directory in which to put compiled JAXB class files in
Parameters:
cpr - the directory

setClasspathPathRoot

@Deprecated
public void setClasspathPathRoot(java.lang.String cpr)
Deprecated. 

getClasspathPathRoot

public java.lang.String getClasspathPathRoot()

getFailedClasspathAdds

public java.util.List<ClassBrowser.FailedClasspathAdd> getFailedClasspathAdds()

addFailedAdd

public void addFailedAdd(java.lang.String pathToAdd,
                         SDKException ex)

addClassPath

public void addClassPath(java.net.URI uri)
                  throws SDKException
Add the specified path to the set of paths that are searched for Java Classes to be browsed. The path may be a directory containing java classes or a jar file.
When specifying a Jar File, the complete path of the jar file must be specified (must include the jar file name).
When specifying a path for individual class files, the directory must be one level above the root of the package structure. For example, if a package exists named x.y.z and contains classes: Class1 and Class2, the ClassBrowser expects to x/y/z/Class1.class and x/y/z/Class2.class to exist and that the top level of the package will be contained in the directory specified in the path. Therefore, /some-dir/x/y/z/Class1.class and /some-dir/x/y/z/Class2.class must exist and the path /some-dir is the String that should be supplied to addClassPath.
Parameters:
uri - URI containing path to class or jar files
Throws:
SDKException - if the specified path does not contain valid Java Classes.

clearClassPath

public void clearClassPath()
                    throws SDKException
Remove all user created entries from the class path list used to create the list of packages and classes.
This does NOT remove the java packages (java, javax, org) classes from the list of available classes.
Throws:
SDKException

getClassPath

public java.util.List<java.net.URI> getClassPath()
Return the list of class paths created by addClassPath.
The java, javax, org packages not listed in the class path list, but are always included by the ClassBrowser.
Returns:
list of current URI paths

removeClassPath

public void removeClassPath(java.net.URI uriToRemove)
                     throws SDKException
remove the specified class path from the the classpath list. The classpath list controls the contents of the NodeTable.
Parameters:
uriToRemove - a String containing class path to be removed
Throws:
SDKException - when path is not in the instance list

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Business Rules
11g Release 1 (11.1.1.5.0)

E10663-05


Copyright © 2011, Oracle and/or its affiliates. All rights reserved.