1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ComponentContextEntry.java,v $
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.
34 A ComponentContextEntry is separated into a late-init and direct-value
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.
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
;
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.
57 object factory or service string
59 pass null (dummy separating from second ctor signature)
61 public ComponentContextEntry( Object lateInit
, Object value
)
63 this.m_lateInit
= lateInit
;
66 /** Creating a direct value component context entry.
71 public ComponentContextEntry( Object value
)
73 this.m_lateInit
= null;