Tabnine Logo
ListElementFinder
Code IndexAdd Tabnine to your IDE (free)

How to use
ListElementFinder
in
com.novoda.sexp.finder

Best Java code snippets using com.novoda.sexp.finder.ListElementFinder (Showing top 9 results out of 315)

origin: novoda/simple-easy-xml-parser

/**
 * 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);
}
origin: novoda/simple-easy-xml-parser

@Test(expected = UnsupportedOperationException.class)
public void notSupportGetResultOrThrow_asListCreatorWillCallbackAfterEveryListItemIsParsed() throws Exception {
  elementCreator.getResultOrThrow();
}
origin: novoda/simple-easy-xml-parser

@Test(expected = UnsupportedOperationException.class)
public void notSupportPopResult_asListCreatorWillCallbackAfterEveryListItemIsParsed() throws Exception {
  elementCreator.popResult();
}
origin: novoda/simple-easy-xml-parser

@Test(expected = UnsupportedOperationException.class)
public void notSupportPopResultOrThrow_asListCreatorWillCallbackAfterEveryListItemIsParsed() throws Exception {
  elementCreator.popResultOrThrow();
}
origin: novoda/simple-easy-xml-parser

@Test(expected = UnsupportedOperationException.class)
public void notSupportGetResult_asListCreatorWillCallbackAfterEveryListItemIsParsed() throws Exception {
  elementCreator.getResult();
}
origin: novoda/simple-easy-xml-parser

@Test
public void callWatcher_afterEachItemForTheListIsParsed() throws Exception {
  String result = "result";
  elementCreator.onParsed(result);
  verify(mockWatcher).onParsed(result);
}
origin: novoda/simple-easy-xml-parser

@Test
public void callParser_whenCreated() {
  String tag = "tag";
  stub(mockElement.getChild(tag)).toReturn(mockElement);
  elementCreator.find(mockElement, tag);
  verify(mockParser).parse(mockElement, elementCreator);
}
origin: novoda/simple-easy-xml-parser

/**
 * 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);
}
origin: novoda/simple-easy-xml-parser

@Before
public void setUp() throws Exception {
  initMocks(this);
  elementCreator = new ListElementFinder<Object>(mockParser, mockWatcher);
}
com.novoda.sexp.finderListElementFinder

Most used methods

  • <init>
  • find
  • getResult
  • getResultOrThrow
  • onParsed
  • popResult
  • popResultOrThrow

Popular in Java

  • Making http requests using okhttp
  • getExternalFilesDir (Context)
  • getContentResolver (Context)
  • startActivity (Activity)
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Notification (javax.management)
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now