public final class Props extends Object
Inspired by the work of Dr. Andrew Davison from the website Java LibreOffice Programming.
| Modifier and Type | Method and Description |
|---|---|
static Optional<Object> |
getProperty(Object obj,
String propName)
Gets a property value from the properties of the specified object.
|
static Optional<Object> |
getProperty(com.sun.star.beans.XPropertySet props,
String propName)
Gets a property value from the specified properties.
|
static com.sun.star.beans.PropertyValue[] |
makeProperties(String[] names,
Object[] values)
Creates an array of
PropertyValue with properties using the specified property names
and values. |
static com.sun.star.beans.PropertyValue[] |
makeProperties(String name,
Object value)
Creates an array of
PropertyValue with a single property using the specified property
name and value. |
static com.sun.star.beans.PropertyValue[] |
makeProperties(String name1,
Object value1,
String name2,
Object value2)
Creates an array of
PropertyValue with 2 properties using the specified property names
and values. |
public static Optional<Object> getProperty(Object obj, String propName)
obj - The object from which a property is get.propName - The property name to get.WrappedUnoException - If an UNO exception occurs. The UNO exception will be the cause of
the WrappedUnoException.public static Optional<Object> getProperty(com.sun.star.beans.XPropertySet props, String propName)
props - The XPropertySet from which a property is get.propName - The property name to get.WrappedUnoException - If an UNO exception occurs. The UNO exception will be the cause of
the WrappedUnoException.public static com.sun.star.beans.PropertyValue[] makeProperties(String name, Object value)
PropertyValue with a single property using the specified property
name and value.name - The property name.value - The property value.public static com.sun.star.beans.PropertyValue[] makeProperties(String name1, Object value1, String name2, Object value2)
PropertyValue with 2 properties using the specified property names
and values.name1 - The first property name.value1 - The first property value.name2 - The second property name.value2 - The second property value.public static com.sun.star.beans.PropertyValue[] makeProperties(String[] names, Object[] values)
PropertyValue with properties using the specified property names
and values.names - The property names.values - The property values.