/** * Return the second (enclosed any) that is stored in the wrapped Any. */ public Any get_any() throws TypeMismatch { try { return ((AnyHolder) holder).value; } catch (ClassCastException cex) { TypeMismatch m = new TypeMismatch(); m.initCause(cex); throw m; } }
/** {@inheritDoc} */ public void insert_any(Any a_x) throws TypeMismatch, InvalidValue { try { if (a_x.type().kind().value() == TCKind._tk_null) ((AnyHolder) holder).value = a_x; else { OutputStream buf = a_x.create_output_stream(); buf.write_any(a_x); holder._read(buf.create_input_stream()); buf.close(); } valueChanged(); } catch (ClassCastException cex) { TypeMismatch t = new TypeMismatch(); t.initCause(cex); throw t; } catch (MARSHAL m) { InvalidValue v = new InvalidValue(); v.initCause(m); throw v; } catch (IOException ex) { throw new Unexpected(ex); } }
/** {@inheritDoc} */ public Any extract_any() throws BAD_OPERATION { check(TCKind._tk_any); return ((AnyHolder) has).value; }