public final class Lo
extends java.lang.Object
Inspired by the work of Dr. Andrew Davison from the website Java LibreOffice Programming.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CALC_SERVICE |
static java.lang.String |
DRAW_SERVICE |
static java.lang.String |
IMPRESS_SERVICE |
static java.lang.String |
WEB_SERVICE |
static java.lang.String |
WRITER_SERVICE |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
createInstance(@NonNull com.sun.star.lang.XComponent component,
@NonNull java.lang.Class<T> type,
@NonNull java.lang.String serviceName)
Create an interface object of the given class from the given named service; uses given
XComponent and 'old' XMultiServiceFactory, so a document must have been already loaded/created.
|
static <T> T |
createInstance(@NonNull com.sun.star.uno.XComponentContext context,
@NonNull java.lang.Class<T> type,
@NonNull java.lang.String serviceName)
Create an interface object of the given class from the given named service; uses given
XComponentContext and 'new' XMultiComponentFactory so only a bridge to office is needed.
|
static <T> T |
createInstance(@NonNull com.sun.star.lang.XMultiServiceFactory factory,
@NonNull java.lang.Class<T> type,
@NonNull java.lang.String serviceName)
Create an interface object of the given class from the given named service; uses given 'old'
XMultiServiceFactory, so a document must have been already loaded/created.
|
static <T> T |
createInstanceMCF(@NonNull com.sun.star.uno.XComponentContext context,
@NonNull java.lang.Class<T> type,
@NonNull java.lang.String serviceName)
Deprecated.
Use
createInstance(XComponentContext, Class, String) instead. |
static <T> T |
createInstanceMSF(@NonNull com.sun.star.lang.XComponent component,
@NonNull java.lang.Class<T> type,
@NonNull java.lang.String serviceName)
Deprecated.
Use
createInstance(XComponent, Class, String) instead. |
static <T> T |
createInstanceMSF(@NonNull com.sun.star.lang.XMultiServiceFactory factory,
@NonNull java.lang.Class<T> type,
@NonNull java.lang.String serviceName)
Deprecated.
Use
createInstance(XMultiServiceFactory, Class, String) instead. |
static @NonNull com.sun.star.lang.XMultiServiceFactory |
getServiceFactory(@NonNull com.sun.star.lang.XComponent component)
Gets the XMultiServiceFactory for the given component.
|
static <T> T |
qi(@NonNull java.lang.Class<T> type,
@NonNull java.lang.Object object)
Queries the given UNO object for the given Java class (which must represent a UNO interface
type).
|
static <T> @NonNull java.util.Optional<T> |
qiOptional(@NonNull java.lang.Class<T> type,
@NonNull java.lang.Object object)
Queries the given UNO object for the given Java class (which must represent a UNO interface
type).
|
public static final java.lang.String WRITER_SERVICE
public static final java.lang.String WEB_SERVICE
public static final java.lang.String CALC_SERVICE
public static final java.lang.String DRAW_SERVICE
public static final java.lang.String IMPRESS_SERVICE
public static <T> T qi(@NonNull java.lang.Class<T> type,
@NonNull java.lang.Object object)
T - The requested UNO interface type.type - A Java class representing a UNO interface type; cannot be null.object - A reference to any Java object representing (a facet of) a UNO object; cannot be
null.UnoRuntime.queryInterface(Class, Object)public static <T> @NonNull java.util.Optional<T> qiOptional(@NonNull java.lang.Class<T> type,
@NonNull java.lang.Object object)
T - the requested UNO interface type.type - A Java class representing a UNO interface type; may be null.object - A reference to any Java object representing (a facet of) a UNO object; may be
null.null.UnoRuntime.queryInterface(Class, Object)public static @NonNull com.sun.star.lang.XMultiServiceFactory getServiceFactory(@NonNull com.sun.star.lang.XComponent component)
component - The component.public static <T> T createInstance(@NonNull com.sun.star.lang.XComponent component,
@NonNull java.lang.Class<T> type,
@NonNull java.lang.String serviceName)
T - The requested UNO interface type.component - The component.type - A Java class representing a UNO interface type.serviceName - The service name.null.WrappedUnoException - If an UNO exception occurs. The UNO exception will be the cause of
the WrappedUnoException.public static <T> T createInstance(@NonNull com.sun.star.lang.XMultiServiceFactory factory,
@NonNull java.lang.Class<T> type,
@NonNull java.lang.String serviceName)
T - The requested UNO interface type.factory - The service factory.type - A Java class representing a UNO interface type.serviceName - The service name.null.WrappedUnoException - If an UNO exception occurs. The UNO exception will be the cause of
the WrappedUnoException.public static <T> T createInstance(@NonNull com.sun.star.uno.XComponentContext context,
@NonNull java.lang.Class<T> type,
@NonNull java.lang.String serviceName)
T - The requested UNO interface type.context - The component context.type - A Java class representing a UNO interface type.serviceName - The service name.null.WrappedUnoException - If an UNO exception occurs. The UNO exception will be the cause of
the WrappedUnoException.public static <T> T createInstanceMSF(@NonNull com.sun.star.lang.XComponent component,
@NonNull java.lang.Class<T> type,
@NonNull java.lang.String serviceName)
createInstance(XComponent, Class, String) instead.T - The requested UNO interface type.component - The component.type - A Java class representing a UNO interface type.serviceName - The service name.null.WrappedUnoException - If an UNO exception occurs. The UNO exception will be the cause of
the WrappedUnoException.public static <T> T createInstanceMSF(@NonNull com.sun.star.lang.XMultiServiceFactory factory,
@NonNull java.lang.Class<T> type,
@NonNull java.lang.String serviceName)
createInstance(XMultiServiceFactory, Class, String) instead.T - The requested UNO interface type.factory - The service factory.type - A Java class representing a UNO interface type.serviceName - The service name.null.WrappedUnoException - If an UNO exception occurs. The UNO exception will be the cause of
the WrappedUnoException.@Deprecated
public static <T> T createInstanceMCF(@NonNull com.sun.star.uno.XComponentContext context,
@NonNull java.lang.Class<T> type,
@NonNull java.lang.String serviceName)
createInstance(XComponentContext, Class, String) instead.T - The requested UNO interface type.context - The component context.type - A Java class representing a UNO interface type.serviceName - The service name.null.WrappedUnoException - If an UNO exception occurs. The UNO exception will be the cause of
the WrappedUnoException.Copyright © 2022 - present; JODConverter. All rights reserved.