rdonkin 2004/01/26 14:20:02 Modified: betwixt/src/java/org/apache/commons/betwixt Tag: REFACTORING-BRANCH_2004-01-13 BeanProperty.java betwixt/src/java/org/apache/commons/betwixt/io Tag: REFACTORING-BRANCH_2004-01-13 AbstractBeanWriter.java betwixt/src/java/org/apache/commons/betwixt/io/read Tag: REFACTORING-BRANCH_2004-01-13 BeanBindAction.java betwixt/src/test/org/apache/commons/betwixt Tag: REFACTORING-BRANCH_2004-01-13 RSSBeanReader.java Log: Correct calls to deprecated methods. Revision Changes Path No revision No revision 1.4.2.6 +5 -6 jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/BeanProperty.java Index: BeanProperty.java =================================================================== RCS file: /home/cvs/jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/BeanProperty.java,v retrieving revision 1.4.2.5 retrieving revision 1.4.2.6 diff -u -r1.4.2.5 -r1.4.2.6 --- BeanProperty.java 24 Jan 2004 13:36:17 -0000 1.4.2.5 +++ BeanProperty.java 26 Jan 2004 22:20:01 -0000 1.4.2.6 @@ -325,13 +325,13 @@ IntrospectionConfiguration configuration, Expression propertyExpression) { + //TODO: need to clean the element descriptors so that the wrappers are plain ElementDescriptor result; ElementDescriptor loopDescriptor = new ElementDescriptor(); loopDescriptor.setContextExpression( new IteratorExpression( propertyExpression ) ); - loopDescriptor.setWrapCollectionsInElement( configuration.isWrapCollectionsInElement() ); loopDescriptor.setQualifiedName( "entry" ); // add elements for reading @@ -340,7 +340,6 @@ ElementDescriptor elementDescriptor = new ElementDescriptor(); - elementDescriptor.setWrapCollectionsInElement( configuration.isWrapCollectionsInElement() ); elementDescriptor.setElementDescriptors( new ElementDescriptor[] { loopDescriptor } ); result = elementDescriptor; No revision No revision 1.22.2.4 +10 -19 jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/io/AbstractBeanWriter.java Index: AbstractBeanWriter.java =================================================================== RCS file: /home/cvs/jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/io/AbstractBeanWriter.java,v retrieving revision 1.22.2.3 retrieving revision 1.22.2.4 diff -u -r1.22.2.3 -r1.22.2.4 --- AbstractBeanWriter.java 18 Jan 2004 12:30:58 -0000 1.22.2.3 +++ AbstractBeanWriter.java 26 Jan 2004 22:20:01 -0000 1.22.2.4 @@ -558,18 +558,16 @@ log.trace( "Element " + elementDescriptor + " is empty." ); } - if (elementDescriptor.isWrapCollectionsInElement()) { - startElement( + startElement( namespaceUri, localName, qualifiedName, new ElementAttributes( elementDescriptor, context )); - } - + writeElementContent( elementDescriptor, context ) ; - if ( elementDescriptor.isWrapCollectionsInElement() ) { - endElement( namespaceUri, localName, qualifiedName ); - } + + endElement( namespaceUri, localName, qualifiedName ); + } } @@ -644,14 +642,7 @@ SAXException, IntrospectionException { - if ( elementDescriptor.isWrapCollectionsInElement() ) { - writeAttributes( elementDescriptor, context ); - } - writeElementContent( elementDescriptor, context ); - if ( elementDescriptor.isWrapCollectionsInElement() ) { - endElement( uri, localName, qualifiedName ); - } } /** No revision No revision 1.1.2.3 +5 -12 jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/io/read/Attic/BeanBindAction.java Index: BeanBindAction.java =================================================================== RCS file: /home/cvs/jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/io/read/Attic/BeanBindAction.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- BeanBindAction.java 15 Jan 2004 20:21:21 -0000 1.1.2.2 +++ BeanBindAction.java 26 Jan 2004 22:20:01 -0000 1.1.2.3 @@ -430,13 +430,6 @@ try { XMLBeanInfo xmlInfo = context.getXMLIntrospector().introspect(beanClass); - if (log.isTraceEnabled()) { - log.trace( - "Is wrapped? " - + xmlInfo - .getElementDescriptor() - .isWrapCollectionsInElement()); - } return xmlInfo.getElementDescriptor(); } catch (Exception e) { No revision No revision 1.5.2.1 +1 -1 jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/RSSBeanReader.java Index: RSSBeanReader.java =================================================================== RCS file: /home/cvs/jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/RSSBeanReader.java,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -r1.5 -r1.5.2.1 --- RSSBeanReader.java 9 Oct 2003 20:52:07 -0000 1.5 +++ RSSBeanReader.java 26 Jan 2004 22:20:02 -0000 1.5.2.1 @@ -128,7 +128,7 @@ throw new Exception( "No bean read from the XML document!" ); } BeanWriter writer = new BeanWriter(); - writer.getXMLIntrospector().setAttributesForPrimitives(false); + writer.getXMLIntrospector().getConfiguration().setAttributesForPrimitives(false); writer.enablePrettyPrint(); writer.write( bean ); }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]