if(!"class".equals(pd.getName())){ 这句中的 !"class"是什么意思
package cn.itcast.test;
import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Method;
import org.junit.Test;
import cn.itcast.vo.user;
public class IntrospectorTest {
@Test
public void run() throws Exception{
user user = new user();
BeanInfo info = Introspector.getBeanInfo(user.getClass());
PropertyDescriptor [] pds = info.getPropertyDescriptors();
for (PropertyDescriptor pd : pds) {
if(!"class".equals(pd.getName())){
Method m = pd.getWriteMethod();
m.invoke(user, "admin");
}
}
System.out.println(user.getUsername());
}
}