@Test public void testStartParsing() throws SAXException { XMLAttributesImpl attrs = new XMLAttributesImpl(); attrs.addAttribute( new QName( null, "name", null, URI ), ATTR_TYPE, NAME_VALUE ); attrs.addAttribute( new QName( null, "formula", null, URI ), ATTR_TYPE, FORMULA_VALUE ); AttributesProxy fAttributesProxy = new AttributesProxy( attrs ); handler.startParsing( fAttributesProxy ); Object result = handler.getObject(); assertThat( result, is( notNullValue() ) ); assertThat( result, is( CoreMatchers.instanceOf( FormulaHeader.class ) ) ); FormulaHeader formulaHeader = (FormulaHeader) result; assertThat( formulaHeader.getName(), is( equalTo( NAME_VALUE ) ) ); }
protected void startParsing( final Attributes attrs ) throws SAXException { name = attrs.getValue( getUri(), "name" ); if ( StringUtils.isEmpty( name ) ) { throw new ParseException( "Required attribute 'name' is missing.", getLocator() ); } value = attrs.getValue( getUri(), "formula" ); if ( StringUtils.isEmpty( value ) ) { throw new ParseException( "Required attribute 'formula' is missing.", getLocator() ); } }
FormulaHeaderReadHandler extends AbstractXmlReadHandler { protected void startParsing( final Attributes attrs ) throws SAXException { name = attrs.getValue( getUri(), "name" ); if ( StringUtils.isEmpty( name ) ) { throw new ParseException( "Required attribute 'name' is missing.", getLocator() ); } value = attrs.getValue( getUri(), "formula" ); if ( StringUtils.isEmpty( value ) ) { throw new ParseException( "Required attribute 'formula' is missing.", getLocator() ); } } }
FormulaHeaderReadHandler extends AbstractXmlReadHandler { protected void startParsing( final Attributes attrs ) throws SAXException { name = attrs.getValue( getUri(), "name" ); if ( StringUtils.isEmpty( name ) ) { throw new ParseException( "Required attribute 'name' is missing.", getLocator() ); } value = attrs.getValue( getUri(), "formula" ); if ( StringUtils.isEmpty( value ) ) { throw new ParseException( "Required attribute 'formula' is missing.", getLocator() ); } } FormulaHeaderReadHandler(); }
FormulaHeaderReadHandler extends AbstractXmlReadHandler { protected void startParsing( final Attributes attrs ) throws SAXException { name = attrs.getValue( getUri(), "name" ); if ( StringUtils.isEmpty( name ) ) { throw new ParseException( "Required attribute 'name' is missing.", getLocator() ); } value = attrs.getValue( getUri(), "formula" ); if ( StringUtils.isEmpty( value ) ) { throw new ParseException( "Required attribute 'formula' is missing.", getLocator() ); } } FormulaHeaderReadHandler(); Object getObject(); }
FormulaHeaderReadHandler extends AbstractXmlReadHandler { protected void startParsing( final Attributes attrs ) throws SAXException { name = attrs.getValue( getUri(), "name" ); if ( StringUtils.isEmpty( name ) ) { throw new ParseException( "Required attribute 'name' is missing.", getLocator() ); } value = attrs.getValue( getUri(), "formula" ); if ( StringUtils.isEmpty( value ) ) { throw new ParseException( "Required attribute 'formula' is missing.", getLocator() ); } } FormulaHeaderReadHandler(); Object getObject();  }