• Welcome to SC4 Devotion Forum Archives.

LEX4J - Java LEX API Wrapper

Started by CasperVg, November 22, 2013, 08:20:15 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

CasperVg

Hi everyone,

After working on the new SC4Devotion LEX API, which allows easy access to the LEX functionality outside the SC4Devotion website for a fair bit, I decided to start building a Java LEX API Wrapper, which will abstract most of the lower level stuff (fetching the JSON, putting the results into Java beans, etc.) for you and allow you to focus on your LEX application only.

Example:
This is how you can get the profile for a user and print the full name:

        Auth auth = new Auth("username", "password");
        UserRoute route = new UserRoute(auth);
        User user = route.getUser();
        System.out.println(user.getFullname());


Source:
Source-code is available at the Github repository and is licensed under the GPLv2 License. Everyone who wants to help and contribute is free to do so of course.

Documentation/Javadoc:
Documentation in the form of Javadoc is available through Github Pages:
http://caspervg.github.io/SC4D-LEX4J

Releases:
v 0.5.0-beta: Click here to download

Usage instructions:
Add the "LEX4J.jar" and the dependencies in the /lib/ directory to your project. That's it ;)
Follow my SimCity 4 Let's play on YouTube

CasperVg

#1
After some more testing and adding some extra features (it can grab the various LEX search categories now too) I have decided to release the first binary build (v0.5.0-beta) for people to experiment with.

It is available through a Github Release here: Click me!
Follow my SimCity 4 Let's play on YouTube

CasperVg

Version 0.7 of the LEX4J API Wrapper has been released. Changelog:

    v. 0.5 - Initial release
    v. 0.6 - Improved documentation for the search filters
    v. 0.7 - Switched to v2 LEX API, add support for new search query

You can also easily add LEX4J to your dependencies by adding this to your Maven pom.xml (or similar in Gradle, etc.)

<dependencies>
  ...
  <dependency>
      <groupId>net.caspervg.lex4j</groupId>
      <artifactId>LEX4J</artifactId>
      <version>0.7</version>
  </dependency>
  ...
</dependencies>
Follow my SimCity 4 Let's play on YouTube

CasperVg

Version 4.0 of the LEX4J API wrapper has been released. It adds compatibility for the recently released LEX API v4.
Follow my SimCity 4 Let's play on YouTube