Skip navigation links

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

E10663-03


oracle.rules.rl.exceptions
Class RLException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by oracle.rules.rl.exceptions.RLException

All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
FactClassException, MultipleInheritanceException, ParseException, RLRuntimeException, TypeCheckException

public class RLException
extends java.lang.Exception

Base RL exception.

See Also:
Serialized Form

Method Summary
 void addRLStackTraceElement(oracle.rules.rl.exceptions.RLStackTraceElement e)
           
 java.lang.Object[] getArgs()
          Get the message arguments for this localized exception message.
 int getColumn()
          Get the column number
 java.lang.String getDescription()
          Get the description of this exception
 int getLine()
          Get the line number where this exception occurred
 java.lang.String getMessage()
          Get the detailed message for this RLException.
 java.lang.String getMsgID()
          Get the message ID for this localized exception message.
 java.lang.String getSource()
          Get the input source of this exception
 void printRLStackTrace()
          Prints this RLException and an RL stack trace to System.err.
 void printRLStackTrace(java.io.PrintStream ps)
          Prints this RLException and an RL stack trace to specified PrintStream.
 void printRLStackTrace(java.io.PrintWriter pw)
          Prints this RLException and an RL stack trace to specified PrintWriter.
 void setColumn(int column)
          Deprecated.  
 void setLine(int line)
          Deprecated.  
 void setSource(java.lang.String source)
          Set the input source of this exception.

 

Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

 

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

 

Method Detail

addRLStackTraceElement

public void addRLStackTraceElement(oracle.rules.rl.exceptions.RLStackTraceElement e)

getMessage

public java.lang.String getMessage()
Get the detailed message for this RLException.
Overrides:
getMessage in class java.lang.Throwable
Returns:
the detailed message.

getDescription

public java.lang.String getDescription()
Get the description of this exception
Returns:
the description

getSource

public java.lang.String getSource()
Get the input source of this exception
Returns:
the input source

setSource

public void setSource(java.lang.String source)
Set the input source of this exception. This should only be used internally by the RL parser.
Parameters:
source - the input source

getLine

public int getLine()
Get the line number where this exception occurred
Returns:
the line number

setLine

public void setLine(int line)
Deprecated. 
Set the line number where this exception occurred
Parameters:
line - number

getColumn

public int getColumn()
Get the column number
Returns:
the column number

setColumn

public void setColumn(int column)
Deprecated. 
Set the column number
Parameters:
column - number

getMsgID

public java.lang.String getMsgID()
Get the message ID for this localized exception message. The message ID is the key in the message ResourceBundle.
Returns:
the message ID

getArgs

public java.lang.Object[] getArgs()
Get the message arguments for this localized exception message.
Returns:
the message arguments

printRLStackTrace

public void printRLStackTrace()
Prints this RLException and an RL stack trace to System.err. The first line contains the name of the RL exception followed by the detail message. Subsequent lines a stack trace of RL location identification and possibly Java stack trace if a root cause exception is a Java exception. The RL location consists of a line, column and source. The source is typically the ruleset name though it may contain a file name if the RL include statement is used. The following is a typical example.

RLNullPointerException: object cannot be null at line 12 column 13 in stackTraceContext /Rule(porsche)/Pattern(car)/Test[1] at line 17 column 5 in stackTraceContext

It was produced by the following RL code. ruleset stackTraceContext { class Car { String make; String model; } rule porsche { if (fact Car car && car.make.startsWith("Porsche")) { println(car.make + " " + car.model); } } assert(new Car()); } The first line of stack trace contains some extra context after the location message. This extra context is present for rule conditions, rule actions, functions, variables, and RL class definitions. It is there to assist with identifying the offending code in situations when RL is generated from a rule dictionary.

The XPath-ish format consists of an RL construct. If the construct is named, the name appears enclosed in parentheses. If a number, n, appears in brackets after a construct it indicates the nth line following the previous construct. Careful RL generation by the Rule SDK will place each so referenced construct on a separate line.

In the example RL stack trace, this indicates that the exception occurred in the first test following the pattern car in the rule porsche.


printRLStackTrace

public void printRLStackTrace(java.io.PrintStream ps)
Prints this RLException and an RL stack trace to specified PrintStream.
Parameters:
ps - the PrintStream to print to.

printRLStackTrace

public void printRLStackTrace(java.io.PrintWriter pw)
Prints this RLException and an RL stack trace to specified PrintWriter.
Parameters:
pw - the PrintWriter to print to.

Skip navigation links

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

E10663-03


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