@Test public void testValidateThrowsNullPOinterException1() throws Throwable { try { new ISOBaseValidatingPackager().validate(new ISOField(100, "testISOBaseValidatingPackagerv")); fail("Expected ClassCastException to be thrown"); } catch (NullPointerException ex) { assertEquals(NullPointerException.class, ex.getClass(), "ex.getClass()"); } }
public ISOComponent validate(ISOComponent m) throws ISOException { LogEvent evt = new LogEvent( this, "validate" ); try { ISOComponent c; Map fields = m.getChildren(); for (ISOValidator aFldVld : fldVld) { if (aFldVld != null && (c = (ISOComponent) fields.get(Integer.valueOf(((ISOFieldValidator) aFldVld).getFieldId()))) != null) { try { m.set(aFldVld.validate(c)); } catch (ISOVException e) { if (!e.treated()) { m.set(e.getErrComponent()); e.setTreated(true); } evt.addMessage("Component Validation Error."); throw e; } } } try { if ( msgVld != null ){ for (ISOBaseValidator aMsgVld : this.msgVld) { if (aMsgVld != null) m = aMsgVld.validate(m); } } } catch (ISOVException ex) { evt.addMessage( "Component Validation Error." ); throw ex; } return m; } finally { Logger.log( evt ); } }
ISOBaseValidatingPackager extends ISOBasePackager implements ISOValidator { public ISOComponent validate(ISOComponent m) throws ISOException { LogEvent evt = new LogEvent( this, "validate" ); try { ISOComponent c; Map fields = m.getChildren(); for (ISOValidator aFldVld : fldVld) { if (aFldVld != null && (c = (ISOComponent) fields.get(Integer.valueOf(((ISOFieldValidator) aFldVld).getFieldId()))) != null) { try { m.set(aFldVld.validate(c)); } catch (ISOVException e) { if (!e.treated()) { m.set(e.getErrComponent()); e.setTreated(true); } evt.addMessage("Component Validation Error."); throw e; } } } try { if ( msgVld != null ){ for (ISOBaseValidator aMsgVld : this.msgVld) { if (aMsgVld != null) m = aMsgVld.validate(m); } } } catch (ISOVException ex) { evt.addMessage( "Component Validation Error." ); throw ex; } return m; } finally { Logger.log( evt ); } } }
ISOBaseValidatingPackager extends ISOBasePackager implements ISOValidator { public ISOComponent validate(ISOComponent m) throws ISOException { LogEvent evt = new LogEvent( this, "validate" ); try { ISOComponent c; Map fields = m.getChildren(); for (ISOValidator aFldVld : fldVld) { if (aFldVld != null && (c = (ISOComponent) fields.get(Integer.valueOf(((ISOFieldValidator) aFldVld).getFieldId()))) != null) { try { m.set(aFldVld.validate(c)); } catch (ISOVException e) { if (!e.treated()) { m.set(e.getErrComponent()); e.setTreated(true); } evt.addMessage("Component Validation Error."); throw e; } } } try { if ( msgVld != null ){ for (ISOBaseValidator aMsgVld : this.msgVld) { if (aMsgVld != null) m = aMsgVld.validate(m); } } } catch (ISOVException ex) { evt.addMessage( "Component Validation Error." ); throw ex; } return m; } finally { Logger.log( evt ); } } ISOBaseValidatingPackager(); }
ISOBaseValidatingPackager extends ISOBasePackager implements ISOValidator { public ISOComponent validate(ISOComponent m) throws ISOException { LogEvent evt = new LogEvent( this, "validate" ); try { ISOComponent c; Map fields = m.getChildren(); for (ISOValidator aFldVld : fldVld) { if (aFldVld != null && (c = (ISOComponent) fields.get(Integer.valueOf(((ISOFieldValidator) aFldVld).getFieldId()))) != null) { try { m.set(aFldVld.validate(c)); } catch (ISOVException e) { if (!e.treated()) { m.set(e.getErrComponent()); e.setTreated(true); } evt.addMessage("Component Validation Error."); throw e; } } } try { if ( msgVld != null ){ for (ISOBaseValidator aMsgVld : this.msgVld) { if (aMsgVld != null) m = aMsgVld.validate(m); } } } catch (ISOVException ex) { evt.addMessage( "Component Validation Error." ); throw ex; } return m; } finally { Logger.log( evt ); } } ISOBaseValidatingPackager(); ISOComponent validate(ISOComponent m); void setFieldValidator( ISOValidator[] fvlds ); void setMsgValidator( ISOBaseValidator[] msgVlds ); }
ISOBaseValidatingPackager extends ISOBasePackager implements ISOValidator { public ISOComponent validate(ISOComponent m) throws ISOException { LogEvent evt = new LogEvent( this, "validate" ); try { ISOComponent c; Map fields = m.getChildren(); for (ISOValidator aFldVld : fldVld) { if (aFldVld != null && (c = (ISOComponent) fields.get(Integer.valueOf(((ISOFieldValidator) aFldVld).getFieldId()))) != null) { try { m.set(aFldVld.validate(c)); } catch (ISOVException e) { if (!e.treated()) { m.set(e.getErrComponent()); e.setTreated(true); } evt.addMessage("Component Validation Error."); throw e; } } } try { if ( msgVld != null ){ for (ISOBaseValidator aMsgVld : this.msgVld) { if (aMsgVld != null) m = aMsgVld.validate(m); } } } catch (ISOVException ex) { evt.addMessage( "Component Validation Error." ); throw ex; } return m; } finally { Logger.log( evt ); } } ISOBaseValidatingPackager(); ISOComponent validate(ISOComponent m); void setFieldValidator( ISOValidator[] fvlds ); void setMsgValidator( ISOBaseValidator[] msgVlds );  }