static PropertyTypeInfoAnnotation readTypeInfoAnnotation(XSAnnotation item) { try { DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); Document annotDoc = documentBuilder.newDocument(); item.writeAnnotation(annotDoc, XSAnnotation.W3C_DOM_DOCUMENT); NodeList appInfoList = annotDoc.getDocumentElement().getElementsByTagNameNS(XmlConfigParser.W3C_XML_SCHEMA, "appinfo"); if (appInfoList != null && appInfoList.getLength() == 1) { Element appInfoElem = (Element) appInfoList.item(0); if ("type_info".equals(appInfoElem.getTextContent())) { NodeList docNodeList = annotDoc.getDocumentElement().getElementsByTagNameNS(XmlConfigParser.W3C_XML_SCHEMA, "documentation"); Preconditions.checkNotNull(docNodeList, "No documentation node in the annotation node"); Preconditions.checkState(docNodeList.getLength() == 1, "Only one documentation node allowed in the annotation node"); String typeInfo = docNodeList.item(0).getTextContent(); return new PropertyTypeInfoAnnotation(typeInfo); } } return null; } catch (ParserConfigurationException e) { throw new RuntimeException(e); } }