org.omg.CORBA

Class StringValueHelper

public class StringValueHelper extends Object implements BoxedValueHelper

Provides helper operations for the String value type, treating a String as a CORBA value type rather than as a primitive type. The OMG specification states this may be convenient in some specific cases. The typecode is different, but the reading/writing format in this implementation is the same as for the ordinary string. This is that Sun's IDL compiler (v1.4) would generate.
Method Summary
static Stringextract(Any an_any)
Extract the string from the given Any.
Stringget_id()
Returns the String Value repository Id.
static Stringid()
Returns the String Value repository Id.
static voidinsert(Any an_any, String that)
Insert the string into the given Any.
static Stringread(InputStream in)
Reads a string as a value type.
Serializableread_value(InputStream istream)
Read the string value from the input stream.
static TypeCodetype()
Create and return the value box typecode, named "StringValue", with the content typecode being unbounded string.
static voidwrite(OutputStream out, String a_string)
Writes a string as a value type.
voidwrite_value(OutputStream ostream, Serializable a_string)
Write the given string value into the output stream.

Method Detail

extract

public static String extract(Any an_any)
Extract the string from the given Any. The operation requires Any to hold a String value and not a String.

Parameters: an_any an Any to extract from.

Returns: the extracted string.

get_id

public String get_id()
Returns the String Value repository Id.

Returns: "IDL:omg.org/CORBA/StringValue:1.0", always.

id

public static String id()
Returns the String Value repository Id.

Returns: "IDL:omg.org/CORBA/StringValue:1.0", always.

insert

public static void insert(Any an_any, String that)
Insert the string into the given Any. After the operation, the Any will have a String Value typecode and not a String typecode.

Parameters: an_any an Any to insert into. that a string to insert.

read

public static String read(InputStream in)
Reads a string as a value type.

Parameters: in a stream to read value from.

read_value

public Serializable read_value(InputStream istream)
Read the string value from the input stream.

Parameters: istream a stream to read from.

Returns: a string (delegates to read_string()).

type

public static TypeCode type()
Create and return the value box typecode, named "StringValue", with the content typecode being unbounded string.

write

public static void write(OutputStream out, String a_string)
Writes a string as a value type.

Parameters: out a stream to write value into. a_string a string to write.

write_value

public void write_value(OutputStream ostream, Serializable a_string)
Write the given string value into the output stream.

Parameters: ostream a stream to write into. a_string a string to write.