summaryrefslogtreecommitdiff
path: root/java/src/Ice/ObjectHolder.java
blob: 9201f7ce4afe809e5f8fcfb8dabd4c35baaa4543 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// **********************************************************************
//
// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

package Ice;

/**
 * Holder class for Ice objects that are in- or inout-parameters.
 **/
public final class ObjectHolder
{
    /**
     * Instantiates the class with a <code>null</code> value.
     **/
    public
    ObjectHolder()
    {
    }

    /**
     * Instantiates the class with the passed Ice object.
     **/
    public
    ObjectHolder(Ice.Object value)
    {
        this.value = value;
    }

    /**
     * This class allows the unmarshaling code to patch the reference
     * to the Ice object in this holder once the Ice object has been unmarshaled.
     **/
    public class Patcher implements IceInternal.Patcher
    {
	/**
	 * Sets the Ice object of this holder to the passed instance.
	 *
	 * @param v The new object for this holder.
	 **/
        public void
        patch(Ice.Object v)
        {
            value = v;
        }

	/**
	 * Returns the Slice type ID of the most-derived Slice type supported
	 * by this instance.
	 *
	 * @return The Slice type ID.
	 **/
        public String
        type()
        {
            return Ice.ObjectImpl.ice_staticId();
        }
    }

    /**
     * Returns the patcher for this Ice object.
     *
     * @return The patcher for this Ice object.
     **/
    public Patcher
    getPatcher()
    {
        return new Patcher();
    }

    /**
     * The Ice object stored by this holder.
     **/
    public Ice.Object value;
}