/** * Will parse an XML tag into {@link Object} then inform the {@link ParseWatcher} * The idea is to have a callback for a number of elements to create a {@link java.util.List} * This can be used when you want to parse attributes as well as the XML body into your object * * @param parser The parser you wish to parse the XML with * @param watcher The watcher on elements to be informed of object creation * @param <T> The type you wish to create from the XML body * @return {@link ElementFinder} */ public <T> ElementFinder<T> getListElementFinder(Parser<T> parser, ParseWatcher<T> watcher) { return new ListElementFinder<T>(parser, watcher); }
/** * Will parse the attributes off an XML tag, into {@link Object} then inform the {@link ParseWatcher} * The idea is to have a callback for a number of elements to create a {@link java.util.List} * * @param attributeMarshaller The marshaller to parse the attributes into your required type * @param watcher The watcher on elements to be informed of object creation * @param attrTags The tags of the attributes you wish to parse * @param <T> The type you wish to create from the XML body * @return {@link ElementFinder} */ public <T> ElementFinder<T> getListAttributeFinder(AttributeMarshaller<T> attributeMarshaller, ParseWatcher<T> watcher, String... attrTags) { return new ListElementFinder<T>(new BasicAttributeParser<T>(attributeMarshaller, attrTags), watcher); }
@Before public void setUp() throws Exception { initMocks(this); elementCreator = new ListElementFinder<Object>(mockParser, mockWatcher); }