@Test public void testVal() throws Exception { ETLStatistics etlStatistics = new ETLStatistics(); String val = null; CrsMultiMediaTransformer crsMultiMediaTransformer = new CrsMultiMediaTransformer(etlStatistics); CrsExtractor extractor = new CrsExtractor(multimediaFile, etlStatistics); for (XMLRecordInfo extracted : extractor) { CommonReflectionUtil.setField(AbstractTransformer.class, crsMultiMediaTransformer, "objectID", "RMNH.INS.867435"); CommonReflectionUtil.setField(AbstractTransformer.class, crsMultiMediaTransformer, "input", extracted); Element oaiDcElem = getDescendant(extracted.getRecord(), "oai_dc:dc"); List<Element> ncrsdatagroup = getDescendants(oaiDcElem, "ncrsdatagroup"); Element frmDigitaleBestandenElem = ncrsdatagroup.get(0); Object obj = ReflectionUtil.call(crsMultiMediaTransformer, "val", new Class[] {Element.class, String.class}, new Object[] {frmDigitaleBestandenElem, "dwc:sex"}); val = (String) obj; } assertNotNull("01", val); assertEquals("02", "male", val); }
private String val(Element e, String tag) { String s = getDescendantValue(e, tag); if (s == null) { if (logger.isDebugEnabled()) debug("No element <%s> under element <%s>", tag, e.getTagName()); return null; } return ((s = s.trim()).length() == 0 ? null : s); }
CrsMultiMediaTransformer extends AbstractXMLTransformer<MultiMediaObject> { private String val(Element e, String tag) { String s = getDescendantValue(e, tag); if (s == null) { if (logger.isDebugEnabled()) debug("No element <%s> under element <%s>", tag, e.getTagName()); return null; } return ((s = s.trim()).length() == 0 ? null : s); } }
CrsMultiMediaTransformer extends AbstractXMLTransformer<MultiMediaObject> { private String val(Element e, String tag) { String s = getDescendantValue(e, tag); if (s == null) { if (logger.isDebugEnabled()) debug("No element <%s> under element <%s>", tag, e.getTagName()); return null; } return ((s = s.trim()).length() == 0 ? null : s); } CrsMultiMediaTransformer(ETLStatistics stats); }
CrsMultiMediaTransformer extends AbstractXMLTransformer<MultiMediaObject> { private String val(Element e, String tag) { String s = getDescendantValue(e, tag); if (s == null) { if (logger.isDebugEnabled()) debug("No element <%s> under element <%s>", tag, e.getTagName()); return null; } return ((s = s.trim()).length() == 0 ? null : s); } CrsMultiMediaTransformer(ETLStatistics stats);  }
CrsMultiMediaTransformer extends AbstractXMLTransformer<MultiMediaObject> { private String val(Element e, String tag) { String s = getDescendantValue(e, tag); if (s == null) { if (logger.isDebugEnabled()) debug("No element <%s> under element <%s>", tag, e.getTagName()); return null; } return ((s = s.trim()).length() == 0 ? null : s); } CrsMultiMediaTransformer(ETLStatistics stats);   }