Java Code Examples for org.omg.CORBA.TCKind.tk_wstring()

The following are Jave code examples for showing how to use tk_wstring() of the org.omg.CORBA.TCKind class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: OpenJSharp   File: AnyImpl.java   View Source Code Vote up 6 votes
/**
 * See the description of the <a href="#anyOps">general Any operations.</a>
 */
public void insert_wstring(String s)
{
    //debug.log ("insert_wstring");
    // Make sure type code information for bounded strings is not erased
    if (typeCode.kind() == TCKind.tk_wstring) {
        int length = 0;
        try {
            length = typeCode.length();
        } catch (BadKind bad) {
            throw wrapper.badkindCannotOccur() ;
        }

        // Check if bounded strings length is not exceeded
        if (length != 0 && s != null && s.length() > length) {
            throw wrapper.badStringBounds( new Integer(s.length()),
                new Integer(length) ) ;
        }
    } else {
        typeCode = orb.get_primitive_tc(TCKind._tk_wstring);
    }
    object = s;
    isInitialized = true;
}
 
Example 2
Project: openjdk-jdk10   File: AnyImpl.java   View Source Code Vote up 6 votes
/**
 * See the description of the <a href="#anyOps">general Any operations.</a>
 */
public void insert_wstring(String s)
{
    //debug.log ("insert_wstring");
    // Make sure type code information for bounded strings is not erased
    if (typeCode.kind() == TCKind.tk_wstring) {
        int length = 0;
        try {
            length = typeCode.length();
        } catch (BadKind bad) {
            throw wrapper.badkindCannotOccur() ;
        }

        // Check if bounded strings length is not exceeded
        if (length != 0 && s != null && s.length() > length) {
            throw wrapper.badStringBounds( new Integer(s.length()),
                new Integer(length) ) ;
        }
    } else {
        typeCode = orb.get_primitive_tc(TCKind._tk_wstring);
    }
    object = s;
    isInitialized = true;
}