From 84924806a3414e6725d43023c2fe04bc43cacecf Mon Sep 17 00:00:00 2001 From: Oliver Bolte Date: Fri, 18 Mar 2005 09:38:48 +0000 Subject: INTEGRATION: CWS cfgfix01 (1.5.8); FILE MERGED 2005/03/11 12:08:35 jb 1.5.8.2: #i31915# Recursive descent through hierarchy now handles sequences correctly 2005/03/10 13:42:44 jb 1.5.8.1: #i40684# Disable setUpdateExample as it does not work against the OOo 2 configuration schema. --- .../DevelopersGuide/Config/ConfigExamples.java | 44 +++++++++++++++++----- 1 file changed, 35 insertions(+), 9 deletions(-) (limited to 'odk/examples/DevelopersGuide/Config') diff --git a/odk/examples/DevelopersGuide/Config/ConfigExamples.java b/odk/examples/DevelopersGuide/Config/ConfigExamples.java index 5b80e8e81e82..6fe8aaee8342 100644 --- a/odk/examples/DevelopersGuide/Config/ConfigExamples.java +++ b/odk/examples/DevelopersGuide/Config/ConfigExamples.java @@ -2,9 +2,9 @@ * * $RCSfile: ConfigExamples.java,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: rt $ $Date: 2005-01-31 16:19:00 $ + * last change: $Author: obo $ $Date: 2005-03-18 10:38:48 $ * * The Contents of this file are made available subject to the terms of * the BSD license. @@ -527,10 +527,6 @@ public class ConfigExamples XHierarchicalName xElementPath = (XHierarchicalName) UnoRuntime.queryInterface(XHierarchicalName.class, xElement); - // temporary check, we have to check why XHierarchicalName isn't supported - if ( xElementPath == null ) - return; - String sPath = xElementPath.getHierarchicalName(); aProcessor.processStructuralElement( sPath, xElement); @@ -548,7 +544,7 @@ public class ConfigExamples Object aChild = xChildAccess.getByName( aElementNames[i] ); AnyConverter aAnyConv = new AnyConverter(); // is it a structural element (object) ... - if ( aAnyConv.isObject(aChild) ) + if ( aAnyConv.isObject(aChild) && !aAnyConv.isArray(aChild) ) { // then get an interface XInterface xChildElement = (XInterface)UnoRuntime.queryInterface(XInterface.class, aChild); @@ -608,8 +604,22 @@ public class ConfigExamples new IConfigurationProcessor () { /// prints Path and Value of properties public void processValueElement( String sPath_, Object aValue_ ) { - System.out.println("\tValue: " + sPath_ + " = " + aValue_); + if (new AnyConverter().isArray(aValue_)) + { + final Object [] aArray = (Object [])aValue_; + + System.out.print("\tValue: " + sPath_ + " = { "); + for (int i=0; i