@Test( expected = ParseException.class ) public void testRectParsingException() throws Exception { Attributes attrs = mock( Attributes.class ); doReturn( "rect" ).when( attrs ).getValue( URI, "shape" ); doReturn( "5,30,25" ).when( attrs ).getValue( URI, "coords" ); handler.startParsing( attrs ); }
protected void startParsing( final Attributes attrs ) throws SAXException { super.startParsing( attrs ); final String shape = attrs.getValue( getUri(), "shape" ); final String coordinates = attrs.getValue( getUri(), "coords" ); final float[] coords = parseFloatArray( coordinates ); mapEntry = createMapEntry( shape, coords ); final int length = attrs.getLength(); for ( int i = 0; i < length; i++ ) { if ( "xmlns".equals( attrs.getQName( i ) ) || attrs.getQName( i ).startsWith( "xmlns:" ) ) { continue; } final String name = attrs.getLocalName( i ); if ( name.indexOf( ':' ) > -1 ) { continue; } final String namespace = attrs.getURI( i ); final String attributeValue = attrs.getValue( i ); if ( isSameNamespace( namespace ) ) { if ( "shape".equals( name ) ) { continue; } if ( "coords".equals( name ) ) { continue; } } mapEntry.setAttribute( namespace, name, attributeValue ); } }
AreaReadHandler extends AbstractXmlReadHandler { protected void startParsing( final Attributes attrs ) throws SAXException { super.startParsing( attrs ); final String shape = attrs.getValue( getUri(), "shape" ); final String coordinates = attrs.getValue( getUri(), "coords" ); final float[] coords = parseFloatArray( coordinates ); mapEntry = createMapEntry( shape, coords ); final int length = attrs.getLength(); for ( int i = 0; i < length; i++ ) { if ( "xmlns".equals( attrs.getQName( i ) ) || attrs.getQName( i ).startsWith( "xmlns:" ) ) { continue; } final String name = attrs.getLocalName( i ); if ( name.indexOf( ':' ) > -1 ) { continue; } final String namespace = attrs.getURI( i ); final String attributeValue = attrs.getValue( i ); if ( isSameNamespace( namespace ) ) { if ( "shape".equals( name ) ) { continue; } if ( "coords".equals( name ) ) { continue; } } mapEntry.setAttribute( namespace, name, attributeValue ); } } }
AreaReadHandler extends AbstractXmlReadHandler { protected void startParsing( final Attributes attrs ) throws SAXException { super.startParsing( attrs ); final String shape = attrs.getValue( getUri(), "shape" ); final String coordinates = attrs.getValue( getUri(), "coords" ); final float[] coords = parseFloatArray( coordinates ); mapEntry = createMapEntry( shape, coords ); final int length = attrs.getLength(); for ( int i = 0; i < length; i++ ) { if ( "xmlns".equals( attrs.getQName( i ) ) || attrs.getQName( i ).startsWith( "xmlns:" ) ) { continue; } final String name = attrs.getLocalName( i ); if ( name.indexOf( ':' ) > -1 ) { continue; } final String namespace = attrs.getURI( i ); final String attributeValue = attrs.getValue( i ); if ( isSameNamespace( namespace ) ) { if ( "shape".equals( name ) ) { continue; } if ( "coords".equals( name ) ) { continue; } } mapEntry.setAttribute( namespace, name, attributeValue ); } } AreaReadHandler(); }
AreaReadHandler extends AbstractXmlReadHandler { protected void startParsing( final Attributes attrs ) throws SAXException { super.startParsing( attrs ); final String shape = attrs.getValue( getUri(), "shape" ); final String coordinates = attrs.getValue( getUri(), "coords" ); final float[] coords = parseFloatArray( coordinates ); mapEntry = createMapEntry( shape, coords ); final int length = attrs.getLength(); for ( int i = 0; i < length; i++ ) { if ( "xmlns".equals( attrs.getQName( i ) ) || attrs.getQName( i ).startsWith( "xmlns:" ) ) { continue; } final String name = attrs.getLocalName( i ); if ( name.indexOf( ':' ) > -1 ) { continue; } final String namespace = attrs.getURI( i ); final String attributeValue = attrs.getValue( i ); if ( isSameNamespace( namespace ) ) { if ( "shape".equals( name ) ) { continue; } if ( "coords".equals( name ) ) { continue; } } mapEntry.setAttribute( namespace, name, attributeValue ); } } AreaReadHandler(); Object getObject(); }
AreaReadHandler extends AbstractXmlReadHandler { protected void startParsing( final Attributes attrs ) throws SAXException { super.startParsing( attrs ); final String shape = attrs.getValue( getUri(), "shape" ); final String coordinates = attrs.getValue( getUri(), "coords" ); final float[] coords = parseFloatArray( coordinates ); mapEntry = createMapEntry( shape, coords ); final int length = attrs.getLength(); for ( int i = 0; i < length; i++ ) { if ( "xmlns".equals( attrs.getQName( i ) ) || attrs.getQName( i ).startsWith( "xmlns:" ) ) { continue; } final String name = attrs.getLocalName( i ); if ( name.indexOf( ':' ) > -1 ) { continue; } final String namespace = attrs.getURI( i ); final String attributeValue = attrs.getValue( i ); if ( isSameNamespace( namespace ) ) { if ( "shape".equals( name ) ) { continue; } if ( "coords".equals( name ) ) { continue; } } mapEntry.setAttribute( namespace, name, attributeValue ); } } AreaReadHandler(); Object getObject();  }