- java.lang.Object
-
- org.omg.CORBA.NamedValue
-
public abstract class NamedValue extends Object
An object used in the DII and DSI to describe arguments and return values.NamedValue
objects are also used in theContext
object routines to pass lists of property names and values.A
NamedValue
object contains:- a name -- If the
NamedValue
object is used to describe arguments to a request, the name will be an argument identifier specified in the OMG IDL interface definition for the operation being described. - a value -- an
Any
object - an argument mode flag -- one of the following:
ARG_IN.value
ARG_OUT.value
ARG_INOUT.value
- zero -- if this
NamedValue
object represents a property in aContext
object rather than a parameter or return value
The class
NamedValue
has three methods, which access its fields. The following code fragment demonstrates creating aNamedValue
object and then accessing its fields:ORB orb = ORB.init(args, null); String s = "argument_1"; org.omg.CORBA.Any myAny = orb.create_any(); myAny.insert_long(12345); int in = org.omg.CORBA.ARG_IN.value; org.omg.CORBA.NamedValue nv = orb.create_named_value( s, myAny, in); System.out.println("This nv name is " + nv.name()); try { System.out.println("This nv value is " + nv.value().extract_long()); System.out.println("This nv flag is " + nv.flags()); } catch (org.omg.CORBA.BAD_OPERATION b) { System.out.println("extract failed"); }
If this code fragment were put into a
main
method, the output would be something like the following:This nv name is argument_1 This nv value is 12345 This nv flag is 1
Note that the method
value
returns anAny
object. In order to access thelong
contained in theAny
object, we used the methodextract_long
. - a name -- If the
-
-
Constructor Summary
Constructors Constructor and Description NamedValue()
-
-
-
Method Detail
-
name
public abstract String name()
Retrieves the name for thisNamedValue
object.- Returns:
- a
String
object representing the name of thisNamedValue
object
-
value
public abstract Any value()
Retrieves the value for thisNamedValue
object.- Returns:
- an
Any
object containing the value of thisNamedValue
object
-
flags
public abstract int flags()
Retrieves the argument mode flag for thisNamedValue
object.- Returns:
- an
int
representing the argument mode for thisNamedValue
object
-
-
Document created the 11/06/2005, last modified the 04/03/2020
Source of the printed document:https://www.gaudry.be/en/java-api-rf-org/omg/CORBA/NamedValue.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.