String--InputStream---Document--Element--List

public List<PatientInfoVO> JDOMParseQueryPatientInfo(String param)
			throws JDOMException {

		log.info("服务层操作:param:" + param);
		SAXBuilder builder = new SAXBuilder(false);
		List<PatientInfoVO> patientInfoList = new ArrayList<PatientInfoVO>();

		try {
			InputStream stream = new ByteArrayInputStream(param
					.getBytes("UTF-8"));
			Document document = builder.build(stream);
			// 获取根节点 patientInfoList
			Element root = document.getRootElement();

			List patientInfolist = root.getChildren("PatientInfo");
			if (patientInfolist != null && !patientInfolist.isEmpty()) {

				for (int i = 0; i < patientInfolist.size(); i++) {
					Element patientInfo = (Element) patientInfolist.get(i);

					// 
					PatientInfoVO queryPatientInfo = new PatientInfoVO();

					List uniqueId = patientInfo.getChildren("uniqueId");
					if (uniqueId != null && !uniqueId.isEmpty()) {
						queryPatientInfo
								.setUniqueId(((Element) uniqueId.get(0))
										.getTextTrim());
					}

....................

你可能感兴趣的:(Stream,String,list,null)