org.omg.CORBA
Class StringValueHelper

java.lang.Object
  extended by org.omg.CORBA.StringValueHelper
All Implemented Interfaces:
BoxedValueHelper

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.


Constructor Summary
StringValueHelper()
           
 
Method Summary
static String extract(Any an_any)
          Extract the string from the given Any.
 String get_id()
          Returns the String Value repository Id.
static String id()
          Returns the String Value repository Id.
static void insert(Any an_any, String that)
          Insert the string into the given Any.
 Serializable read_value(InputStream istream)
          Read the string value from the input stream.
static String read(InputStream in)
          Reads a string as a value type.
static TypeCode type()
          Create and return the value box typecode, named "StringValue", with the content typecode being unbounded string.
 void write_value(OutputStream ostream, Serializable a_string)
          Write the given string value into the output stream.
static void write(OutputStream out, String a_string)
          Writes a string as a value type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringValueHelper

public StringValueHelper()
Method Detail

get_id

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

Specified by:
get_id in interface BoxedValueHelper
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.

read_value

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

Specified by:
read_value in interface BoxedValueHelper
Parameters:
istream - a stream to read from.
Returns:
a string (delegates to read_string()).

write_value

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

Specified by:
write_value in interface BoxedValueHelper
Parameters:
ostream - a stream to write into.
a_string - a string to write.

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.

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.

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.