Search Results

Search found 4 results on 1 pages for 'heldopslippers'.

Page 1/1 | 1 

  • java json/object to array

    - by heldopslippers
    Hi people. I have a question about type casting. I have the following json String: {"server":"clients","method":"whoIs","arguments":["hello"]} I am parsing it to the following Map< String, Object {arguments=[hello], method=whoIs, server=clients} It is now possible to do the following: request.get("arguments"); This works fine. But i need to get the array the is stored in the arguments. How can i accomplish this? I tried (for example) the following: System.out.println(request.get("arguments")[0]); But of course this doesn't work.. Does anybody know how this would be possible?

    Read the article

  • Java reflection

    - by heldopslippers
    Hi people. I have a question about reflection I am trying to have some kind of eval() method. So i can call for example: eval("test('woohoo')"); Now I understand the there is no eval method in java but there is reflection. I made the following code: String s = "test"; Class cl = Class.forName("Main"); Method method = cl.getMethod(s, String.class); method.invoke(null, "woohoo"); This works perfectly (of course there is a try, catch block around this code). It runs the test method. However I want to call multiple methods who all have different parameters. I don't know what parameters these are (so not only String.class). But how is this possible? how can I get the parameter types of a method ? I know of the following method: Class[] parameterTypes = method.getParameterTypes(); But that will return the parameterTypes of the method I just selected! with the following statement: Method method = cl.getMethod(s, String.class); Any help would be appreciated !

    Read the article

  • jquery draggable accept: classpath

    - by heldopslippers
    Hi guys.. I have problems with the following bit of javascript/jquery code: this.droppable = function(){ $('.imageWindow .body .item').draggable(); $('.groupWindow .body .item').droppable({ accept: $(".imageWindow .body .item"), over: function(event, ui) { alert("this is valid!"); }, drop: function(){ alert('dropped'); } }); } As you maybe know it is not possible to pass the following in the accept option: $(".imageWindow .body .item") But what is possible ? I want to pass a "class path" as an accept option ! It is probably a simple answer but i can't figure it out. Of course i could do: accept: ".item" But because "groupWindow .body .item" is a sortable it would also accept himself! Thanxs if you can help me!

    Read the article

  • Java import from other directory

    - by heldopslippers
    Hi People! I am building a Enterprise Service Bus (ESB) with Java. I won't get into details But I have to build multiple servers who make use of the same classes. I have the following directory structure: /server1 -Main.java /server2 -Main.java /com -Database.java I want to import from the Main.java class for example the Database.class. But of course the following statements won't work: import com.Database; I am working with the javac compiler in the command line (so not eclipse stuff or whatever. just TextMate and the command line). And I found a (pretty stupid) solution by creating a symbolic link in the servers to the com directory. But that is not really an ideal solution. Does anybody have a better one?? THANXS in advanced!! :D

    Read the article

1