private PropertyComment parse(final String systemId, final InputStream input) throws CommentException { try { final SAXBuilder parser = new SAXBuilder(); final Document document = parser.build(input, systemId); final PropertyComment.Builder builder = new PropertyComment.Builder(); final Element rootNode = document.getRootElement(); final String comment = rootNode.getChildTextNormalize("specification", PROPERTY_NS); final PropertyValueComment valueComment = parseValueComment(rootNode); builder.withText(comment).with(valueComment); return builder.build(); } catch (final JDOMException e) { throw new CommentException(systemId, e); } catch (final IOException e) { throw new CommentException(systemId, e); } }
private void addPropertyValueComment(final PropertyProjectdoc projectdoc, final ParserContext context) { final PropertyComment.Builder builder = new PropertyComment.Builder(); final Document document = context.getDocument(); final Element rootNode = document.getRootElement(); final String specification = rootNode.getChildTextNormalize("specification", NS); final PropertyValueComment valueComment = parseValueComment(rootNode); builder.withText(specification).with(valueComment); final PropertyComment propertyComment = builder.build(); projectdoc.setComment(propertyComment); }