Skip navigation links

Oracle Business Rules Java API Reference
10g (10.1.3.1.0)

B28966-01


oracle.rules.sdk.browser
Class SchemaBrowser

java.lang.Object
  extended byjava.util.AbstractMap
      extended byjava.util.HashMap
          extended byoracle.rules.sdk.browser.Browser
              extended byoracle.rules.sdk.browser.SchemaBrowser

All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class SchemaBrowser
extends Browser

Provides for browsing XML Schemas by mapping the schema to jaxb classes. The Jaxb classes may be loaded into the RuleDictionary to serve as FactTypes in Rule definitions.

Classes and jars are browsable after they have been made visible to SchemaBrowser's classpath by use of the jaxb schema compiler.
The jaxb schema compiler is invoked when the schema is added to the schema path list of the schema browser. The jaxb classes are contained in a user specified package name.
Each element of the schema is an an instance of a JaxbNodes or JavaPackages.
The JaxbNode and JavaPackageNode instances are organized into a collection that is returned by the NodeTable property. A NodeTable is collection the immedidate children of the top level of generated package names. The generated package names are created when schemas are added to the schema path.
The class hierarchy is represented by NodeTable that represents the children of each subsequent level in the hierarchy. A JavaPackageNode has a NodeTable representing its children. The children of a JPackage are other JPackage's and JaxbNode's. A JaxbNode has no children and therefore does not have a node table.
For a schema : x1 added with the pkg name of generated the structure will be, generated.x1 The nodes are accessed generated and x1 will be JPackage nodes. The elements of the schema will be JaxbNodes.
The exact mapping of a schema into jaxb class structure is dependet on the JAXB specification and the implementation.
Loading of a browsed class into the datamodel is the responsibility of JaxbNode and JPackageNode classes.

See Also:
Serialized Form

Field Summary
static java.lang.String PROP_CUSTOM_FILE_PATH
           
static java.lang.String PROP_NODE_TABLE
           
static java.lang.String PROP_OUTPUT_DIRECTORY
           
static java.lang.String PROP_SCHEMA_PATH
           
static java.lang.String PROP_TARGET_PACKAGE
           

 

Fields inherited from class oracle.rules.sdk.browser.Browser
PROP_EDITOR_DATA_MODEL, PROP_RULE_DICTIONARY

 

Constructor Summary
SchemaBrowser(RuleDictionary rd)
          Creates a Schema browser that is tied to a RuleDictionary instance.

 

Method Summary
 void addSchemaPath(java.lang.String addedPath, java.lang.String targetPackage, java.lang.String custFile, java.lang.String outdir)
          Inovke the jaxb compiler and Add the specified generation path to the list of classes to be browsed.
 void clearSchemaPath()
          Remove all user created entries from the schema path list.
 NodeTable getNodeTable()
          retrieves the NodeTable associated with the list of schema paths.
 java.lang.String[] getSchemaPath()
           
 void removeSchemaPath(java.lang.String pname)
          removes the specified the specifed schema from the list of schemas.

 

Methods inherited from class oracle.rules.sdk.browser.Browser
get, getDictionary, set

 

Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, isEmpty, keySet, put, putAll, remove, size, values

 

Methods inherited from class java.util.AbstractMap
equals, hashCode, toString

 

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

 

Methods inherited from interface java.util.Map
equals, hashCode

 

Field Detail

PROP_SCHEMA_PATH

public static java.lang.String PROP_SCHEMA_PATH

PROP_NODE_TABLE

public static java.lang.String PROP_NODE_TABLE

PROP_TARGET_PACKAGE

public static java.lang.String PROP_TARGET_PACKAGE

PROP_CUSTOM_FILE_PATH

public static java.lang.String PROP_CUSTOM_FILE_PATH

PROP_OUTPUT_DIRECTORY

public static java.lang.String PROP_OUTPUT_DIRECTORY

Constructor Detail

SchemaBrowser

public SchemaBrowser(RuleDictionary rd)
              throws RulesSDKException
Creates a Schema browser that is tied to a RuleDictionary instance.
Parameters:
rd - the RuleDicionary to be used when loading

Method Detail

addSchemaPath

public void addSchemaPath(java.lang.String addedPath,
                          java.lang.String targetPackage,
                          java.lang.String custFile,
                          java.lang.String outdir)
                   throws RulesSDKException
Inovke the jaxb compiler and Add the specified generation path to the list of classes to be browsed. The generation path is specified when adding the schema to the list.

Will throw an exception if the specified schema can not be compiled into jaxb classes.
Parameters:
addedPath - String denoting the schema path, may be a URL
targetPackage - String name specifying top level for generated jaxb
custFile - String containing the file name of a file with any jaxb custom bindings that apply to the schema
outdir - String specifying the output directory for jaxb compiler
Throws:
RulesSDKException - - jaxb compiler fails to convert the schema to jaxb

clearSchemaPath

public void clearSchemaPath()
                     throws RulesSDKException
Remove all user created entries from the schema path list.
Throws:
RulesSDKException

getSchemaPath

public java.lang.String[] getSchemaPath()

removeSchemaPath

public void removeSchemaPath(java.lang.String pname)
                      throws RulesSDKException
removes the specified the specifed schema from the list of schemas. The generated path will no longer appear in the top level nodes.
Parameters:
pname - a String containing the schema path name to be removed
Throws:
RulesSDKException - when path is not in the instance list

getNodeTable

public NodeTable getNodeTable()
                       throws RulesSDKException
retrieves the NodeTable associated with the list of schema paths. The NodeTable will contain a JavaPackageNode that corresponds to the package names of each of the schemas in the schema list.
Throws:
RulesSDKException

Skip navigation links

Oracle Business Rules Java API Reference
10g (10.1.3.1.0)

B28966-01


Copyright © 2006, Oracle. All rights reserved.