import spark.Request; import spark.Response; import spark.Route; import spark.Spark; public class HelloWorldSparkStyle { public static void main(String[] args){ Spark.get("/", new Route() { public Object handle(final Request request, final Response response){ return "Hello World from Spark"; } }); } }
final Route route = new Route();
@Override public void init() { get(new Route("/test") { @Override public Object handle(Request request, Response response) { return "response goes here; } });
// Initialization: for (int i = 0; i < numRoutes; i++) { route[i] = new Route(); route[i].departureTimes = new int[count]; }
public static void main(String[] args) { spark.Spark.port(PortNumber); Spark.get("/", new Route() { public Object handle(Request request, Response response) throws Exception { return "This is a sample page"; } }); }
public static void main(String[] args) throws IOException { /* code to find number of route = numRoutes goes here */ Route[] route = new Route[numRoutes]; // Initialization: for (int i = 0; i < numRoutes; i++) { route[i] = new Route(); } /* code to find number of times = count goes here */ for (int i = 0; i < numRoutes; i++) { // without previous initialization, route[i] is null here route[i].departureTimes = new int[count];
public RouteBuilder(RouteFluent<?> fluent,Boolean validationEnabled){ this(fluent, new Route(), validationEnabled); } public RouteBuilder(RouteFluent<?> fluent,Route instance){
public RouteBuilder(Boolean validationEnabled){ this(new Route(), validationEnabled); } public RouteBuilder(RouteFluent<?> fluent){
List<String> companyList = (List<String>) session.createSQLQuery ( "select name from company where company_id=?", companyId).list(); for (String routeName: companyList) { vgDetails = new Route(); vgDetails.setRouteName (routeName); routeList.add(vgDetails); }
public class App { public static void main(String[] args) { get(new Route("/hello") { @Override public Object handle(Request request, Response response) { return "Hello World!"; } }); }
public RouteBuilder(){ this(new Route()); } public RouteBuilder( RouteFluent<?> fluent ){
public RouteBuilder( RouteFluent<?> fluent ){ this(fluent, new Route()); } public RouteBuilder( RouteFluent<?> fluent , Route instance ){
for (int i = 0; i < numRoutes; i++) { route[i] = new Route(); route[i].departureTimes = new int[count];
var origService = google.maps.DirectionsService; google.maps.DirectionsService = function() {/*your stub*/}; var route = new Route(); google.maps.DirectionsService = origService;
@Primary @Contribute(RouteProvider.class) public static void addRoutes(OrderedConfiguration<Route> configuration, ComponentClassResolver componentClassResolver) { String pageName = componentClassResolver.resolvePageClassNameToPageName(Home.class.getName()); String canonicalized = componentClassResolver.canonicalizePageName(pageName); configuration.add("home1", new Route("/home1", canonicalized)); configuration.add("home2", new Route("/home2", canonicalized)); configuration.add("home3", new Route("/home3", canonicalized)); configuration.add("home4", new Route("/home4", canonicalized)); configuration.add("hola", new Route("/hola", canonicalized)); // the last one is going to be use by default to create links to the page }
void marshal() throws Exception { Route route = new Route(); route.setCna( "cnavalue" ); JAXBContext jc = JAXBContext.newInstance( Route.class ); Marshaller m = jc.createMarshaller(); m.setProperty( "jaxb.fragment", true ); StringWriter sw = new StringWriter(); m.marshal( route, sw ); System.out.println( sw.toString() ); }
ArrayList<LatLng> allatlng = new ArrayList<LatLng>(); LatLng latlng = new LatLng(Double.parseDouble(strDestlat), Double.parseDouble(strDestlng)); allatlng.add(latlng); LatLng latlng1 = new LatLng(Double.parseDouble(strCurrentLat), Double.parseDouble(strCurrentLong)); allatlng.add(latlng1); Route route = new Route(); route.drawRoute(googleMap, Home.this, allatlng, true, Route.LANGUAGE_ENGLISH, true);
public Route build(){ Route buildable = new Route(fluent.getApiVersion(),fluent.getKind(),fluent.getMetadata(),fluent.getSpec(),fluent.getStatus()); validate(buildable); return buildable; }
public Route build(){ Route buildable = new Route(fluent.getApiVersion(),fluent.getKind(),fluent.getMetadata(),fluent.getSpec(),fluent.getStatus()); validate(buildable); return buildable; }
public Route build(){ Route buildable = new Route(fluent.getApiVersion(),fluent.getKind(),fluent.getMetadata(),fluent.getSpec(),fluent.getStatus()); validate(buildable); return buildable; }