Version 3.6.0.2, tag libreoffice-3.6.0.2
[LibreOffice.git] / javaunohelper / com / sun / star / comp / helper / ComponentContextEntry.java
blob52b116469f7a3ef16d6b4fdab8d60e7ced814a6d
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
27 package com.sun.star.comp.helper;
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>
39 public class ComponentContextEntry
41 /** if late init of service instance, set service name (String) or
42 component factory (XSingleComponentFactory), null otherwise
44 public Object m_lateInit;
45 /** set entry value
47 public Object m_value;
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.
53 @param lateInit
54 object factory or service string
55 @param value
56 pass null (dummy separating from second ctor signature)
58 public ComponentContextEntry( Object lateInit, Object value )
60 this.m_lateInit = lateInit;
61 this.m_value = value;
63 /** Creating a direct value component context entry.
65 @param value
66 pass null
68 public ComponentContextEntry( Object value )
70 this.m_lateInit = null;
71 this.m_value = value;