Top Description Inners Fields Constructors Methods
com.sun.star.comp.loader

public Class FactoryHelper

extends Object
Class Inheritance
Imports
java.lang.reflect.Constructor, .Field, .InvocationTargetException, com.sun.star.uno.XComponentContext, com.sun.star.lang.XInitialization, com.sun.star.lang.XMultiServiceFactory, com.sun.star.lang.XServiceInfo, com.sun.star.lang.XSingleServiceFactory, com.sun.star.lang.XSingleComponentFactory, com.sun.star.lang.XTypeProvider, com.sun.star.registry.XRegistryKey, com.sun.star.uno.UnoRuntime, .Type

The purpose of this class to help component implementation.

This class has default implementations for getServiceFactory and writeRegistryServiceInfo.

Since
UDK1.0
See Also
com.sun.star.lang.XMultiServiceFactory, com.sun.star.lang.XServiceInfo, com.sun.star.lang.XSingleServiceFactory, com.sun.star.registry.XRegistryKey

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class

Field Summary

Modifier and TypeField and Description
private static final boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Object

Returns:

returns a factory object.
createComponentFactory
(Class<?>
the implementing class.
implClass
,
String serviceName)

Creates a factory for the given class.

public static com.sun.star.lang.XSingleServiceFactory

Returns:

returns a factory.
getServiceFactory
(Class<?>
the implementing class.
implClass
,
com.sun.star.lang.XMultiServiceFactory
the given multi service factory (service manager).
multiFactory
,
com.sun.star.registry.XRegistryKey
the given registry key.
regKey
)
Deprecated as of UDK 1.0

Creates a factory for the given class.

public static com.sun.star.lang.XSingleServiceFactory

Returns:

returns a factory.
getServiceFactory
(Class<?>
the implementing class.
implClass
,
String
the service name of the implementing class.
serviceName
,
com.sun.star.lang.XMultiServiceFactory
the given multi service factory (service manager).
multiFactory
,
com.sun.star.registry.XRegistryKey
the given registry key.
regKey
)

Creates a factory for the given class.

public static boolean

Returns:

success.
writeRegistryServiceInfo
(String
the name of the implementing class.
implName
,
String
the service name.
serviceName
,
com.sun.star.registry.XRegistryKey
the given registry key.
regKey
)

Writes the registration data into the registry key.

public static boolean

Returns:

success.
writeRegistryServiceInfo
(String
name of implementation.
impl_name
,
String[]
supported services of implementation.
supported_services
,
com.sun.star.registry.XRegistryKey
registry key to write to.
xKey
)

Writes the registration data into the registry key.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEBUGback to summary
private static final boolean DEBUG

Constructor Detail

FactoryHelperback to summary
public FactoryHelper()

Method Detail

createComponentFactoryback to summary
public static Object createComponentFactory(Class<?> implClass, String serviceName)

Creates a factory for the given class.

Parameters
implClass:Class<?>

the implementing class.

Returns:Object

returns a factory object.

getServiceFactoryback to summary
public static com.sun.star.lang.XSingleServiceFactory getServiceFactory(Class<?> implClass, com.sun.star.lang.XMultiServiceFactory multiFactory, com.sun.star.registry.XRegistryKey regKey)

Deprecated

as of UDK 1.0

Creates a factory for the given class.

Parameters
implClass:Class<?>

the implementing class.

multiFactory:com.sun.star.lang.XMultiServiceFactory

the given multi service factory (service manager).

regKey:com.sun.star.registry.XRegistryKey

the given registry key.

Returns:com.sun.star.lang.XSingleServiceFactory

returns a factory.

Annotations
@Deprecated
See Also
com.sun.star.lang.XServiceInfo
getServiceFactoryback to summary
public static com.sun.star.lang.XSingleServiceFactory getServiceFactory(Class<?> implClass, String serviceName, com.sun.star.lang.XMultiServiceFactory multiFactory, com.sun.star.registry.XRegistryKey regKey)

Creates a factory for the given class.

Parameters
implClass:Class<?>

the implementing class.

serviceName:String

the service name of the implementing class.

multiFactory:com.sun.star.lang.XMultiServiceFactory

the given multi service factory (service manager).

regKey:com.sun.star.registry.XRegistryKey

the given registry key.

Returns:com.sun.star.lang.XSingleServiceFactory

returns a factory.

See Also
com.sun.star.lang.XServiceInfo
writeRegistryServiceInfoback to summary
public static boolean writeRegistryServiceInfo(String implName, String serviceName, com.sun.star.registry.XRegistryKey regKey)

Writes the registration data into the registry key.

Parameters
implName:String

the name of the implementing class.

serviceName:String

the service name.

regKey:com.sun.star.registry.XRegistryKey

the given registry key.

Returns:boolean

success.

See Also
com.sun.star.lang.XServiceInfo
writeRegistryServiceInfoback to summary
public static boolean writeRegistryServiceInfo(String impl_name, String[] supported_services, com.sun.star.registry.XRegistryKey xKey)

Writes the registration data into the registry key.

Several services are supported.

Parameters
impl_name:String

name of implementation.

supported_services:String[]

supported services of implementation.

xKey:com.sun.star.registry.XRegistryKey

registry key to write to.

Returns:boolean

success.

com.sun.star.comp.loader back to summary

protected Class FactoryHelper.Factory

extends Object
implements com.sun.star.lang.XSingleServiceFactory, com.sun.star.lang.XSingleComponentFactory, com.sun.star.lang.XServiceInfo, com.sun.star.lang.XTypeProvider
Class Inheritance

Field Summary

Modifier and TypeField and Description
protected Constructor<?>
protected String
protected int
protected String
protected com.sun.star.lang.XMultiServiceFactory
protected com.sun.star.registry.XRegistryKey

Constructor Summary

AccessConstructor and Description
protected
Factory(Class<?> implClass, String serviceName, com.sun.star.lang.XMultiServiceFactory xMultiServiceFactory, com.sun.star.registry.XRegistryKey xRegistryKey)

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

returns an instance of the desired service.
createInstance
()

Creates an instance of the desired service.

public Object

Returns:

returns an instance of the desired service.
createInstanceWithArguments
(Object[]
the args given to the constructor of the service.
args
)

Creates an instance of the desired service.

public Object
createInstanceWithArgumentsAndContext(Object[] rArguments, com.sun.star.uno.XComponentContext xContext)

public Object
createInstanceWithContext(com.sun.star.uno.XComponentContext xContext)

public byte[]
public String

Returns:

returns the implementation name.
getImplementationName
()

Gives the implementation name.

private final com.sun.star.lang.XMultiServiceFactory
getSMgr(com.sun.star.uno.XComponentContext xContext)

public String[]

Returns:

returns an array of supported services.
getSupportedServiceNames
()

Gives the supported services.

public Type[]
public boolean

Returns:

returns true if the given service is supported.
supportsService
(String serviceName)

Indicates if the given service is supported.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_constructorback to summary
protected Constructor<?> _constructor
_implNameback to summary
protected String _implName
_nCodeback to summary
protected int _nCode
_serviceNameback to summary
protected String _serviceName
_xMultiServiceFactoryback to summary
protected com.sun.star.lang.XMultiServiceFactory _xMultiServiceFactory
_xRegistryKeyback to summary
protected com.sun.star.registry.XRegistryKey _xRegistryKey

Constructor Detail

Factoryback to summary
protected Factory(Class<?> implClass, String serviceName, com.sun.star.lang.XMultiServiceFactory xMultiServiceFactory, com.sun.star.registry.XRegistryKey xRegistryKey)

Method Detail

createInstanceback to summary
public Object createInstance() throws com.sun.star.uno.Exception, com.sun.star.uno.RuntimeException

Creates an instance of the desired service.

Returns:Object

returns an instance of the desired service.

See Also
com.sun.star.lang.XSingleServiceFactory
createInstanceWithArgumentsback to summary
public Object createInstanceWithArguments(Object[] args) throws com.sun.star.uno.Exception, com.sun.star.uno.RuntimeException

Creates an instance of the desired service.

Parameters
args:Object[]

the args given to the constructor of the service.

Returns:Object

returns an instance of the desired service.

See Also
com.sun.star.lang.XSingleServiceFactory
createInstanceWithArgumentsAndContextback to summary
public Object createInstanceWithArgumentsAndContext(Object[] rArguments, com.sun.star.uno.XComponentContext xContext) throws com.sun.star.uno.Exception
createInstanceWithContextback to summary
public Object createInstanceWithContext(com.sun.star.uno.XComponentContext xContext) throws com.sun.star.uno.Exception
getImplementationIdback to summary
public byte[] getImplementationId()
getImplementationNameback to summary
public String getImplementationName() throws com.sun.star.uno.RuntimeException

Gives the implementation name.

Returns:String

returns the implementation name.

See Also
com.sun.star.lang.XServiceInfo
getSMgrback to summary
private final com.sun.star.lang.XMultiServiceFactory getSMgr(com.sun.star.uno.XComponentContext xContext)
getSupportedServiceNamesback to summary
public String[] getSupportedServiceNames() throws com.sun.star.uno.RuntimeException

Gives the supported services.

Returns:String[]

returns an array of supported services.

See Also
com.sun.star.lang.XServiceInfo
getTypesback to summary
public Type[] getTypes()
supportsServiceback to summary
public boolean supportsService(String serviceName) throws com.sun.star.uno.RuntimeException

Indicates if the given service is supported.

Returns:boolean

returns true if the given service is supported.

See Also
com.sun.star.lang.XServiceInfo