接口的实现类调用接口详解.docx
《接口的实现类调用接口详解.docx》由会员分享,可在线阅读,更多相关《接口的实现类调用接口详解.docx(35页珍藏版)》请在冰豆网上搜索。
接口的实现类调用接口详解
结构图:
其中MessageService.java为接口,MessageServiceImpl.java为其实现类。
这里以MessageService.java中
publicvoidMessageCreatXml(Stringpath,HashMaphm,Stringstr,Studentstudent,Listcidbypnum);
在MessageServiceImpl.java的实现方法
publicvoidMessageCreatXml(Stringpath,HashMaphm,Stringstr,Studentstudent,Listcidbypnum)
{
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
}
调用MessageService.java中其他
publicvoidMessageCreatStudent(Stringpath,HashMaphm,Studentstudent);
publicvoidMessageCreatStudentInstructions(Stringpath,HashMaphm);
publicvoidMessageCreatStudentType(Stringpath,HashMaphm);
publicvoidMessageStudentLv(Stringpath,HashMaphm);
publicvoidMessageStudentCengci(Stringpath,HashMaphm);
publicvoidMessageStudentCard(Stringpath,HashMaphm);
publicvoidMessageCreatTopic(Stringpath,HashMaphm,Listcidbypnum);
publicvoidMessageCourse(Stringpath,HashMaphm,Stringstr);
publicvoidMessageCourseSdudyContent(Stringpath,HashMaphm,Stringstr);
publicvoidMessageDtopic(Stringpath,HashMaphm,Stringstr);
publicvoidMessageIntegralType(Stringpath,HashMaphm);
publicvoidMessagePoint(Stringpath,HashMaphm,Stringstr);
publicvoidMessagePower(Stringpath,HashMaphm);
publicvoidMessageProvinceSchool(Stringpath,HashMaphm);
publicvoidMessageProvinceSchoolSchool(Stringpath,HashMaphm);
publicvoidMessageReplaceIntegral(Stringpath,HashMaphm);
publicvoidMessageSattachment(Stringpath,HashMaphm);
publicvoidMessageSattchmentType(Stringpath,HashMaphm);
publicvoidMessageSchool(Stringpath,HashMaphm);
publicvoidMessageIntegralRequest(Stringpath,HashMaphm,Stringstr);
publicvoidMessageProfessionCourse(Stringpath,HashMaphm,Stringstr);
publicvoidMessageProfessional(Stringpath,HashMaphm,Studentstudent);
publicvoidMessageIntegralCoefficient(Stringpath,HashMaphm,Stringstr);
publicvoidMessageIntegralSet(Stringpath,HashMaphm,Stringstr);
publicvoidMessageMixIntegral(Stringpath,HashMaphm,Stringstr);
publicvoidMessageStudentIntegral(Stringpath,HashMaphm,Stringstr);
publicvoidMessageNode(Stringpath,HashMaphm,Stringstr);
的实现方法:
接口:
packagecom.action.service;
importjava.util.HashMap;
importjava.util.List;
importcom.bean.Student;
publicinterfaceMessageService{
publicHashMapMessageGetCroudrStr(Stringsid,Studentstudent);
publicbooleanMessageCheckStr(Stringstr);
publicStudentMessageCheckStudent(Stringsid);
publicvoidMessageCreatStudent(Stringpath,HashMaphm,Studentstudent);
publicvoidMessageCreatStudentInstructions(Stringpath,HashMaphm);
publicvoidMessageCreatStudentType(Stringpath,HashMaphm);
publicvoidMessageStudentLv(Stringpath,HashMaphm);
publicvoidMessageStudentCengci(Stringpath,HashMaphm);
publicvoidMessageStudentCard(Stringpath,HashMaphm);
publicvoidMessageCreatTopic(Stringpath,HashMaphm,Listcidbypnum);
publicvoidMessageCourse(Stringpath,HashMaphm,Stringstr);
publicvoidMessageCourseSdudyContent(Stringpath,HashMaphm,Stringstr);
publicvoidMessageDtopic(Stringpath,HashMaphm,Stringstr);
publicvoidMessageIntegralType(Stringpath,HashMaphm);
publicvoidMessagePoint(Stringpath,HashMaphm,Stringstr);
publicvoidMessagePower(Stringpath,HashMaphm);
publicvoidMessageProvinceSchool(Stringpath,HashMaphm);
publicvoidMessageProvinceSchoolSchool(Stringpath,HashMaphm);
publicvoidMessageReplaceIntegral(Stringpath,HashMaphm);
publicvoidMessageSattachment(Stringpath,HashMaphm);
publicvoidMessageSattchmentType(Stringpath,HashMaphm);
publicvoidMessageSchool(Stringpath,HashMaphm);
publicvoidMessageIntegralRequest(Stringpath,HashMaphm,Stringstr);
publicvoidMessageProfessionCourse(Stringpath,HashMaphm,Stringstr);
publicvoidMessageProfessional(Stringpath,HashMaphm,Studentstudent);
publicvoidMessageIntegralCoefficient(Stringpath,HashMaphm,Stringstr);
publicvoidMessageIntegralSet(Stringpath,HashMaphm,Stringstr);
publicvoidMessageMixIntegral(Stringpath,HashMaphm,Stringstr);
publicvoidMessageStudentIntegral(Stringpath,HashMaphm,Stringstr);
publicvoidMessageNode(Stringpath,HashMaphm,Stringstr);
publicvoidMessageCreatXml(Stringpath,HashMaphm,Stringstr,Studentstudent,Listcidbypnum);
publicbooleanMessageZip(Stringnewp,Stringsid);
}
实现类:
packagecom.action.serviceimpl;
importjava.util.ArrayList;
importjava.util.HashMap;
importjava.util.List;
importcom.action.service.MessageService;
importcom.bean.Course;
importcom.bean.CourseSdudyContent;
importcom.bean.Dtopic;
importcom.bean.Instructions;
importcom.bean.IntegralCoefficient;
importcom.bean.IntegralRequest;
importcom.bean.IntegralSet;
importcom.bean.IntegralType;
importcom.bean.MixIntegral;
importcom.bean.Node;
importcom.bean.Point;
importcom.bean.Power;
importcom.bean.ProfessionCourse;
importcom.bean.Professional;
importcom.bean.ProvinceSchool;
importcom.bean.ProvinceSchoolSchool;
importcom.bean.ReplaceIntegral;
importcom.bean.Sattachment;
importcom.bean.SattchmentType;
importcom.bean.School;
importcom.bean.Student;
importcom.bean.StudentCard;
importcom.bean.StudentCengci;
importcom.bean.StudentIntegral;
importcom.bean.StudentLv;
importcom.bean.StudentType;
importcom.bean.Topic;
importcom.bean.UserLogin;
importcom.dao.CourseDAO;
importcom.dao.CourseSdudyContentDAO;
importcom.dao.DtopicDAO;
importcom.dao.InstructionsDAO;
importcom.dao.IntegralCoefficientDAO;
importcom.dao.IntegralRequestDAO;
importcom.dao.IntegralSetDAO;
importcom.dao.IntegralTypeDAO;
importcom.dao.MixIntegralDAO;
importcom.dao.NodeDAO;
importcom.dao.PointDAO;
importcom.dao.PowerDAO;
importcom.dao.ProfessionCourseDAO;
importcom.dao.ProfessionalDAO;
importcom.dao.ProvinceSchoolDAO;
importcom.dao.ProvinceSchoolSchoolDAO;
importcom.dao.ReplaceIntegralDAO;
importcom.dao.SattachmentDAO;
importcom.dao.SattchmentTypeDAO;
importcom.dao.SchoolDAO;
importcom.dao.StudentCardDAO;
importcom.dao.StudentCengciDAO;
importcom.dao.StudentDAO;
importcom.dao.StudentIntegralDAO;
importcom.dao.StudentLvDAO;
importcom.dao.StudentTypeDAO;
importcom.dao.TopicDAO;
importcom.dao.UserLoginDAO;
importcom.dbmodel.DbModel;
importcom.util.FourUtil;
importcom.util.TwoUtil;
publicclassMessageServiceImplimplementsMessageService{
privateListlisthm=newArrayList();
privateStudentDAOstudentDAO;
privateUserLoginDAOuserLoginDAO;
privateInstructionsDAOinstructionsDAO;
privateProfessionCourseDAOprofessionCourseDAO;
privateCourseDAOcourseDAO;
privateProfessionalDAOprofessionalDAO;
privateTopicDAOtopicDAO;
privateStudentTypeDAOstudentTypeDAO;
privateStudentCardDAOstudentCardDAO;
privateStudentCengciDAOstudentCengciDAO;
privateStudentLvDAOstudentLvDAO;
privateSchoolDAOschoolDAO;
privateSattchmentTypeDAOsattchmentTypeDAO;
privateSattachmentDAOsattachmentDAO;
privateReplaceIntegralDAOreplaceIntegralDAO;
privateProvinceSchoolSchoolDAOprovinceSchoolSchoolDAO;
privateProvinceSchoolDAOprovinceSchoolDAO;
privatePowerDAOpowerDAO;
privatePointDAOpointDAO;
privateIntegralTypeDAOintegralTypeDAO;
privateIntegralRequestDAOintegralRequestDAO;
privateDtopicDAOdtopicDAO;
privateCourseSdudyContentDAOcourseSdudyContentDAO;
privateNodeDAOnodeDAO;
privateIntegralCoefficientDAOintegralCoefficientDAO;
privateIntegralSetDAOintegralSetDAO;
privateMixIntegralDAOmixIntegralDAO;
privateStudentIntegralDAOstudentIntegralDAO;
publicStudentDAOgetStudentDAO(){
returnstudentDAO;
}
publicvoidsetStudentDAO(StudentDAOstudentDAO){
this.studentDAO=studentDAO;
}
publicUserLoginDAOgetUserLoginDAO(){
returnuserLoginDAO;
}
publicvoidsetUserLoginDAO(UserLoginDAOuserLoginDAO){
this.userLoginDAO=userLoginDAO;
}
publicInstructionsDAOgetInstructionsDAO(){
returninstructionsDAO;
}
publicvoidsetInstructionsDAO(InstructionsDAOinstructionsDAO){
this.instructionsDAO=instructionsDAO;
}
publicProfessionCourseDAOgetProfessionCourseDAO(){
returnprofessionCourseDAO;
}
publicvoidsetProfessionCourseDAO(ProfessionCourseDAOprofessionCourseDAO){
this.professionCourseDAO=professionCourseDAO;
}
publicCourseDAOgetCourseDAO(){
returncourseDAO;
}
publicvoidsetCourseDAO(CourseDAOcourseDAO){
this.courseDAO=courseDAO;
}
publicProfessionalDAOgetProfessionalDAO(){
returnprofessionalDAO;
}
publicvoidsetProfessionalDAO(ProfessionalDAOprofessionalDAO){
this.professionalDAO=professionalDAO;
}
publicTopicDAOgetTopicDAO(){
returntopicDAO;
}
publicvoidsetTopicDAO(TopicDAOtopicDAO){
this.topicDAO=topicDAO;
}
publicStudentTypeDAOgetStudentTypeDAO(){
returnstudentTypeDAO;
}
publicvoidsetStudentTypeDAO(StudentTypeDAOstudentTypeDAO){
this.studentTypeDAO=studentTypeDAO;
}
publicStudentCardDAOgetStudentCardDAO(){
returnstudentCardDAO;
}
publicvoidsetStudentCardDAO(StudentCardDAOstudentCardDAO){
this.studentCardDAO=studentCardDAO;
}
publicStudentCengciDAOgetStudentCengciDAO(){
returnstudentCengciDAO;
}
publicvoidsetStudentCengciDAO(StudentCengciDAOstudentCengciDAO){
this.studentCengciDAO=studentCengciDAO;
}
publicStudentLvDAOgetStudentLvDAO(){
returnstudentLvDAO;
}
publicvoidsetStudentLvDAO(StudentLvDAOstudentLvDAO){
this.studentLvDAO=studentLvDAO;
}
publicSchoolDAOgetSchoolDAO(){
returnschoolDAO;
}
publicvoidsetSchoolDAO(SchoolDAOschoolDAO){
this.schoolDAO=schoolDAO;
}
publicSattchmentTypeDAOgetSattchmentTypeDAO(){
returnsattchmentTypeDAO;
}
publicvoidsetSattchmentTypeD