@Test public void testDoneParsing() throws SAXException { Object objDefn = handler.getObject(); assertThat( objDefn, is( nullValue() ) ); handler.doneParsing(); objDefn = handler.getObject(); assertThat( objDefn, is( notNullValue() ) ); assertThat( objDefn, is( instanceOf( MailDefinition.class ) ) ); MailDefinition mailDefn = (MailDefinition) objDefn; assertThat( mailDefn.getAttachmentCount(), is( equalTo( 0 ) ) ); assertThat( mailDefn.getBodyReport(), is( nullValue() ) ); assertThat( mailDefn.getSessionProperties(), is( notNullValue() ) ); assertThat( mailDefn.getSessionProperties().isEmpty(), is( equalTo( true ) ) ); assertThat( mailDefn.getHeaderCount(), is( equalTo( 0 ) ) ); assertThat( mailDefn.getBurstQuery(), is( nullValue() ) ); assertThat( mailDefn.getParameterDefinition(), is( notNullValue() ) ); assertThat( mailDefn.getParameterDefinition().getParameterCount(), is( equalTo( 0 ) ) ); assertThat( mailDefn.getDataFactory(), is( notNullValue() ) ); }
protected void doneParsing() throws SAXException { mailDefinition = new MailDefinition(); if ( bodyReportReadHandler != null ) { mailDefinition.setBodyReport( bodyReportReadHandler.getTargetType(), bodyReportReadHandler.getReport() ); } for ( int i = 0; i < attachmentReportReadHandlers.size(); i++ ) { final ReportReadHandler handler = (ReportReadHandler) attachmentReportReadHandlers.get( i ); mailDefinition.addAttachmentReport( handler.getTargetType(), handler.getReport() ); } if ( sessionPropertiesReadHandler != null ) { mailDefinition.setSessionProperties( (Properties) sessionPropertiesReadHandler.getObject() ); } if ( headersReadHandler != null ) { final MailHeader[] headers = headersReadHandler.getHeaders(); for ( int i = 0; i < headers.length; i++ ) { mailDefinition.addHeader( headers[i] ); } } if ( burstQueryReadHandler != null ) { mailDefinition.setBurstQuery( burstQueryReadHandler.getResult() ); } if ( recipientsQueryReadHandler != null ) { mailDefinition.setBurstQuery( recipientsQueryReadHandler.getResult() ); } if ( parameterDefinitionReadHandler != null ) { mailDefinition.setParameterDefinition( (ReportParameterDefinition) parameterDefinitionReadHandler.getObject() ); } if ( dataSourceElementHandler != null ) { mailDefinition.getDataFactory().add( dataSourceElementHandler.getDataFactory() ); } }
MailDefinitionReadHandler extends AbstractXmlReadHandler { protected void doneParsing() throws SAXException { mailDefinition = new MailDefinition(); if ( bodyReportReadHandler != null ) { mailDefinition.setBodyReport( bodyReportReadHandler.getTargetType(), bodyReportReadHandler.getReport() ); } for ( int i = 0; i < attachmentReportReadHandlers.size(); i++ ) { final ReportReadHandler handler = (ReportReadHandler) attachmentReportReadHandlers.get( i ); mailDefinition.addAttachmentReport( handler.getTargetType(), handler.getReport() ); } if ( sessionPropertiesReadHandler != null ) { mailDefinition.setSessionProperties( (Properties) sessionPropertiesReadHandler.getObject() ); } if ( headersReadHandler != null ) { final MailHeader[] headers = headersReadHandler.getHeaders(); for ( int i = 0; i < headers.length; i++ ) { mailDefinition.addHeader( headers[i] ); } } if ( burstQueryReadHandler != null ) { mailDefinition.setBurstQuery( burstQueryReadHandler.getResult() ); } if ( recipientsQueryReadHandler != null ) { mailDefinition.setBurstQuery( recipientsQueryReadHandler.getResult() ); } if ( parameterDefinitionReadHandler != null ) { mailDefinition.setParameterDefinition( (ReportParameterDefinition) parameterDefinitionReadHandler.getObject() ); } if ( dataSourceElementHandler != null ) { mailDefinition.getDataFactory().add( dataSourceElementHandler.getDataFactory() ); } } }
MailDefinitionReadHandler extends AbstractXmlReadHandler { protected void doneParsing() throws SAXException { mailDefinition = new MailDefinition(); if ( bodyReportReadHandler != null ) { mailDefinition.setBodyReport( bodyReportReadHandler.getTargetType(), bodyReportReadHandler.getReport() ); } for ( int i = 0; i < attachmentReportReadHandlers.size(); i++ ) { final ReportReadHandler handler = (ReportReadHandler) attachmentReportReadHandlers.get( i ); mailDefinition.addAttachmentReport( handler.getTargetType(), handler.getReport() ); } if ( sessionPropertiesReadHandler != null ) { mailDefinition.setSessionProperties( (Properties) sessionPropertiesReadHandler.getObject() ); } if ( headersReadHandler != null ) { final MailHeader[] headers = headersReadHandler.getHeaders(); for ( int i = 0; i < headers.length; i++ ) { mailDefinition.addHeader( headers[i] ); } } if ( burstQueryReadHandler != null ) { mailDefinition.setBurstQuery( burstQueryReadHandler.getResult() ); } if ( recipientsQueryReadHandler != null ) { mailDefinition.setBurstQuery( recipientsQueryReadHandler.getResult() ); } if ( parameterDefinitionReadHandler != null ) { mailDefinition.setParameterDefinition( (ReportParameterDefinition) parameterDefinitionReadHandler.getObject() ); } if ( dataSourceElementHandler != null ) { mailDefinition.getDataFactory().add( dataSourceElementHandler.getDataFactory() ); } } MailDefinitionReadHandler(); }
MailDefinitionReadHandler extends AbstractXmlReadHandler { protected void doneParsing() throws SAXException { mailDefinition = new MailDefinition(); if ( bodyReportReadHandler != null ) { mailDefinition.setBodyReport( bodyReportReadHandler.getTargetType(), bodyReportReadHandler.getReport() ); } for ( int i = 0; i < attachmentReportReadHandlers.size(); i++ ) { final ReportReadHandler handler = (ReportReadHandler) attachmentReportReadHandlers.get( i ); mailDefinition.addAttachmentReport( handler.getTargetType(), handler.getReport() ); } if ( sessionPropertiesReadHandler != null ) { mailDefinition.setSessionProperties( (Properties) sessionPropertiesReadHandler.getObject() ); } if ( headersReadHandler != null ) { final MailHeader[] headers = headersReadHandler.getHeaders(); for ( int i = 0; i < headers.length; i++ ) { mailDefinition.addHeader( headers[i] ); } } if ( burstQueryReadHandler != null ) { mailDefinition.setBurstQuery( burstQueryReadHandler.getResult() ); } if ( recipientsQueryReadHandler != null ) { mailDefinition.setBurstQuery( recipientsQueryReadHandler.getResult() ); } if ( parameterDefinitionReadHandler != null ) { mailDefinition.setParameterDefinition( (ReportParameterDefinition) parameterDefinitionReadHandler.getObject() ); } if ( dataSourceElementHandler != null ) { mailDefinition.getDataFactory().add( dataSourceElementHandler.getDataFactory() ); } } MailDefinitionReadHandler(); Object getObject(); }
MailDefinitionReadHandler extends AbstractXmlReadHandler { protected void doneParsing() throws SAXException { mailDefinition = new MailDefinition(); if ( bodyReportReadHandler != null ) { mailDefinition.setBodyReport( bodyReportReadHandler.getTargetType(), bodyReportReadHandler.getReport() ); } for ( int i = 0; i < attachmentReportReadHandlers.size(); i++ ) { final ReportReadHandler handler = (ReportReadHandler) attachmentReportReadHandlers.get( i ); mailDefinition.addAttachmentReport( handler.getTargetType(), handler.getReport() ); } if ( sessionPropertiesReadHandler != null ) { mailDefinition.setSessionProperties( (Properties) sessionPropertiesReadHandler.getObject() ); } if ( headersReadHandler != null ) { final MailHeader[] headers = headersReadHandler.getHeaders(); for ( int i = 0; i < headers.length; i++ ) { mailDefinition.addHeader( headers[i] ); } } if ( burstQueryReadHandler != null ) { mailDefinition.setBurstQuery( burstQueryReadHandler.getResult() ); } if ( recipientsQueryReadHandler != null ) { mailDefinition.setBurstQuery( recipientsQueryReadHandler.getResult() ); } if ( parameterDefinitionReadHandler != null ) { mailDefinition.setParameterDefinition( (ReportParameterDefinition) parameterDefinitionReadHandler.getObject() ); } if ( dataSourceElementHandler != null ) { mailDefinition.getDataFactory().add( dataSourceElementHandler.getDataFactory() ); } } MailDefinitionReadHandler(); Object getObject();  }