org.omg.DynamicAny.DynAnyPackage.InvalidValue Java Examples

The following examples show how to use org.omg.DynamicAny.DynAnyPackage.InvalidValue. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DynAnyImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public void from_any (org.omg.CORBA.Any value)
     throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
            org.omg.DynamicAny.DynAnyPackage.InvalidValue
 {
     if (status == STATUS_DESTROYED) {
         throw wrapper.dynAnyDestroyed() ;
     }
     if ((any != null) && (! any.type().equal(value.type()))) {
         throw new TypeMismatch();
     }
     // If the passed Any does not contain a legal value
     // (such as a null string), the operation raises InvalidValue.
     Any tempAny = null;
     try {
         tempAny = DynAnyUtil.copy(value, orb);
     } catch (Exception e) {
         throw new InvalidValue();
     }
     if ( ! DynAnyUtil.isInitialized(tempAny)) {
         throw new InvalidValue();
     }
     any = tempAny;
}
 
Example #2
Source File: DynAnyBasicImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
public void insert_string(String value)
    throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
           org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (status == STATUS_DESTROYED) {
        throw wrapper.dynAnyDestroyed() ;
    }
    if (any.type().kind().value() != TCKind._tk_string)
        throw new TypeMismatch();
    if (value == null)
        throw new InvalidValue();
    // Throw InvalidValue if this is a bounded string and the length is exceeded
    try {
        if (any.type().length() > 0 && any.type().length() < value.length())
            throw new InvalidValue();
    } catch (BadKind bad) { // impossible
    }
    any.insert_string(value);
}
 
Example #3
Source File: DynAnyBasicImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public int get_ulong()
    throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
           org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (status == STATUS_DESTROYED) {
        throw wrapper.dynAnyDestroyed() ;
    }
    if (any.type().kind().value() != TCKind._tk_ulong)
        throw new TypeMismatch();
    return any.extract_ulong();
}
 
Example #4
Source File: DynAnyBasicImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public boolean get_boolean()
    throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
           org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (status == STATUS_DESTROYED) {
        throw wrapper.dynAnyDestroyed() ;
    }
    if (any.type().kind().value() != TCKind._tk_boolean)
        throw new TypeMismatch();
    return any.extract_boolean();
}
 
Example #5
Source File: DynAnyBasicImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public void insert_wchar(char value)
    throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
           org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (status == STATUS_DESTROYED) {
        throw wrapper.dynAnyDestroyed() ;
    }
    if (any.type().kind().value() != TCKind._tk_wchar)
        throw new TypeMismatch();
    any.insert_wchar(value);
}
 
Example #6
Source File: DynAnyBasicImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public char get_char()
    throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
           org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (status == STATUS_DESTROYED) {
        throw wrapper.dynAnyDestroyed() ;
    }
    if (any.type().kind().value() != TCKind._tk_char)
        throw new TypeMismatch();
    return any.extract_char();
}
 
Example #7
Source File: DynAnyBasicImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void insert_wchar(char value)
    throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
           org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (status == STATUS_DESTROYED) {
        throw wrapper.dynAnyDestroyed() ;
    }
    if (any.type().kind().value() != TCKind._tk_wchar)
        throw new TypeMismatch();
    any.insert_wchar(value);
}
 
Example #8
Source File: DynAnyConstructedImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public java.io.Serializable get_val()
    throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
           org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (status == STATUS_DESTROYED) {
        throw wrapper.dynAnyDestroyed() ;
    }
    if (index == NO_INDEX)
        throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
    DynAny currentComponent = current_component();
    if (DynAnyUtil.isConstructedDynAny(currentComponent))
        throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
    return currentComponent.get_val();
}
 
Example #9
Source File: DynAnyBasicImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public long get_ulonglong()
    throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
           org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (status == STATUS_DESTROYED) {
        throw wrapper.dynAnyDestroyed() ;
    }
    if (any.type().kind().value() != TCKind._tk_ulonglong)
        throw new TypeMismatch();
    return any.extract_ulonglong();
}
 
Example #10
Source File: DynAnyBasicImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void insert_val(java.io.Serializable value)
    throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
           org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (status == STATUS_DESTROYED) {
        throw wrapper.dynAnyDestroyed() ;
    }
    int kind = any.type().kind().value();
    if (kind != TCKind._tk_value && kind != TCKind._tk_value_box)
        throw new TypeMismatch();
    any.insert_Value(value);
}
 
Example #11
Source File: DynAnyConstructedImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public long get_ulonglong()
    throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
           org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (status == STATUS_DESTROYED) {
        throw wrapper.dynAnyDestroyed() ;
    }
    if (index == NO_INDEX)
        throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
    DynAny currentComponent = current_component();
    if (DynAnyUtil.isConstructedDynAny(currentComponent))
        throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
    return currentComponent.get_ulonglong();
}
 
Example #12
Source File: DynAnyBasicImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public short get_short()
    throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
           org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (status == STATUS_DESTROYED) {
        throw wrapper.dynAnyDestroyed() ;
    }
    if (any.type().kind().value() != TCKind._tk_short)
        throw new TypeMismatch();
    return any.extract_short();
}
 
Example #13
Source File: DynValueBoxImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public Any get_boxed_value()
    throws org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (isNull) {
        throw new InvalidValue();
    }
    checkInitAny();
    return any;
}
 
Example #14
Source File: DynAnyBasicImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public int get_long()
    throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
           org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (status == STATUS_DESTROYED) {
        throw wrapper.dynAnyDestroyed() ;
    }
    if (any.type().kind().value() != TCKind._tk_long)
        throw new TypeMismatch();
    return any.extract_long();
}
 
Example #15
Source File: DynAnyCollectionImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void set_elements_as_dyn_any (org.omg.DynamicAny.DynAny[] value)
    throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
           org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (status == STATUS_DESTROYED) {
        throw wrapper.dynAnyDestroyed() ;
    }
    checkValue(value);

    components = (value == null ? emptyComponents : value);
    anys = new Any[value.length];

    // We know that this is of kind tk_sequence or tk_array
    TypeCode expectedTypeCode = getContentType();
    for (int i=0; i<value.length; i++) {
        if (value[i] != null) {
            if (! value[i].type().equal(expectedTypeCode)) {
                clearData();
                // _REVISIT_ More info
                throw new TypeMismatch();
            }
            anys[i] = getAny(value[i]);
        } else {
            clearData();
            // _REVISIT_ More info
            throw new InvalidValue();
        }
    }
    index = (value.length == 0 ? NO_INDEX : 0);
    // Other representations are invalidated by this operation
    representations = REPRESENTATION_COMPONENTS;
}
 
Example #16
Source File: DynAnyComplexImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public TCKind current_member_kind ()
    throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
           org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (status == STATUS_DESTROYED) {
        throw wrapper.dynAnyDestroyed() ;
    }
    if( ! checkInitComponents() || index < 0 || index >= components.length) {
        throw new InvalidValue();
    }
    return components[index].type().kind();
}
 
Example #17
Source File: DynAnyBasicImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public char get_wchar()
    throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
           org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (status == STATUS_DESTROYED) {
        throw wrapper.dynAnyDestroyed() ;
    }
    if (any.type().kind().value() != TCKind._tk_wchar)
        throw new TypeMismatch();
    return any.extract_wchar();
}
 
Example #18
Source File: DynAnyBasicImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public byte get_octet()
    throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
           org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (status == STATUS_DESTROYED) {
        throw wrapper.dynAnyDestroyed() ;
    }
    if (any.type().kind().value() != TCKind._tk_octet)
        throw new TypeMismatch();
    return any.extract_octet();
}
 
Example #19
Source File: DynAnyBasicImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void insert_longlong(long value)
    throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
           org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (status == STATUS_DESTROYED) {
        throw wrapper.dynAnyDestroyed() ;
    }
    if (any.type().kind().value() != TCKind._tk_longlong)
        throw new TypeMismatch();
    any.insert_longlong(value);
}
 
Example #20
Source File: DynValueCommonImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public void set_members (org.omg.DynamicAny.NameValuePair[] value)
    throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
           org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    super.set_members(value);
    // If we didn't get an exception then this must be a valid non-null value
    isNull = false;
}
 
Example #21
Source File: DynValueCommonImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public org.omg.DynamicAny.NameDynAnyPair[] get_members_as_dyn_any ()
    throws org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (status == STATUS_DESTROYED) {
        throw wrapper.dynAnyDestroyed() ;
    }
    if (isNull) {
        throw new InvalidValue();
    }
    checkInitComponents();
    return nameDynAnyPairs;
}
 
Example #22
Source File: DynAnyBasicImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void insert_reference(org.omg.CORBA.Object value)
    throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
           org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (status == STATUS_DESTROYED) {
        throw wrapper.dynAnyDestroyed() ;
    }
    if (any.type().kind().value() != TCKind._tk_objref)
        throw new TypeMismatch();
    any.insert_Object(value);
}
 
Example #23
Source File: DynAnyBasicImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void insert_long(int value)
    throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
           org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (status == STATUS_DESTROYED) {
        throw wrapper.dynAnyDestroyed() ;
    }
    if (any.type().kind().value() != TCKind._tk_long)
        throw new TypeMismatch();
    any.insert_long(value);
}
 
Example #24
Source File: DynAnyConstructedImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void insert_ulonglong(long value)
    throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
           org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (status == STATUS_DESTROYED) {
        throw wrapper.dynAnyDestroyed() ;
    }
    if (index == NO_INDEX)
        throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue();
    DynAny currentComponent = current_component();
    if (DynAnyUtil.isConstructedDynAny(currentComponent))
        throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch();
    currentComponent.insert_ulonglong(value);
}
 
Example #25
Source File: DynAnyCollectionImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public void set_elements (org.omg.CORBA.Any[] value)
    throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
           org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (status == STATUS_DESTROYED) {
        throw wrapper.dynAnyDestroyed() ;
    }
    checkValue(value);

    components = new DynAny[value.length];
    anys = value;

    // We know that this is of kind tk_sequence or tk_array
    TypeCode expectedTypeCode = getContentType();
    for (int i=0; i<value.length; i++) {
        if (value[i] != null) {
            if (! value[i].type().equal(expectedTypeCode)) {
                clearData();
                // _REVISIT_ More info
                throw new TypeMismatch();
            }
            try {
                // Creates the appropriate subtype without copying the Any
                components[i] = DynAnyUtil.createMostDerivedDynAny(value[i], orb, false);
                //System.out.println(this + " created component " + components[i]);
            } catch (InconsistentTypeCode itc) {
                throw new InvalidValue();
            }
        } else {
            clearData();
            // _REVISIT_ More info
            throw new InvalidValue();
        }
    }
    index = (value.length == 0 ? NO_INDEX : 0);
    // Other representations are invalidated by this operation
    representations = REPRESENTATION_COMPONENTS;
}
 
Example #26
Source File: DynAnyBasicImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void from_any (org.omg.CORBA.Any value)
    throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
           org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (status == STATUS_DESTROYED) {
        throw wrapper.dynAnyDestroyed() ;
    }
    super.from_any(value);
    index = NO_INDEX;
}
 
Example #27
Source File: DynValueBoxImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public DynAny get_boxed_value_as_dyn_any()
    throws org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (isNull) {
        throw new InvalidValue();
    }
    checkInitComponents();
    return components[0];
}
 
Example #28
Source File: DynUnionImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public org.omg.CORBA.TCKind member_kind ()
    throws org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (status == STATUS_DESTROYED) {
        throw wrapper.dynAnyDestroyed() ;
    }
    if ( ! checkInitComponents() || currentMemberIndex == NO_INDEX)
        throw new InvalidValue();
    return memberType(currentMemberIndex).kind();
}
 
Example #29
Source File: DynUnionImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public String member_name ()
    throws org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (status == STATUS_DESTROYED) {
        throw wrapper.dynAnyDestroyed() ;
    }
    if ( ! checkInitComponents() || currentMemberIndex == NO_INDEX)
        throw new InvalidValue();
    String memberName = memberName(currentMemberIndex);
    return (memberName == null ? "" : memberName);
}
 
Example #30
Source File: DynAnyBasicImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public double get_double()
    throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
           org.omg.DynamicAny.DynAnyPackage.InvalidValue
{
    if (status == STATUS_DESTROYED) {
        throw wrapper.dynAnyDestroyed() ;
    }
    if (any.type().kind().value() != TCKind._tk_double)
        throw new TypeMismatch();
    return any.extract_double();
}