往book对象set值时报NullPointerException,怎么处理呢?
if(bookChild.getName().equals("name")){
bookEntity.setName(bookChild.getStringValue());
}
else if(bookChild.getName().equals("author")){
bookEntity.setAuthor(bookChild.getStringValue());
}
else if(bookChild.getName().equals("year")){
bookEntity.setYear(bookChild.getStringValue());
}
else if(bookChild.getName().equals("price")){
bookEntity.setPrice(bookChild.getStringValue());
}
else if(bookChild.getName().equals("language")){
bookEntity.setLanguage(bookChild.getStringValue());
}