devicemap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From re...@apache.org
Subject svn commit: r1693177 - in /devicemap/trunk/clients/2.0/reference: compile.sh lib/jackson-core-asl-1.9.13.jar lib/jackson-mapper-asl-1.9.13.jar run.sh src/DeviceMapClient.java src/JsonFile.java src/Main.java
Date Wed, 29 Jul 2015 02:06:34 GMT
Author: rezan
Date: Wed Jul 29 02:06:33 2015
New Revision: 1693177

URL: http://svn.apache.org/r1693177
Log:
json parsing

Added:
    devicemap/trunk/clients/2.0/reference/lib/jackson-core-asl-1.9.13.jar   (with props)
    devicemap/trunk/clients/2.0/reference/lib/jackson-mapper-asl-1.9.13.jar   (with props)
    devicemap/trunk/clients/2.0/reference/src/JsonFile.java
Modified:
    devicemap/trunk/clients/2.0/reference/compile.sh
    devicemap/trunk/clients/2.0/reference/run.sh
    devicemap/trunk/clients/2.0/reference/src/DeviceMapClient.java
    devicemap/trunk/clients/2.0/reference/src/Main.java

Modified: devicemap/trunk/clients/2.0/reference/compile.sh
URL: http://svn.apache.org/viewvc/devicemap/trunk/clients/2.0/reference/compile.sh?rev=1693177&r1=1693176&r2=1693177&view=diff
==============================================================================
--- devicemap/trunk/clients/2.0/reference/compile.sh (original)
+++ devicemap/trunk/clients/2.0/reference/compile.sh Wed Jul 29 02:06:33 2015
@@ -2,4 +2,6 @@
 
 mkdir -p bin
 
-javac src/*.java -d bin
+LIBS=`find lib -type f | xargs echo | sed "s/ /:/g"`
+
+javac -cp "$LIBS" src/*.java -d bin

Added: devicemap/trunk/clients/2.0/reference/lib/jackson-core-asl-1.9.13.jar
URL: http://svn.apache.org/viewvc/devicemap/trunk/clients/2.0/reference/lib/jackson-core-asl-1.9.13.jar?rev=1693177&view=auto
==============================================================================
Binary file - no diff available.

Propchange: devicemap/trunk/clients/2.0/reference/lib/jackson-core-asl-1.9.13.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: devicemap/trunk/clients/2.0/reference/lib/jackson-mapper-asl-1.9.13.jar
URL: http://svn.apache.org/viewvc/devicemap/trunk/clients/2.0/reference/lib/jackson-mapper-asl-1.9.13.jar?rev=1693177&view=auto
==============================================================================
Binary file - no diff available.

Propchange: devicemap/trunk/clients/2.0/reference/lib/jackson-mapper-asl-1.9.13.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: devicemap/trunk/clients/2.0/reference/run.sh
URL: http://svn.apache.org/viewvc/devicemap/trunk/clients/2.0/reference/run.sh?rev=1693177&r1=1693176&r2=1693177&view=diff
==============================================================================
--- devicemap/trunk/clients/2.0/reference/run.sh (original)
+++ devicemap/trunk/clients/2.0/reference/run.sh Wed Jul 29 02:06:33 2015
@@ -6,6 +6,6 @@ then
         exit 1
 fi
 
-cd bin
+LIBS=`find lib -type f | xargs echo | sed "s/ /:/g"`
 
-java Main "$@"
+java -cp "bin:$LIBS" Main "$@"

Modified: devicemap/trunk/clients/2.0/reference/src/DeviceMapClient.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/clients/2.0/reference/src/DeviceMapClient.java?rev=1693177&r1=1693176&r2=1693177&view=diff
==============================================================================
--- devicemap/trunk/clients/2.0/reference/src/DeviceMapClient.java (original)
+++ devicemap/trunk/clients/2.0/reference/src/DeviceMapClient.java Wed Jul 29 02:06:33 2015
@@ -21,4 +21,13 @@ public class DeviceMapClient {
   
   public final static String VERSION = "2.0";
 
+  public DeviceMapClient() {
+  }
+
+  public void loadPatterns(JsonFile patterns) {
+  }
+
+  public void loadAttributes(JsonFile attributes) {
+  }
+
 }

Added: devicemap/trunk/clients/2.0/reference/src/JsonFile.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/clients/2.0/reference/src/JsonFile.java?rev=1693177&view=auto
==============================================================================
--- devicemap/trunk/clients/2.0/reference/src/JsonFile.java (added)
+++ devicemap/trunk/clients/2.0/reference/src/JsonFile.java Wed Jul 29 02:06:33 2015
@@ -0,0 +1,33 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+import java.io.File;
+import java.io.IOException;
+import org.codehaus.jackson.JsonNode;
+import org.codehaus.jackson.map.ObjectMapper;
+
+public class JsonFile {
+  
+  private JsonNode json;
+
+  public JsonFile(String path) throws IOException {
+    ObjectMapper mapper = new ObjectMapper();
+    json = mapper.readTree(new File(path));
+  }
+}

Modified: devicemap/trunk/clients/2.0/reference/src/Main.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/clients/2.0/reference/src/Main.java?rev=1693177&r1=1693176&r2=1693177&view=diff
==============================================================================
--- devicemap/trunk/clients/2.0/reference/src/Main.java (original)
+++ devicemap/trunk/clients/2.0/reference/src/Main.java Wed Jul 29 02:06:33 2015
@@ -22,9 +22,11 @@ import java.util.List;
 
 public class Main {
   
-  public static void main(String args[]) {
+  public static void main(String args[]) throws Exception {
     System.out.println("DeviceMap Reference Client " + DeviceMapClient.VERSION);
 
+    DeviceMapClient client = new DeviceMapClient();
+
     List<String> patterns = new ArrayList<String>();
     List<String> attributes = new ArrayList<String>();
     List<String> tests = new ArrayList<String>();
@@ -58,14 +60,17 @@ public class Main {
 
     for(String pattern : patterns) {
       System.out.println("Pattern file: '" + pattern + "'");
+      client.loadPatterns(new JsonFile(pattern));
     }
 
     for(String attribute : attributes) {
       System.out.println("Attribute file: '" + attribute + "'");
+      client.loadAttributes(new JsonFile(attribute));
     }
 
     for(String test : tests) {
       System.out.println("Test file: '" + test + "'");
+      JsonFile testSuite = new JsonFile(test);
     }
 
     if(testString != null) {



Mime
View raw message