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

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

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

origin: novoda/simple-easy-xml-parser

public FeedParser(ElementFinderFactory factory) {
  this.idFinder = factory.getStringFinder();
  this.titleFinder = factory.getStringFinder();
  this.updatedFinder = factory.getStringFinder();
  this.authorFinder = factory.getTypeFinder(new AuthorParser(factory));
  this.logoFinder = factory.getStringFinder();
  this.generatorFinder = factory.getStringFinder();
  this.linkFinder = factory.getAttributeFinder(new LinkAttributeMarshaller(), ATTR_HREF, ATTR_REL, ATTR_TITLE, ATTR_TYPE);
  this.entryFinder = factory.getListElementFinder(new EntryParser(factory), parseWatcher);
}
origin: novoda/simple-easy-xml-parser

/**
 * @return an {@link ElementFinderFactory} this Factory is how you select which XML elements to parse as what java types
 * see it's javadoc for more
 */
public static ElementFinderFactory getElementFinderFactory() {
  return new ElementFinderFactory();
}
origin: novoda/simple-easy-xml-parser

public ChannelImageParser(ElementFinderFactory factory) {
  this.titleFinder = factory.getStringFinder();
  this.linkFinder = factory.getStringFinder();
  this.urlFinder = factory.getStringFinder();
  this.widthFinder = factory.getIntegerFinder();
  this.heightFinder = factory.getIntegerFinder();
}
origin: novoda/simple-easy-xml-parser

public EntryParser(ElementFinderFactory factory) {
  idFinder = factory.getStringFinder();
  titleFinder = factory.getStringFinder();
  summaryFinder = factory.getStringFinder();
  updatedFinder = factory.getStringFinder();
  linkFinder = factory.getListAttributeFinder(new LinkAttributeMarshaller(), linkParseWatcher, ATTR_HREF, ATTR_REL, ATTR_TITLE, ATTR_TYPE);
}
origin: novoda/simple-easy-xml-parser

public PodcastItemParser(ElementFinderFactory factory) {
  this.titleFinder = factory.getStringWrapperTypeFinder(Title.class);
  this.authorFinder = factory.getStringWrapperTypeFinder(Author.class);
  this.linkFinder = factory.getStringWrapperTypeFinder(Link.class);
  itunesDurationFinder = factory.getStringWrapperTypeFinder(ItunesDuration.class);
  itunesImageFinder = factory.getAttributeFinder(new ImageAttributeMarshaller(), TAG_ITUNES_IMAGE_ATTR);
}
origin: novoda/simple-easy-xml-parser

public PodcastChannelParser(ElementFinderFactory factory) {
  this.podcastItemFinder = factory.getListElementFinder(new PodcastItemParser(factory), parseWatcher);
  this.titleFinder = factory.getStringWrapperTypeFinder(Title.class);
  this.linkFinder = factory.getStringWrapperTypeFinder(Link.class);
  this.imageFinder = factory.getTypeFinder(new ChannelImageParser(factory));
}
origin: novoda/simple-easy-xml-parser

/**
 * Will parse the body of an XML tag into an {@link Boolean}
 *
 * @return {@link ElementFinder}
 */
public ElementFinder<Boolean> getBooleanFinder() {
  return getTypeFinder(new BooleanBodyMarshaller());
}
origin: novoda/simple-easy-xml-parser

public ListParser(String tag, ElementFinderFactory factory, BodyMarshaller<T> bodyMarshaller) {
  this.tag = tag;
  this.listCreator = factory.getListElementFinder(bodyMarshaller, this);
}
origin: novoda/simple-easy-xml-parser

/**
 * Will parse the body of an XML tag into a simple {@link Integer} wrapper class. This is a class that
 * has a constructor that takes a single primitive int parameter.
 *
 * @param clazz The class of your Integer Wrapper Class
 * @param <T>   The type you wish to create from the XML body
 * @return {@link ElementFinder}
 */
public <T> ElementFinder<T> getIntegerWrapperTypeFinder(Class<T> clazz) {
  return getTypeFinder(new BasicParser<T>(getIntegerWrapperMarshaller(clazz)));
}
origin: novoda/simple-easy-xml-parser

/**
 * Will parse the body of an XML tag into a simple {@link String} wrapper class. This is a class that
 * has a constructor that takes a single {@link String} parameter.
 *
 * @param clazz The class of your String Wrapper Class
 * @param <T>   The type you wish to create from the XML body
 * @return {@link ElementFinder}
 */
public <T> ElementFinder<T> getStringWrapperTypeFinder(Class<T> clazz) {
  return getTypeFinder(new BasicParser<T>(getStringWrapperMarshaller(clazz)));
}
origin: novoda/simple-easy-xml-parser

public AuthorParser(ElementFinderFactory factory) {
  nameFinder = factory.getStringFinder();
}
origin: novoda/simple-easy-xml-parser

/**
 * Will parse the attributes off an XML tag, these are then passed to your {@link AttributeMarshaller}
 * to create an object of type {@link Object}.
 *
 * @param attributeMarshaller The marshaller to parse the attributes into your required type
 * @param attrTags            The tags of the attributes you wish to parse
 * @param <T>                 The type you wish to create from the attributes
 * @return {@link ElementFinder}
 */
public <T> ElementFinder<T> getAttributeFinder(AttributeMarshaller<T> attributeMarshaller, String... attrTags) {
  return getTypeFinder(new BasicAttributeParser<T>(attributeMarshaller, attrTags));
}
origin: novoda/simple-easy-xml-parser

/**
 * Will parse the body of 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 bodyMarshaller The marshaller to create an object from the XML body
 * @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(BodyMarshaller<T> bodyMarshaller, ParseWatcher<T> watcher) {
  return getListElementFinder(new BasicParser<T>(bodyMarshaller), watcher);
}
origin: novoda/simple-easy-xml-parser

/**
 * Will parse the body of all XML tags with the {@code tag} argument
 * into a {@link java.util.List} of {@link Object}. This is a simple Integer wrapper class that
 * has a constructor that takes a single {@link Integer} parameter.<br/>
 * See {@link #getIntegerWrapperTypeFinder(Class)} for more info.
 *
 * @param tag   The tag to parse the body for each list element
 * @param clazz The class of the wrapper type you wish your List to be made of
 * @param <T>   The type you wish to create from the XML body
 * @return {@link ElementFinder}
 */
public <T> ElementFinder<List<T>> getIntegerWrapperTypeListFinder(String tag, Class<T> clazz) {
  return getTypeFinder(new ListParser<T>(tag, this, getIntegerWrapperMarshaller(clazz)));
}
origin: novoda/simple-easy-xml-parser

/**
 * Will parse the body of all XML tags with the {@code tag} argument
 * into a {@link java.util.List} of {@link Object}. This is a simple String wrapper class that
 * has a constructor that takes a single {@link String} parameter.<br/>
 * See {@link #getStringWrapperTypeFinder(Class)} for more info.
 *
 * @param tag   The tag to parse the body for each list element
 * @param clazz The class of the wrapper type you wish your List to be made of
 * @param <T>   The type you wish to create from the XML body
 * @return {@link ElementFinder}
 */
public <T> ElementFinder<List<T>> getStringWrapperTypeListFinder(String tag, Class<T> clazz) {
  return getTypeFinder(new ListParser<T>(tag, this, getStringWrapperMarshaller(clazz)));
}
origin: novoda/simple-easy-xml-parser

@Override
public void execute() {
  ElementFinderFactory factory = SimpleEasyXmlParser.getElementFinderFactory();
  elementFinder = factory.getStringFinder();
  Instigator instigator = new OneElementInstigator(elementFinder, "novoda", finishWatcher);
  SimpleEasyXmlParser.parse(XML, instigator);
}
origin: novoda/simple-easy-xml-parser

/**
 * Will parse the body of an XML tag into an {@link Integer}
 *
 * @return {@link ElementFinder}
 */
public ElementFinder<Integer> getIntegerFinder() {
  return getTypeFinder(new IntegerBodyMarshaller());
}
origin: novoda/simple-easy-xml-parser

@Before
public void setUp() {
  initMocks(this);
  stub(mockFactory.getListElementFinder(Mockito.<BodyMarshaller<Object>>any(), Mockito.<ParseWatcher<Object>>any())).toReturn(mockListCreator);
  listParser = new ListParser<Object>("individualItemTag", mockFactory, mockMarshaller);
}
origin: novoda/simple-easy-xml-parser

@Override
public void execute() {
  ElementFinderFactory factory = SimpleEasyXmlParser.getElementFinderFactory();
  elementFinder = factory.getStringFinder();
  Instigator instigator = new SimpleInstigator(elementFinder, finishWatcher);
  SimpleEasyXmlParser.parse(XML, instigator);
}
origin: novoda/simple-easy-xml-parser

/**
 * Will parse the body of an XML tag into {@link Object} using the supplied {@link BodyMarshaller}
 *
 * @param bodyMarshaller The marshaller to parse the body into your required type
 * @param <T>            The type you wish to create from the XML body
 * @return {@link ElementFinder}
 */
public <T> ElementFinder<T> getTypeFinder(BodyMarshaller<T> bodyMarshaller) {
  return getTypeFinder(new BasicParser<T>(bodyMarshaller));
}
com.novoda.sexp.finderElementFinderFactory

Javadoc

You can retrieve ElementFinder here

For example if you have the XML

 
 Paul Blundell 
and you want to retrieve it as a Stringyou would use the #getStringFinder() method
 
 ElementFinder finder = getStringFinder();

Most used methods

  • getListElementFinder
    Will parse an XML tag into Object then inform the ParseWatcherThe idea is to have a callback for a n
  • getTypeFinder
    Will parse an XML tag using the passed ParserThis can be used when you want to parse attributes as w
  • getAttributeFinder
    Will parse the attributes off an XML tag, these are then passed to your AttributeMarshallerto create
  • getStringFinder
    Will parse the body of an XML tag into a String
  • <init>
  • getIntegerFinder
    Will parse the body of an XML tag into an Integer
  • getIntegerWrapperMarshaller
  • getListAttributeFinder
    Will parse the attributes off an XML tag, into Object then inform the ParseWatcherThe idea is to hav
  • getStringWrapperMarshaller
  • getStringWrapperTypeFinder
    Will parse the body of an XML tag into a simple String wrapper class. This is a class that has a con
  • getStringWrapperTypeListFinder
    Will parse the body of all XML tags with the tag argument into a java.util.List of Object. This is a
  • getStringWrapperTypeListFinder

Popular in Java

  • Start an intent from android
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (Timer)
  • onCreateOptionsMenu (Activity)
  • Kernel (java.awt.image)
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • From CI to AI: The AI layer in your organization
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