All Downloads are FREE. Search and download functionalities are using the official Maven repository.

enterprises.orbital.impl.evexmlapi.map.MapJumpsParser Maven / Gradle / Ivy

There is a newer version: 2.4.0
Show newest version
package enterprises.orbital.impl.evexmlapi.map;

import java.io.IOException;

import org.apache.commons.digester.Digester;

import enterprises.orbital.evexmlapi.map.IMapJump;
import enterprises.orbital.impl.evexmlapi.AbstractAPIRequestAdapter;
import enterprises.orbital.impl.evexmlapi.AbstractApiParser;
import enterprises.orbital.impl.evexmlapi.ApiConnector;
import enterprises.orbital.impl.evexmlapi.ApiEndpoint;

public class MapJumpsParser extends AbstractApiParser {
  public MapJumpsParser(ApiConnector connector) {
    super(connector, MapJumpsResponse.class, ApiEndpoint.MAP_JUMPS_V2);
  }

  @Override
  protected Digester getDigester() {
    Digester digester = super.getDigester();
    digester.addBeanPropertySetter("eveapi/result/dataTime");
    digester.addObjectCreate("eveapi/result/rowset/row", ApiSystemJumps.class);
    digester.addSetProperties("eveapi/result/rowset/row");
    digester.addSetNext("eveapi/result/rowset/row", "addSystemJumps");
    return digester;
  }

  @Override
  public IMapJump retrieveResponse(AbstractAPIRequestAdapter adapter) throws IOException {
    MapJumpsResponse response = getResponse();
    adapter.setFromLastResponse(response);
    if (adapter.isError()) return null;
    return response;
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy