1*a5b190bfSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*a5b190bfSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*a5b190bfSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*a5b190bfSAndrew Rist * distributed with this work for additional information 6*a5b190bfSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*a5b190bfSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*a5b190bfSAndrew Rist * "License"); you may not use this file except in compliance 9*a5b190bfSAndrew Rist * with the License. You may obtain a copy of the License at 10*a5b190bfSAndrew Rist * 11*a5b190bfSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*a5b190bfSAndrew Rist * 13*a5b190bfSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*a5b190bfSAndrew Rist * software distributed under the License is distributed on an 15*a5b190bfSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*a5b190bfSAndrew Rist * KIND, either express or implied. See the License for the 17*a5b190bfSAndrew Rist * specific language governing permissions and limitations 18*a5b190bfSAndrew Rist * under the License. 19*a5b190bfSAndrew Rist * 20*a5b190bfSAndrew Rist *************************************************************/ 21*a5b190bfSAndrew Rist 22*a5b190bfSAndrew Rist 23cdf0e10cSrcweir package com.sun.star.comp.helper; 24cdf0e10cSrcweir 25cdf0e10cSrcweir /** Component context entry for constructing ComponentContext objects. 26cdf0e10cSrcweir <p> 27cdf0e10cSrcweir A ComponentContextEntry is separated into a late-init and direct-value 28cdf0e10cSrcweir purpose. 29cdf0e10cSrcweir The first one is commonly used for singleton objects of the component 30cdf0e10cSrcweir context, that are raised on first-time retrieval of the key. 31cdf0e10cSrcweir You have to pass a com.sun.star.lang.XSingleComponentFactory 32cdf0e10cSrcweir or string (=> service name) object for this. 33cdf0e10cSrcweir </p> 34cdf0e10cSrcweir */ 35cdf0e10cSrcweir public class ComponentContextEntry 36cdf0e10cSrcweir { 37cdf0e10cSrcweir /** if late init of service instance, set service name (String) or 38cdf0e10cSrcweir component factory (XSingleComponentFactory), null otherwise 39cdf0e10cSrcweir */ 40cdf0e10cSrcweir public Object m_lateInit; 41cdf0e10cSrcweir /** set entry value 42cdf0e10cSrcweir */ 43cdf0e10cSrcweir public Object m_value; 44cdf0e10cSrcweir 45cdf0e10cSrcweir /** Creating a late-init singleton entry component context entry. 46cdf0e10cSrcweir The second parameter will be ignored and overwritten during 47cdf0e10cSrcweir instanciation of the singleton instance. 48cdf0e10cSrcweir 49cdf0e10cSrcweir @param lateInit 50cdf0e10cSrcweir object factory or service string 51cdf0e10cSrcweir @param value 52cdf0e10cSrcweir pass null (dummy separating from second ctor signature) 53cdf0e10cSrcweir */ 54cdf0e10cSrcweir public ComponentContextEntry( Object lateInit, Object value ) 55cdf0e10cSrcweir { 56cdf0e10cSrcweir this.m_lateInit = lateInit; 57cdf0e10cSrcweir this.m_value = value; 58cdf0e10cSrcweir } 59cdf0e10cSrcweir /** Creating a direct value component context entry. 60cdf0e10cSrcweir 61cdf0e10cSrcweir @param value 62cdf0e10cSrcweir pass null 63cdf0e10cSrcweir */ 64cdf0e10cSrcweir public ComponentContextEntry( Object value ) 65cdf0e10cSrcweir { 66cdf0e10cSrcweir this.m_lateInit = null; 67cdf0e10cSrcweir this.m_value = value; 68cdf0e10cSrcweir } 69cdf0e10cSrcweir } 70