Tabnine Logo
com.novoda.sexp.parser
Code IndexAdd Tabnine to your IDE (free)

How to use com.novoda.sexp.parser

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

origin: novoda/simple-easy-xml-parser

  @Override
  public void end() {
    parseFinishWatcher.onFinish();
  }
}
origin: novoda/simple-easy-xml-parser

  @Override
  public void end() {
    listener.onParsed(list);
  }
}
origin: novoda/simple-easy-xml-parser

@Override
public void start(Attributes attributes) {
  String[] values = getAttributeValues(attributes);
  listener.onParsed(attributeMarshaller.marshal(values));
}
origin: novoda/simple-easy-xml-parser

@Test
public void informListener_whenElementIsParsed() throws Exception {
  BasicParser<Object> basicParser = new BasicParser<Object>(mockMarshaller);
  mockParse(basicParser, mockListener);
  verify(mockListener).onParsed(any());
}
origin: novoda/simple-easy-xml-parser

@Test
public void informListener_whenTheWholeListOfElementsHasBeenParsed() {
  Element element = mock(Element.class);
  listParser.parse(element, mockListener);
  listParser.end();
  verify(mockListener).onParsed(Mockito.<List<Object>>any());
}
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));
}
origin: novoda/simple-easy-xml-parser

@Override
public void find(Element from, String uri, String tag) {
  parser.parse(from.getChild(uri, tag), this);
}
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

/**
 * 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

public static void mockParse(Parser<Object> parser, ParseWatcher<Object> mockListener) throws SAXException {
  mockParse(parser, mockListener, "");
}
origin: novoda/simple-easy-xml-parser

@Override
public void onParsed(T body) {
  parseWatcher.onParsed(body);
}
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

@Override
public void find(Element from, String uri, String tag) {
  parser.parse(from.getChild(uri, tag), this);
}
origin: novoda/simple-easy-xml-parser

  @Override
  public void end(String body) {
    elementFinder.onParsed(body);
    parseFinishWatcher.onFinish();
  }
}
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

  @Override
  public void end(String body) {
    listener.onParsed(bodyMarshaller.marshal(body));
  }
}
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

@Override
public void find(Element from, String tag) {
  parser.parse(from.getChild(tag), this);
}
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

@Override
public void find(Element from, String tag) {
  parser.parse(from.getChild(tag), this);
}
com.novoda.sexp.parser

Most used classes

  • ParseWatcher
  • BasicAttributeParser
  • BasicParser
  • ListParser
  • ParseFinishWatcher
  • ParserHelper
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