// the result structure
GridOptions options = new GridOptions();
// accessing a single nested value
XHierarchicalPropertySet xProperties =
(XHierarchicalPropertySet)UnoRuntime.queryInterface(XHierarchicalPropertySet.class, xViewRoot);
Object aVisible = xProperties.getHierarchicalPropertyValue("Option/VisibleGrid");
options.visible = ((Boolean) aVisible).booleanValue();
// accessing a nested object and its subproperties
Object xSubdivision = xProperties.getHierarchicalPropertyValue("Subdivision");
XMultiPropertySet xSubdivProperties =
(XMultiPropertySet)UnoRuntime.queryInterface(XMultiPropertySet.class, xSubdivision);
// variables for multi-element access
String[] aElementNames = new String[2];
aElementNames[0] = "XAxis";
aElementNames[1] = "YAxis";
Object[] aElementValues = xSubdivProperties.getPropertyValues(aElementNames);
options.subdivision_x = ((Integer) aElementValues[0]).intValue();
options.subdivision_y = ((Integer) aElementValues[1]).intValue();
// accessing deeply nested subproperties
Object xResolution = xProperties.getHierarchicalPropertyValue("Resolution");
XMultiHierarchicalPropertySet xResolutionProperties =
(XMultiHierarchicalPropertySet)
UnoRuntime.queryInterface(XMultiHierarchicalPropertySet.class, xResolution);