1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 package com.sun.star.comp.helper;
28 
29 /** Component context entry for constructing ComponentContext objects.
30     <p>
31     A ComponentContextEntry is separated into a late-init and direct-value
32     purpose.
33     The first one is commonly used for singleton objects of the component
34     context, that are raised on first-time retrieval of the key.
35     You have to pass a com.sun.star.lang.XSingleComponentFactory
36     or string (=> service name) object for this.
37     </p>
38 */
39 public class ComponentContextEntry
40 {
41     /** if late init of service instance, set service name (String) or
42         component factory (XSingleComponentFactory), null otherwise
43     */
44     public Object m_lateInit;
45     /** set entry value
46     */
47     public Object m_value;
48 
49     /** Creating a late-init singleton entry component context entry.
50         The second parameter will be ignored and overwritten during
51         instanciation of the singleton instance.
52 
53         @param lateInit
54                object factory or service string
55         @param value
56                pass null (dummy separating from second ctor signature)
57     */
58     public ComponentContextEntry( Object lateInit, Object value )
59     {
60         this.m_lateInit = lateInit;
61         this.m_value = value;
62     }
63     /** Creating a direct value component context entry.
64 
65         @param value
66                pass null
67     */
68     public ComponentContextEntry( Object value )
69     {
70         this.m_lateInit = null;
71         this.m_value = value;
72     }
73 }
74