Class PropertySetMixin


  • public final class PropertySetMixin
    extends Object
    A helper mixin to implement certain UNO interfaces related to property set handling on top of the attributes of a given UNO interface type.

    A client will mix in this class by keeping a reference to an instance of this class, and forwarding all methods of (a subset of the interfaces) com.sun.star.beans.XPropertySet, com.sun.star.beans.XFastPropertySet, and com.sun.star.beans.XPropertyAccess to it.

    Client code should not use the monitors associated with instances of this class, as they are used for internal purposes.

    Since:
    UDK 3.2
    • Constructor Detail

      • PropertySetMixin

        public PropertySetMixin​(XComponentContext context,
                                XInterface object,
                                Type type,
                                String[] absentOptional)
        The constructor.
        Parameters:
        context - the component context used by this instance; must not be null, and must supply the com.sun.star.reflection.theCoreReflection and com.sun.star.reflection.theTypeDescriptionManager singletons
        object - the client UNO object into which this instance is mixed in; must not be null, and must support the given type
        type - the UNO interface type whose attributes are mapped to properties; must not be null, and must represent a UNO interface type
        absentOptional - a list of optional properties that are not present, and should thus not be visible via com.sun.star.beans.XPropertySet.getPropertySetInfo, com.sun.star.beans.XPropertySet.addPropertyChangeListener, com.sun.star.beans.XPropertySet.removePropertyChangeListener, com.sun.star.beans.XPropertySet.addVetoableChangeListener, and com.sun.star.beans.XPropertySet.removeVetoableChangeListener; null is treated the same as an empty list; if non-null, the given array must not be modified after it is passed to this constructor. For consistency reasons, the given absentOptional should only contain the names of attributes that represent optional properties that are not present (that is, the attribute getters and setters always throw a com.sun.star.beans.UnknownPropertyException), and should contain each such name only once. If an optional property is not present (that is, the corresponding attribute getter and setter always throw a com.sun.star.beans.UnknownPropertyException) but is not contained in the given absentOptional, then it will be visible via com.sun.star.beans.XPropertySet.getPropertySetInfo as a com.sun.star.beans.Property with a set com.sun.star.beans.PropertyAttribute.OPTIONAL. If the given object does not implement com.sun.star.beans.XPropertySet, then the given absentOptional is effectively ignored and can be null or empty.