2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 package com
.sun
.star
.comp
.helper
;
20 /** Component context entry for constructing ComponentContext objects.
22 A ComponentContextEntry is separated into a late-init and direct-value
24 The first one is commonly used for singleton objects of the component
25 context, that are raised on first-time retrieval of the key.
26 You have to pass a com.sun.star.lang.XSingleComponentFactory
27 or string (=> service name) object for this.
30 public class ComponentContextEntry
32 /** if late init of service instance, set service name (String) or
33 component factory (XSingleComponentFactory), null otherwise
35 public Object m_lateInit
;
38 public Object m_value
;
40 /** Creating a late-init singleton entry component context entry.
41 The second parameter will be ignored and overwritten during
42 instantiation of the singleton instance.
45 object factory or service string
47 pass null (dummy separating from second constructor signature)
49 public ComponentContextEntry( Object lateInit
, Object value
)
51 this.m_lateInit
= lateInit
;
54 /** Creating a direct value component context entry.
59 public ComponentContextEntry( Object value
)
61 this.m_lateInit
= null;