Class ExceptionList
- java.lang.Object
-
- org.omg.CORBA.ExceptionList
-
public abstract class ExceptionList extends Object
An object used inRequest
operations to describe the exceptions that can be thrown by a method. It maintains a modifiable list ofTypeCode
s of the exceptions.The following code fragment demonstrates creating an
ExceptionList
object:ORB orb = ORB.init(args, null); org.omg.CORBA.ExceptionList excList = orb.create_exception_list();
The variableexcList
represents anExceptionList
object with noTypeCode
objects in it.To add items to the list, you first create a
TypeCode
object for the exception you want to include, using theORB
methodcreate_exception_tc
. Then you use theExceptionList
methodadd
to add it to the list. The classExceptionList
has a method for getting the number ofTypeCode
objects in the list, and after items have been added, it is possible to call methods for accessing or deleting an item at a designated index.- Since:
- JDK1.2
-
-
Constructor Summary
Constructors Constructor and Description ExceptionList()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description abstract void
add(TypeCode exc)
Adds aTypeCode
object describing an exception to thisExceptionList
object.abstract int
count()
Retrieves the number ofTypeCode
objects in thisExceptionList
object.abstract TypeCode
item(int index)
Returns theTypeCode
object at the given index.abstract void
remove(int index)
Removes theTypeCode
object at the given index.
-
-
-
Method Detail
count
public abstract int count()
Retrieves the number ofTypeCode
objects in thisExceptionList
object.- Returns:
-
the number of
TypeCode
objects in thisExceptionList
object
add
public abstract void add(TypeCode exc)
Adds aTypeCode
object describing an exception to thisExceptionList
object.- Parameters:
-
exc
- theTypeCode
object to be added
item
public abstract TypeCode item(int index) throws Bounds
Returns theTypeCode
object at the given index. The first item is at index 0.- Parameters:
-
index
- the index of theTypeCode
object desired. This must be anint
between 0 and the number ofTypeCode
objects minus one, inclusive. - Returns:
-
the
TypeCode
object at the given index - Throws:
-
Bounds
- if the index given is greater than or equal to the number ofTypeCode
objects in thisExceptionList
object
remove
public abstract void remove(int index) throws Bounds
Removes theTypeCode
object at the given index. Note that the indices of all theTypeCoded
objects following the one deleted are shifted down by one.- Parameters:
-
index
- the index of theTypeCode
object to be removed. This must be anint
between 0 and the number ofTypeCode
objects minus one, inclusive. - Throws:
-
Bounds
- if the index is greater than or equal to the number ofTypeCode
objects in thisExceptionList
object
-
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2022, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.