SoFunction
Updated on 2025-04-06

Jabsorb Notes_Several Small Examples Page 1/2

I studied jabsorb and wrote a few simple examples, hoping to help a newbie get started quickly.
First, refer to jabsorb-1.2., slf4j-api-1.4., slf4j-jdk14-1.4.
Class files:
package ;

import ;
import ;
import ;
import ;
import ;
import ;



public class TestJabsorb {
public String getMessage(String s) {
return "Hello: " + s;
}

public String getMessage() {
return "No parameter";
}

public String getMessage(List al) {
String res="list parameter:";
for(Iterator it = ();();){
Object next = ();
res+=next+",";
}
return res;
}

public String getMessage(String[] array) {
String res="array parameters:";
for(int i=0;i<;i++){
res+=array[i]+",";
}
return res;
}

public String getMessage(Map map) {
String res="map parameter:";
Set entrySet = ();
for(Iterator it = ();();){
Object next = ();
res+=next+",";
}
return res;
}

public String getMessage(Test2 t2) {
String res="Test2(bean) parameter:";
res+=t2.p1+",";
res+=t2.p2+",";
return res;
}

public String getMessage(Test3 t2) {
String res="Test3(bean) parameter:";
res+=t2.p1+",";
res+=t2.p2+",";
return res;
}

public Test2 getMessage2() {
Test2 res=new Test2();
res.p1="11";
res.p2="22";
return res;
}

public Test3 getMessage3() {
Test3 res=new Test3();
res.p1="11";
res.p2="22";
return res;
}

public List getList()
{
List list = new LinkedList();
("China");
(1234);
return list;
}

public Map getMap()
{
Map map = new HashMap();
("bird", "bird");
("human", "human");
return map;
}

}


package ;


public class Test2{
public String p1;
public String p2;
public String getP1() {
return p1;
}
public void setP1(String p1) {
this.p1 = p1;
}
public String getP2() {
return p2;
}
public void setP2(String p2) {
this.p2 = p2;
}

}

12Next pageRead the full text