@Test public void testGetHandlerForChild() throws Exception { Attributes attrs = mock( Attributes.class ); XmlReadHandler result = handler.getHandlerForChild( "incorrect_uri", TAG, attrs ); assertThat( result, is( nullValue() ) ); result = handler.getHandlerForChild( URI, TAG, attrs ); assertThat( result, is( nullValue() ) ); result = handler.getHandlerForChild( URI, "area", attrs ); assertThat( result, is( instanceOf( AreaReadHandler.class ) ) ); result.init( root, URI, TAG ); result.startElement( URI, TAG, createAreaAttrs() ); handler.doneParsing(); Object mapEntry = handler.getObject(); assertThat( mapEntry, is( instanceOf( ImageMap.class ) ) ); ImageMap entry = (ImageMap) mapEntry; assertThat( entry.getMapEntries().length, is( equalTo( 1 ) ) ); assertThat( entry.getMapEntries()[0], is( instanceOf( RectangleImageMapEntry.class ) ) ); }
protected XmlReadHandler getHandlerForChild( final String uri, final String tagName, final Attributes atts ) throws SAXException { if ( isSameNamespace( uri ) == false ) { return null; } if ( "area".equals( tagName ) ) { final AreaReadHandler readHandler = new AreaReadHandler(); readHandlerArrayList.add( readHandler ); return readHandler; } return null; }
ImageMapReadHandler extends AbstractXmlReadHandler { protected XmlReadHandler getHandlerForChild( final String uri, final String tagName, final Attributes atts ) throws SAXException { if ( isSameNamespace( uri ) == false ) { return null; } if ( "area".equals( tagName ) ) { final AreaReadHandler readHandler = new AreaReadHandler(); readHandlerArrayList.add( readHandler ); return readHandler; } return null; } }
ImageMapReadHandler extends AbstractXmlReadHandler { protected XmlReadHandler getHandlerForChild( final String uri, final String tagName, final Attributes atts ) throws SAXException { if ( isSameNamespace( uri ) == false ) { return null; } if ( "area".equals( tagName ) ) { final AreaReadHandler readHandler = new AreaReadHandler(); readHandlerArrayList.add( readHandler ); return readHandler; } return null; } ImageMapReadHandler(); }
ImageMapReadHandler extends AbstractXmlReadHandler { protected XmlReadHandler getHandlerForChild( final String uri, final String tagName, final Attributes atts ) throws SAXException { if ( isSameNamespace( uri ) == false ) { return null; } if ( "area".equals( tagName ) ) { final AreaReadHandler readHandler = new AreaReadHandler(); readHandlerArrayList.add( readHandler ); return readHandler; } return null; } ImageMapReadHandler(); Object getObject(); }
ImageMapReadHandler extends AbstractXmlReadHandler { protected XmlReadHandler getHandlerForChild( final String uri, final String tagName, final Attributes atts ) throws SAXException { if ( isSameNamespace( uri ) == false ) { return null; } if ( "area".equals( tagName ) ) { final AreaReadHandler readHandler = new AreaReadHandler(); readHandlerArrayList.add( readHandler ); return readHandler; } return null; } ImageMapReadHandler(); Object getObject();  }