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