1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 package com.sun.star.comp.helper;
24 
25 /** Component context entry for constructing ComponentContext objects.
26     <p>
27     A ComponentContextEntry is separated into a late-init and direct-value
28     purpose.
29     The first one is commonly used for singleton objects of the component
30     context, that are raised on first-time retrieval of the key.
31     You have to pass a com.sun.star.lang.XSingleComponentFactory
32     or string (=&gt; service name) object for this.
33     </p>
34 */
35 public class ComponentContextEntry
36 {
37     /** if late init of service instance, set service name (String) or
38         component factory (XSingleComponentFactory), null otherwise
39     */
40     public Object m_lateInit;
41     /** set entry value
42     */
43     public Object m_value;
44 
45     /** Creating a late-init singleton entry component context entry.
46         The second parameter will be ignored and overwritten during
47         instanciation of the singleton instance.
48 
49         @param lateInit
50                object factory or service string
51         @param value
52                pass null (dummy separating from second ctor signature)
53     */
ComponentContextEntry( Object lateInit, Object value )54     public ComponentContextEntry( Object lateInit, Object value )
55     {
56         this.m_lateInit = lateInit;
57         this.m_value = value;
58     }
59     /** Creating a direct value component context entry.
60 
61         @param value
62                pass null
63     */
ComponentContextEntry( Object value )64     public ComponentContextEntry( Object value )
65     {
66         this.m_lateInit = null;
67         this.m_value = value;
68     }
69 }
70