rdonkin 2004/04/18 09:43:10 Modified: betwixt/src/java/org/apache/commons/betwixt/io/read Tag: REFACTORING-BRANCH_2004-01-13 BeanBindAction.java ReadContext.java betwixt/src/test/org/apache/commons/betwixt/io/read Tag: REFACTORING-BRANCH_2004-01-13 TestReadContext.java Log: Removed some unneccessary methods from the API (by making them private) and added some documentation. Revision Changes Path No revision No revision 1.1.2.9 +8 -11 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.8 retrieving revision 1.1.2.9 diff -u -r1.1.2.8 -r1.1.2.9 --- BeanBindAction.java 13 Mar 2004 19:19:43 -0000 1.1.2.8 +++ BeanBindAction.java 18 Apr 2004 16:43:10 -0000 1.1.2.9 @@ -182,8 +182,7 @@ } Updater updater = bodyTextdescriptor.getUpdater(); if (log.isTraceEnabled()) - { - + { log.trace("Updating mixed content with:"); log.trace(updater); } @@ -218,10 +217,8 @@ } if ( updater == null ) { - if (!context.isAtRootElement() && !context.isStackEmpty()) { - if ( context.getLog().isDebugEnabled() ) { - context.getLog().debug("Cannot find updater for " + context.getCurrentElement()); - } + if ( context.getLog().isTraceEnabled() ) { + context.getLog().trace("No updater for " + context.getCurrentElement()); } } else { updater.update(context, value); 1.4.2.7 +18 -25 jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/io/read/ReadContext.java Index: ReadContext.java =================================================================== RCS file: /home/cvs/jakarta-commons/betwixt/src/java/org/apache/commons/betwixt/io/read/ReadContext.java,v retrieving revision 1.4.2.6 retrieving revision 1.4.2.7 diff -u -r1.4.2.6 -r1.4.2.7 --- ReadContext.java 13 Mar 2004 19:19:43 -0000 1.4.2.6 +++ ReadContext.java 18 Apr 2004 16:43:10 -0000 1.4.2.7 @@ -79,8 +79,19 @@ import org.xml.sax.Attributes; /** - * Extends <code>Context</code> to provide read specific functionality. - * + * <p>Extends <code>Context</code> to provide read specific functionality.</p> + * <p> + * Three stacks are used to manage the reading: + * </p> + * <ul> + * <li><strong>Action mapping stack</strong> contains the [EMAIL PROTECTED] MappingAction}'s + * used to execute the mapping of the current element and it's ancesters back to the + * document root.</li> + * <li><strong>Result stack</strong> contains the objects which are bound + * to the current element and to each of it's ancester's back to the root</li> + * <li><strong>Element mapping stack</strong> records the names of the element + * and the classes to which they are bound</li> + * </ul> * @author Robert Burrell Donkin * @version $Revision$ */ @@ -256,7 +267,7 @@ * * @return an Iterator over String's */ - public Iterator getRelativeElementPathIterator() { + private Iterator getRelativeElementPathIterator() { return new RelativePathIterator(); } @@ -361,24 +372,6 @@ markClassMap(rootClass); } } - - /** - * Is the root element currently being mapped? - * @return true if the element being mapped is the root element - * but false if the stack is empty - */ - public boolean isAtRootElement() { - return (elementMappingStack.size() == 1); - } - - /** - * Is the element mapping stack empty? - * @return true if the element mapping stack is empty - */ - public boolean isStackEmpty() { - return (elementMappingStack.size() == 0); - } - /** * Marks the element name stack with a class mapping. No revision No revision 1.1.2.2 +9 -6 jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/io/read/Attic/TestReadContext.java Index: TestReadContext.java =================================================================== RCS file: /home/cvs/jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/io/read/Attic/TestReadContext.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- TestReadContext.java 13 Jan 2004 21:53:18 -0000 1.1.2.1 +++ TestReadContext.java 18 Apr 2004 16:43:10 -0000 1.1.2.2 @@ -181,7 +181,9 @@ context.markClassMap(Integer.class); assertEquals("Top class", Integer.class, context.getLastMappedClass()); } - + +/* Sad to say that the method tested has had to be made private. + * Maybe would be good to find a way to test the public void testRelativeElementPathBase() { ReadContext context = new ReadContext( @@ -282,4 +284,5 @@ assertEquals("Element name (3)", "gamma", elements.get(3)); } + */ }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]