Back to project page android-pkpass-viewer.
The source code is released under:
MIT License
If you think the Android project android-pkpass-viewer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.manso.mytickets.services; //from w ww . j a v a 2 s .c o m import java.io.File; import java.io.IOException; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; import com.manso.mytickets.utils.FileReader; public class PassStrategyService { public IPassStrategy getStrategy(File dir) throws IOException, ParseException { String json = new FileReader().readTextFile(new File(dir, "pass.json")); JSONParser parser = new JSONParser(); JSONObject root = (JSONObject) parser.parse(json); if (root.containsKey("eventTicket")) { return new EventTicketPassStrategy(dir); } return null; } }