From e403f59368069f7ccc72396c620b5e8fc203acbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=BE=D0=BB=D0=B8=D0=BA=D0=B0=D1=80=D0=BF=D0=BE?= =?UTF-8?q?=D0=B2=20=D0=98=D0=BB=D1=8C=D1=8F=20=D0=9D=D0=B8=D0=BA=D0=BE?= =?UTF-8?q?=D0=BB=D0=B0=D0=B5=D0=B2=D0=B8=D1=87?= Date: Thu, 11 Jul 2019 18:06:44 +0300 Subject: [PATCH] Javadoc multiline support improvements --- .../java/org/apache/cxf/xjc/javadoc/PropertyJavadoc.java | 2 +- .../test/resources/complexTypeWithDocumentedAttribute.xsd | 8 ++++++++ .../resources/complexTypeWithDocumentedProperties.xsd | 8 ++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/PropertyJavadoc.java b/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/PropertyJavadoc.java index 4ecc890b..b03b1538 100644 --- a/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/PropertyJavadoc.java +++ b/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/PropertyJavadoc.java @@ -63,7 +63,7 @@ public void addJavadocs() { if (documentation == null || "".equals(documentation.trim())) { return; } - setJavadoc(documentation.trim()); + setJavadoc(documentation.replaceAll("^\\s+|\\s+$|\\s*(\n)\\s*|(\\s)\\s*", "$1$2")); } private XSComponent getDocumentedComponent(CPropertyInfo propertyInfo) { diff --git a/javadoc/src/test/resources/complexTypeWithDocumentedAttribute.xsd b/javadoc/src/test/resources/complexTypeWithDocumentedAttribute.xsd index 23cff9b1..c97377f1 100644 --- a/javadoc/src/test/resources/complexTypeWithDocumentedAttribute.xsd +++ b/javadoc/src/test/resources/complexTypeWithDocumentedAttribute.xsd @@ -28,5 +28,13 @@ Documentation of attribute + + + + Multiline documentation of + attribute + + + \ No newline at end of file diff --git a/javadoc/src/test/resources/complexTypeWithDocumentedProperties.xsd b/javadoc/src/test/resources/complexTypeWithDocumentedProperties.xsd index 47829b76..f6c4f535 100644 --- a/javadoc/src/test/resources/complexTypeWithDocumentedProperties.xsd +++ b/javadoc/src/test/resources/complexTypeWithDocumentedProperties.xsd @@ -31,6 +31,14 @@ + + + + Some multiline documentation of + element + + + \ No newline at end of file