You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2013/11/18 16:43:42 UTC
svn commit: r1543059 - in /cxf/xjc-utils/trunk: ./
cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/ javadoc/
javadoc/src/ javadoc/src/main/ javadoc/src/main/java/
javadoc/src/main/java/com/ javadoc/src/main/java/com/sun/
javadoc/src/main/java/...
Author: dkulp
Date: Mon Nov 18 15:43:41 2013
New Revision: 1543059
URL: http://svn.apache.org/r1543059
Log:
[CXF-5375] Add javadoc plugin.
Patch from David Pytel
Added:
cxf/xjc-utils/trunk/javadoc/
cxf/xjc-utils/trunk/javadoc/pom.xml (with props)
cxf/xjc-utils/trunk/javadoc/src/
cxf/xjc-utils/trunk/javadoc/src/main/
cxf/xjc-utils/trunk/javadoc/src/main/java/
cxf/xjc-utils/trunk/javadoc/src/main/java/com/
cxf/xjc-utils/trunk/javadoc/src/main/java/com/sun/
cxf/xjc-utils/trunk/javadoc/src/main/java/com/sun/tools/
cxf/xjc-utils/trunk/javadoc/src/main/java/com/sun/tools/xjc/
cxf/xjc-utils/trunk/javadoc/src/main/java/com/sun/tools/xjc/addon/
cxf/xjc-utils/trunk/javadoc/src/main/java/com/sun/tools/xjc/addon/dpytel/
cxf/xjc-utils/trunk/javadoc/src/main/java/com/sun/tools/xjc/addon/dpytel/javadoc/
cxf/xjc-utils/trunk/javadoc/src/main/java/com/sun/tools/xjc/addon/dpytel/javadoc/JavadocPlugin.java (with props)
cxf/xjc-utils/trunk/javadoc/src/main/java/org/
cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/
cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/
cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/
cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/
cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/JavadocInserter.java (with props)
cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/JavadocPlugin.java (with props)
cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/MethodHelper.java (with props)
cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/PropertyJavadoc.java (with props)
cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/XSComponentHelper.java (with props)
cxf/xjc-utils/trunk/javadoc/src/main/resources/
cxf/xjc-utils/trunk/javadoc/src/main/resources/META-INF/
cxf/xjc-utils/trunk/javadoc/src/main/resources/META-INF/services/
cxf/xjc-utils/trunk/javadoc/src/main/resources/META-INF/services/com.sun.tools.xjc.Plugin
cxf/xjc-utils/trunk/javadoc/src/test/
cxf/xjc-utils/trunk/javadoc/src/test/java/
cxf/xjc-utils/trunk/javadoc/src/test/java/org/
cxf/xjc-utils/trunk/javadoc/src/test/java/org/apache/
cxf/xjc-utils/trunk/javadoc/src/test/java/org/apache/cxf/
cxf/xjc-utils/trunk/javadoc/src/test/java/org/apache/cxf/xjc/
cxf/xjc-utils/trunk/javadoc/src/test/java/org/apache/cxf/xjc/javadoc/
cxf/xjc-utils/trunk/javadoc/src/test/java/org/apache/cxf/xjc/javadoc/JavadocPluginTest.java (with props)
cxf/xjc-utils/trunk/javadoc/src/test/java/org/apache/cxf/xjc/javadoc/JavadocTestHelper.java (with props)
cxf/xjc-utils/trunk/javadoc/src/test/resources/
cxf/xjc-utils/trunk/javadoc/src/test/resources/complexTypeWithDocumentedAttribute.xsd (with props)
cxf/xjc-utils/trunk/javadoc/src/test/resources/complexTypeWithDocumentedProperties-javadoc-bindings.xjb
cxf/xjc-utils/trunk/javadoc/src/test/resources/complexTypeWithDocumentedProperties.xsd (with props)
cxf/xjc-utils/trunk/javadoc/src/test/resources/complexTypeWithoutProperties.xsd (with props)
cxf/xjc-utils/trunk/javadoc/src/test/resources/enumDocumented-javadoc-bindings.xjb
cxf/xjc-utils/trunk/javadoc/src/test/resources/enumDocumented.xsd (with props)
Modified:
cxf/xjc-utils/trunk/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java
cxf/xjc-utils/trunk/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/XsdOption.java
cxf/xjc-utils/trunk/pom.xml
Modified: cxf/xjc-utils/trunk/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java
URL: http://svn.apache.org/viewvc/cxf/xjc-utils/trunk/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java?rev=1543059&r1=1543058&r2=1543059&view=diff
==============================================================================
--- cxf/xjc-utils/trunk/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java (original)
+++ cxf/xjc-utils/trunk/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java Mon Nov 18 15:43:41 2013
@@ -26,7 +26,6 @@ import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -391,13 +390,10 @@ public abstract class AbstractXSDToJavaM
artifacts.add(artifact);
MavenProject p = mavenProjectBuilder
.buildFromRepository(artifact, remoteArtifactRepositories, localRepository);
- Set a2 = p.createArtifacts(artifactFactory, Artifact.SCOPE_RUNTIME,
+ @SuppressWarnings("unchecked")
+ Set<Artifact> a2 = p.createArtifacts(artifactFactory, Artifact.SCOPE_RUNTIME,
new ScopeArtifactFilter(Artifact.SCOPE_RUNTIME));
-
- for (Iterator i = a2.iterator(); i.hasNext();) {
- Artifact a = (Artifact)i.next();
- artifacts.add(a);
- }
+ artifacts.addAll(a2);
}
for (Artifact art : artifacts) {
File f = downloader.download(art.getGroupId(), art.getArtifactId(), art.getVersion(),
@@ -433,10 +429,7 @@ public abstract class AbstractXSDToJavaM
list.add("-extension");
}
if (option.getExtensionArgs() != null) {
- Iterator it = option.getExtensionArgs().iterator();
- while (it.hasNext()) {
- list.add(it.next().toString());
- }
+ list.addAll(option.getExtensionArgs());
}
if (getLog().isDebugEnabled()) {
list.add("-verbose");
Modified: cxf/xjc-utils/trunk/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/XsdOption.java
URL: http://svn.apache.org/viewvc/cxf/xjc-utils/trunk/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/XsdOption.java?rev=1543059&r1=1543058&r2=1543059&view=diff
==============================================================================
--- cxf/xjc-utils/trunk/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/XsdOption.java (original)
+++ cxf/xjc-utils/trunk/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/XsdOption.java Mon Nov 18 15:43:41 2013
@@ -29,7 +29,7 @@ public class XsdOption {
File dependencies[];
File redundantDirs[];
boolean extension;
- List extensionArgs;
+ List<String> extensionArgs;
String catalog;
public String getPackagename() {
@@ -63,10 +63,10 @@ public class XsdOption {
public File[] getDeleteDirs() {
return redundantDirs;
}
- public List getExtensionArgs() {
+ public List<String> getExtensionArgs() {
return extensionArgs;
}
- public void setExtensionArgs(List extensionArgs) {
+ public void setExtensionArgs(List<String> extensionArgs) {
this.extensionArgs = extensionArgs;
}
public boolean isExtension() {
Added: cxf/xjc-utils/trunk/javadoc/pom.xml
URL: http://svn.apache.org/viewvc/cxf/xjc-utils/trunk/javadoc/pom.xml?rev=1543059&view=auto
==============================================================================
--- cxf/xjc-utils/trunk/javadoc/pom.xml (added)
+++ cxf/xjc-utils/trunk/javadoc/pom.xml Mon Nov 18 15:43:41 2013
@@ -0,0 +1,62 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.cxf.xjcplugins</groupId>
+ <artifactId>cxf-xjc-javadoc</artifactId>
+ <packaging>jar</packaging>
+ <name>Apache CXF XJC JavaDoc Plugin</name>
+ <url>http://cxf.apache.org</url>
+
+ <parent>
+ <groupId>org.apache.cxf.xjc-utils</groupId>
+ <artifactId>xjc-utils</artifactId>
+ <version>2.6.3-SNAPSHOT</version>
+ </parent>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-xjc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.11</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jdt</groupId>
+ <artifactId>core</artifactId>
+ <version>3.3.0-v_771</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.cedarsoft.commons</groupId>
+ <artifactId>io</artifactId>
+ <version>6.0.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Propchange: cxf/xjc-utils/trunk/javadoc/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/xjc-utils/trunk/javadoc/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: cxf/xjc-utils/trunk/javadoc/src/main/java/com/sun/tools/xjc/addon/dpytel/javadoc/JavadocPlugin.java
URL: http://svn.apache.org/viewvc/cxf/xjc-utils/trunk/javadoc/src/main/java/com/sun/tools/xjc/addon/dpytel/javadoc/JavadocPlugin.java?rev=1543059&view=auto
==============================================================================
--- cxf/xjc-utils/trunk/javadoc/src/main/java/com/sun/tools/xjc/addon/dpytel/javadoc/JavadocPlugin.java (added)
+++ cxf/xjc-utils/trunk/javadoc/src/main/java/com/sun/tools/xjc/addon/dpytel/javadoc/JavadocPlugin.java Mon Nov 18 15:43:41 2013
@@ -0,0 +1,64 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.sun.tools.xjc.addon.dpytel.javadoc;
+
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+
+import com.sun.tools.xjc.Options;
+import com.sun.tools.xjc.Plugin;
+import com.sun.tools.xjc.outline.Outline;
+
+/**
+ * Thin wrapper around the DefaultValuePlugin. This must be in the com.sun.tools.xjc.addon package for it to
+ * work with Java 6. See https://issues.apache.org/jira/browse/CXF-1880.
+ */
+public class JavadocPlugin extends Plugin {
+
+ private org.apache.cxf.xjc.javadoc.JavadocPlugin impl = new org.apache.cxf.xjc.javadoc.JavadocPlugin();
+
+ /*
+ * (non-Javadoc)
+ * @see com.sun.tools.xjc.Plugin#getOptionName()
+ */
+ @Override
+ public String getOptionName() {
+ return impl.getOptionName();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see com.sun.tools.xjc.Plugin#getUsage()
+ */
+ @Override
+ public String getUsage() {
+ return impl.getUsage();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see com.sun.tools.xjc.Plugin#run(com.sun.tools.xjc.outline.Outline, com.sun.tools.xjc.Options,
+ * org.xml.sax.ErrorHandler)
+ */
+ @Override
+ public boolean run(Outline outline, Options opt, ErrorHandler errorHandler) throws SAXException {
+ return impl.run(outline, opt, errorHandler);
+ }
+
+}
Propchange: cxf/xjc-utils/trunk/javadoc/src/main/java/com/sun/tools/xjc/addon/dpytel/javadoc/JavadocPlugin.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/JavadocInserter.java
URL: http://svn.apache.org/viewvc/cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/JavadocInserter.java?rev=1543059&view=auto
==============================================================================
--- cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/JavadocInserter.java (added)
+++ cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/JavadocInserter.java Mon Nov 18 15:43:41 2013
@@ -0,0 +1,97 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.xjc.javadoc;
+
+import java.util.Collection;
+
+import org.xml.sax.ErrorHandler;
+
+import com.sun.tools.xjc.Options;
+import com.sun.tools.xjc.outline.ClassOutline;
+import com.sun.tools.xjc.outline.EnumOutline;
+import com.sun.tools.xjc.outline.FieldOutline;
+import com.sun.tools.xjc.outline.Outline;
+import com.sun.tools.xjc.reader.xmlschema.Messages;
+import com.sun.xml.xsom.XSComponent;
+
+/**
+ * @author Dawid Pytel
+ */
+public class JavadocInserter {
+
+ private Outline outline;
+ private Options options;
+
+ public JavadocInserter(Outline outline, Options opt, ErrorHandler errorHandler) {
+ this.outline = outline;
+ this.options = opt;
+ }
+
+ /**
+ * @return true if successful
+ */
+ public boolean addJavadocs() {
+ addJavadocsToClasses();
+ addJavadocsToEnums();
+ return false;
+ }
+
+ private void addJavadocsToClasses() {
+ for (ClassOutline classOutline : outline.getClasses()) {
+ addJavadocs(classOutline);
+ }
+ }
+
+ private void addJavadocs(ClassOutline classOutline) {
+ FieldOutline[] declaredFields = classOutline.getDeclaredFields();
+ for (FieldOutline fieldOutline : declaredFields) {
+ PropertyJavadoc propertyJavadoc = new PropertyJavadoc(outline.getCodeModel(), options,
+ classOutline, fieldOutline);
+ propertyJavadoc.addJavadocs();
+ }
+ }
+
+ private void addJavadocsToEnums() {
+ Collection<EnumOutline> enums = outline.getEnums();
+ for (EnumOutline enumOutline : enums) {
+ addJavadoc(enumOutline);
+ }
+ }
+
+ private void addJavadoc(EnumOutline enumOutline) {
+ if (isCustomBindingApplied(enumOutline)) {
+ return; // JAXB binding customization overwrites xsd:documentation
+ }
+ XSComponent schemaComponent = enumOutline.target.getSchemaComponent();
+ String documentation = XSComponentHelper.getDocumentation(schemaComponent);
+ if (documentation == null || "".equals(documentation)) {
+ return;
+ }
+ enumOutline.clazz.javadoc().add(0, documentation + "\n\n");
+ }
+
+ private boolean isCustomBindingApplied(EnumOutline enumOutline) {
+ String defaultComment = Messages.format("ClassSelector.JavadocHeading", enumOutline.target
+ .getTypeName().getLocalPart());
+ // not very clean but the only way of determining whether Javadoc
+ // customization has been applied
+ return !enumOutline.target.javadoc.startsWith(defaultComment);
+ }
+
+}
Propchange: cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/JavadocInserter.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/JavadocPlugin.java
URL: http://svn.apache.org/viewvc/cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/JavadocPlugin.java?rev=1543059&view=auto
==============================================================================
--- cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/JavadocPlugin.java (added)
+++ cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/JavadocPlugin.java Mon Nov 18 15:43:41 2013
@@ -0,0 +1,64 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.xjc.javadoc;
+
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+
+import com.sun.tools.xjc.Options;
+import com.sun.tools.xjc.Plugin;
+import com.sun.tools.xjc.outline.Outline;
+
+/**
+ * Generates Javadocs based on xsd:documentation.
+ *
+ * @author Dawid Pytel
+ */
+public class JavadocPlugin extends Plugin {
+
+ /*
+ * (non-Javadoc)
+ * @see com.sun.tools.xjc.Plugin#getOptionName()
+ */
+ @Override
+ public String getOptionName() {
+ return "Xjavadoc";
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see com.sun.tools.xjc.Plugin#getUsage()
+ */
+ @Override
+ public String getUsage() {
+ return " -Xjavadoc : Generates Javadocs based on xsd:documentation.";
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see com.sun.tools.xjc.Plugin#run(com.sun.tools.xjc.outline.Outline, com.sun.tools.xjc.Options,
+ * org.xml.sax.ErrorHandler)
+ */
+ @Override
+ public boolean run(Outline outline, Options opt, ErrorHandler errorHandler) throws SAXException {
+ JavadocInserter javadocInserter = new JavadocInserter(outline, opt, errorHandler);
+ return javadocInserter.addJavadocs();
+ }
+
+}
Propchange: cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/JavadocPlugin.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/MethodHelper.java
URL: http://svn.apache.org/viewvc/cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/MethodHelper.java?rev=1543059&view=auto
==============================================================================
--- cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/MethodHelper.java (added)
+++ cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/MethodHelper.java Mon Nov 18 15:43:41 2013
@@ -0,0 +1,49 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.xjc.javadoc;
+
+import java.util.Collection;
+
+import com.sun.codemodel.JMethod;
+import com.sun.tools.xjc.outline.ClassOutline;
+
+public final class MethodHelper {
+
+ private MethodHelper() {
+ // no constructor for helper class
+ }
+
+ /**
+ * Find method in given class with given method name
+ *
+ * @param classOutline
+ * @param methodName
+ * @return method in given class with given method name
+ */
+ public static JMethod findMethod(ClassOutline classOutline, String methodName) {
+ Collection<JMethod> methods = classOutline.implClass.methods();
+ for (JMethod method : methods) {
+ if (method.name().equals(methodName)) {
+ return method;
+ }
+ }
+ return null;
+ }
+
+}
Propchange: cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/MethodHelper.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/PropertyJavadoc.java
URL: http://svn.apache.org/viewvc/cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/PropertyJavadoc.java?rev=1543059&view=auto
==============================================================================
--- cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/PropertyJavadoc.java (added)
+++ cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/PropertyJavadoc.java Mon Nov 18 15:43:41 2013
@@ -0,0 +1,127 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.xjc.javadoc;
+
+import com.sun.codemodel.JCodeModel;
+import com.sun.codemodel.JDocComment;
+import com.sun.codemodel.JFieldVar;
+import com.sun.codemodel.JMethod;
+import com.sun.codemodel.JType;
+import com.sun.tools.xjc.Options;
+import com.sun.tools.xjc.model.CPropertyInfo;
+import com.sun.tools.xjc.outline.ClassOutline;
+import com.sun.tools.xjc.outline.FieldOutline;
+import com.sun.xml.xsom.XSAttributeUse;
+import com.sun.xml.xsom.XSComponent;
+import com.sun.xml.xsom.XSParticle;
+
+public class PropertyJavadoc {
+
+ private JCodeModel codeModel;
+
+ private Options options;
+
+ private ClassOutline classOutline;
+
+ private FieldOutline fieldOutline;
+
+ public PropertyJavadoc(JCodeModel codeModel, Options options, ClassOutline classOutline,
+ FieldOutline fieldOutline) {
+ this.codeModel = codeModel;
+ this.options = options;
+ this.classOutline = classOutline;
+ this.fieldOutline = fieldOutline;
+ }
+
+ public void addJavadocs() {
+ CPropertyInfo propertyInfo = fieldOutline.getPropertyInfo();
+ if (propertyInfo == null) {
+ return;
+ }
+ if (propertyInfo.javadoc.length() > 0) {
+ return; // JAXB binding customization overwrites xsd:documentation
+ }
+ XSComponent component = getDocumentedComponent(propertyInfo);
+
+ String documentation = XSComponentHelper.getDocumentation(component);
+ if (documentation == null || "".equals(documentation.trim())) {
+ return;
+ }
+ setJavadoc(documentation.trim());
+ }
+
+ private XSComponent getDocumentedComponent(CPropertyInfo propertyInfo) {
+ XSComponent schemaComponent = propertyInfo.getSchemaComponent();
+ if (schemaComponent instanceof XSParticle) {
+ return ((XSParticle)schemaComponent).getTerm();
+ } else if (schemaComponent instanceof XSAttributeUse) {
+ return ((XSAttributeUse)schemaComponent).getDecl();
+ } else {
+ return null;
+ }
+ }
+
+ private void setJavadoc(String documentation) {
+ setJavadocToField(documentation);
+ setJavadocToGetter(documentation);
+ setSeeTagToSetter();
+ }
+
+ private void setJavadocToField(String documentation) {
+ JFieldVar fieldVar = classOutline.implClass.fields().get(fieldOutline.getPropertyInfo()
+ .getName(false));
+ if (fieldVar == null) {
+ return;
+ }
+ fieldVar.javadoc().append(documentation);
+ }
+
+ private void setJavadocToGetter(String documentation) {
+ String getterMethod = getGetterMethod();
+ JMethod getter = MethodHelper.findMethod(classOutline, getterMethod);
+ JDocComment javadoc = getter.javadoc();
+ if (javadoc.size() != 0) {
+ documentation = "\n<p>\n" + documentation;
+ }
+ javadoc.add(javadoc.size(), documentation); // add comment as last
+ // non-tag element
+ }
+
+ private void setSeeTagToSetter() {
+ JMethod setterMethod = MethodHelper.findMethod(classOutline, "set"
+ + fieldOutline.getPropertyInfo()
+ .getName(true));
+ if (setterMethod == null) {
+ return;
+ }
+ setterMethod.javadoc().addXdoclet("see #" + getGetterMethod() + "()");
+ }
+
+ private String getGetterMethod() {
+ JType type = fieldOutline.getRawType();
+ if (options.enableIntrospection) {
+ return ((type.isPrimitive() && type.boxify().getPrimitiveType() == codeModel.BOOLEAN)
+ ? "is" : "get") + fieldOutline.getPropertyInfo().getName(true);
+ } else {
+ return (type.boxify().getPrimitiveType() == codeModel.BOOLEAN ? "is" : "get")
+ + fieldOutline.getPropertyInfo().getName(true);
+ }
+ }
+
+}
Propchange: cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/PropertyJavadoc.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/XSComponentHelper.java
URL: http://svn.apache.org/viewvc/cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/XSComponentHelper.java?rev=1543059&view=auto
==============================================================================
--- cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/XSComponentHelper.java (added)
+++ cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/XSComponentHelper.java Mon Nov 18 15:43:41 2013
@@ -0,0 +1,46 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.xjc.javadoc;
+
+import com.sun.tools.xjc.reader.xmlschema.bindinfo.BindInfo;
+import com.sun.xml.xsom.XSAnnotation;
+import com.sun.xml.xsom.XSComponent;
+
+public final class XSComponentHelper {
+
+ private XSComponentHelper() {
+ // no constructor for utility class
+ }
+
+ public static String getDocumentation(XSComponent schemaComponent) {
+ if (schemaComponent == null) {
+ return null;
+ }
+ XSAnnotation xsAnnotation = schemaComponent.getAnnotation();
+ if (xsAnnotation == null) {
+ return null;
+ }
+ BindInfo annotation = (BindInfo)xsAnnotation.getAnnotation();
+ if (annotation == null) {
+ return null;
+ }
+ return annotation.getDocumentation();
+ }
+
+}
Propchange: cxf/xjc-utils/trunk/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/XSComponentHelper.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: cxf/xjc-utils/trunk/javadoc/src/main/resources/META-INF/services/com.sun.tools.xjc.Plugin
URL: http://svn.apache.org/viewvc/cxf/xjc-utils/trunk/javadoc/src/main/resources/META-INF/services/com.sun.tools.xjc.Plugin?rev=1543059&view=auto
==============================================================================
--- cxf/xjc-utils/trunk/javadoc/src/main/resources/META-INF/services/com.sun.tools.xjc.Plugin (added)
+++ cxf/xjc-utils/trunk/javadoc/src/main/resources/META-INF/services/com.sun.tools.xjc.Plugin Mon Nov 18 15:43:41 2013
@@ -0,0 +1 @@
+org.apache.cxf.xjc.javadoc.JavadocPlugin
\ No newline at end of file
Added: cxf/xjc-utils/trunk/javadoc/src/test/java/org/apache/cxf/xjc/javadoc/JavadocPluginTest.java
URL: http://svn.apache.org/viewvc/cxf/xjc-utils/trunk/javadoc/src/test/java/org/apache/cxf/xjc/javadoc/JavadocPluginTest.java?rev=1543059&view=auto
==============================================================================
--- cxf/xjc-utils/trunk/javadoc/src/test/java/org/apache/cxf/xjc/javadoc/JavadocPluginTest.java (added)
+++ cxf/xjc-utils/trunk/javadoc/src/test/java/org/apache/cxf/xjc/javadoc/JavadocPluginTest.java Mon Nov 18 15:43:41 2013
@@ -0,0 +1,240 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.xjc.javadoc;
+
+
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import com.sun.tools.xjc.BadCommandLineException;
+import com.sun.tools.xjc.Driver;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTParser;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.EnumDeclaration;
+import org.eclipse.jdt.core.dom.FieldDeclaration;
+import org.eclipse.jdt.core.dom.Javadoc;
+import org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.apache.cxf.xjc.javadoc.JavadocTestHelper.containsTag;
+import static org.apache.cxf.xjc.javadoc.JavadocTestHelper.javadocContains;
+import static org.hamcrest.CoreMatchers.any;
+import static org.hamcrest.CoreMatchers.hasItem;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+
+/**
+ * End-to-end integration test of JavadocPlugin
+ *
+ * @author Dawid Pytel
+ */
+public class JavadocPluginTest {
+
+ private static final String PACKAGE_DIR = "org/example/xjc_javadoc_plugin";
+ private static final String OUTPUT_DIR = "target";
+
+ @Before
+ public void deleteAllGeneratedFiles() throws IOException {
+ File generatedFilesDir = new File(OUTPUT_DIR, PACKAGE_DIR);
+ FileUtils.deleteDirectory(generatedFilesDir);
+ }
+
+ @Test
+ public void pluginShouldBeLoaded() throws Exception {
+ try {
+ Driver.run(new String[] {}, System.out, System.out);
+ fail("Expected xjc to fail with BadCommandLineException");
+ } catch (BadCommandLineException e) {
+ assertThat(e.getOptions().getAllPlugins(), hasItem(any(JavadocPlugin.class)));
+ }
+ }
+
+ @Test
+ public void testComplexTypeWithDocumentedProperties() throws Exception {
+ String fileName = "complexTypeWithDocumentedProperties.xsd";
+
+ assertProcessedSuccessful(fileName);
+
+ CompilationUnit compilationUnit = parseSourceFile("ComplexTypeWithDocumentedProperties.java");
+ Javadoc fieldJavadoc = getJavadocOfField(compilationUnit, "documentedElement");
+ assertThat(fieldJavadoc, javadocContains("Some documentation of element"));
+
+ Javadoc getterJavadoc = getJavadocOfMethod(compilationUnit, "getDocumentedElement");
+ assertThat(getterJavadoc, javadocContains("Some documentation of element"));
+
+ Javadoc setterJavadoc = getJavadocOfMethod(compilationUnit, "setDocumentedElement");
+ assertThat(setterJavadoc, containsTag("@see", "#getDocumentedElement()"));
+ }
+
+ @Test
+ public void testComplexTypeWithoutProperties() throws Exception {
+ String fileName = "complexTypeWithoutProperties.xsd";
+ assertProcessedSuccessful(fileName);
+ }
+
+ @Test
+ public void testDocumentedEnum() throws Exception {
+ String fileName = "enumDocumented.xsd";
+ assertProcessedSuccessful(fileName);
+
+ CompilationUnit compilationUnit = parseSourceFile("EnumDocumented.java");
+ EnumDeclaration type = getTopLevelEnum(compilationUnit);
+ assertThat(type.getJavadoc(), javadocContains("Documentation of enumDocumented"));
+ }
+
+ @Test
+ public void testDocumentationOnPropertiesIsOverwrittenByJAXBBindings() throws Exception {
+ String fileName = "complexTypeWithDocumentedProperties.xsd";
+
+ assertProcessedSuccessful(fileName, "-b",
+ getAbsolutePath("complexTypeWithDocumentedProperties-javadoc-bindings.xjb"));
+
+ CompilationUnit compilationUnit = parseSourceFile("ComplexTypeWithDocumentedProperties.java");
+ Javadoc fieldJavadoc = getJavadocOfField(compilationUnit, "documentedElement");
+ assertThat(fieldJavadoc, not(javadocContains("Some documentation of element")));
+
+ Javadoc getterJavadoc = getJavadocOfMethod(compilationUnit, "getDocumentedElement");
+ assertThat(getterJavadoc, not(javadocContains("Some documentation of element")));
+ assertThat(getterJavadoc, javadocContains("Documentation from JAXB binding customization"));
+ }
+
+ @Test
+ public void testDocumentationOnEnumsIsOverwrittenByJAXBBindings() throws Exception {
+ String fileName = "enumDocumented.xsd";
+ assertProcessedSuccessful(fileName, "-b", getAbsolutePath("enumDocumented-javadoc-bindings.xjb"));
+
+ CompilationUnit compilationUnit = parseSourceFile("EnumDocumented.java");
+ EnumDeclaration type = getTopLevelEnum(compilationUnit);
+ assertThat(type.getJavadoc(), not(javadocContains("Documentation of enumDocumented")));
+ assertThat(type.getJavadoc(), javadocContains("Documentation from JAXB binding customization"));
+ }
+
+ @Test
+ public void testComplexTypeWithDocumentedAttribute() throws Exception {
+ String fileName = "complexTypeWithDocumentedAttribute.xsd";
+
+ assertProcessedSuccessful(fileName);
+
+ CompilationUnit compilationUnit = parseSourceFile("ComplexTypeWithDocumentedAttribute.java");
+ Javadoc fieldJavadoc = getJavadocOfField(compilationUnit, "documentedAttribute");
+ assertThat(fieldJavadoc, javadocContains("Documentation of attribute"));
+
+ Javadoc getterJavadoc = getJavadocOfMethod(compilationUnit, "getDocumentedAttribute");
+ assertThat(getterJavadoc, javadocContains("Documentation of attribute"));
+ }
+
+ private void assertProcessedSuccessful(String fileName, String... params) throws Exception {
+ String xsdPath = getAbsolutePath(fileName);
+ List<String> args = new ArrayList<String>(Arrays.asList(xsdPath, "-Xjavadoc", "-d", OUTPUT_DIR));
+ args.addAll(Arrays.asList(params));
+ int result = runXjc(args);
+
+ assertThat(result, is(0));
+ }
+
+ private String getAbsolutePath(String fileName) {
+ return new File("src/test/resources", fileName).getAbsolutePath();
+ }
+
+ private int runXjc(List<String> args) throws Exception {
+ return Driver.run(args.toArray(new String[args.size()]), System.out, System.out);
+ }
+
+ private Javadoc getJavadocOfField(CompilationUnit compilationUnit, String fieldName) {
+ TypeDeclaration type = getTopLevelType(compilationUnit);
+ FieldDeclaration[] fields = type.getFields();
+ FieldDeclaration field = findField(fields, fieldName);
+ return field.getJavadoc();
+ }
+
+ private Javadoc getJavadocOfMethod(CompilationUnit compilationUnit, String methodName) {
+ TypeDeclaration type = getTopLevelType(compilationUnit);
+ MethodDeclaration[] methods = type.getMethods();
+ MethodDeclaration method = findMethod(methods, methodName);
+ return method.getJavadoc();
+ }
+
+ private CompilationUnit parseSourceFile(String fileName) throws IOException, FileNotFoundException {
+ FileReader inputFile = new FileReader(new File(OUTPUT_DIR + "/" + PACKAGE_DIR, fileName));
+ char[] classChars = IOUtils.toCharArray(inputFile);
+ inputFile.close();
+ ASTParser parser = ASTParser.newParser(AST.JLS3);
+ @SuppressWarnings("rawtypes")
+ Map options = JavaCore.getOptions();
+ JavaCore.setComplianceOptions(JavaCore.VERSION_1_5, options);
+ parser.setCompilerOptions(options);
+ parser.setSource(classChars);
+ CompilationUnit compilationUnit = (CompilationUnit)parser.createAST(null);
+
+ return compilationUnit;
+ }
+
+ private FieldDeclaration findField(FieldDeclaration[] fields, String fieldName) {
+ for (FieldDeclaration field : fields) {
+ VariableDeclarationFragment fragment = (VariableDeclarationFragment)field.fragments().get(0);
+ String identifier = fragment.getName().getIdentifier();
+ if (identifier.equals(fieldName)) {
+ return field;
+ }
+ }
+ fail("Expected to find field: " + fieldName);
+ return null; // never reached
+ }
+
+ private MethodDeclaration findMethod(MethodDeclaration[] methods, String methodName) {
+ for (MethodDeclaration method : methods) {
+ if (methodName.equals(method.getName().getIdentifier())) {
+ return method;
+ }
+ }
+ fail("Expected to find method: " + methodName);
+ return null; // never reached
+ }
+
+ private TypeDeclaration getTopLevelType(CompilationUnit compilationUnit) {
+ return (TypeDeclaration)getTopLevelDeclaration(compilationUnit);
+ }
+
+ private EnumDeclaration getTopLevelEnum(CompilationUnit compilationUnit) {
+ return (EnumDeclaration)getTopLevelDeclaration(compilationUnit);
+ }
+
+ private Object getTopLevelDeclaration(CompilationUnit compilationUnit) {
+ return compilationUnit.types().get(0);
+ }
+}
Propchange: cxf/xjc-utils/trunk/javadoc/src/test/java/org/apache/cxf/xjc/javadoc/JavadocPluginTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: cxf/xjc-utils/trunk/javadoc/src/test/java/org/apache/cxf/xjc/javadoc/JavadocTestHelper.java
URL: http://svn.apache.org/viewvc/cxf/xjc-utils/trunk/javadoc/src/test/java/org/apache/cxf/xjc/javadoc/JavadocTestHelper.java?rev=1543059&view=auto
==============================================================================
--- cxf/xjc-utils/trunk/javadoc/src/test/java/org/apache/cxf/xjc/javadoc/JavadocTestHelper.java (added)
+++ cxf/xjc-utils/trunk/javadoc/src/test/java/org/apache/cxf/xjc/javadoc/JavadocTestHelper.java Mon Nov 18 15:43:41 2013
@@ -0,0 +1,81 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.xjc.javadoc;
+
+import java.util.List;
+
+import org.eclipse.jdt.core.dom.Javadoc;
+import org.eclipse.jdt.core.dom.TagElement;
+import org.hamcrest.Description;
+import org.hamcrest.Matcher;
+import org.hamcrest.TypeSafeMatcher;
+
+/**
+ * Utility methods for tests
+ *
+ * @author Dawid Pytel
+ */
+public final class JavadocTestHelper {
+ private JavadocTestHelper() {
+ //utility class
+ }
+
+ public static Matcher<Javadoc> javadocContains(final String comment) {
+ return new TypeSafeMatcher<Javadoc>(Javadoc.class) {
+
+ @Override
+ protected boolean matchesSafely(Javadoc javadoc) {
+ TagElement tagElement = (TagElement)javadoc.tags().get(0);
+ List<?> fragments = tagElement.fragments();
+ for (Object fragment : fragments) {
+ if (fragment != null && fragment.toString().contains(comment)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public void describeTo(Description description) {
+ description.appendText("javadoc contains given comment: " + comment);
+ }
+ };
+ }
+
+ public static Matcher<Javadoc> containsTag(final String tagName, final String tagValue) {
+ return new TypeSafeMatcher<Javadoc>(Javadoc.class) {
+
+ @Override
+ protected boolean matchesSafely(Javadoc javadoc) {
+ @SuppressWarnings("unchecked")
+ List<TagElement> tags = javadoc.tags();
+ for (TagElement tagElement : tags) {
+ if (tagName.equals(tagElement.getTagName())) {
+ return tagValue.equals(tagElement.fragments().get(0).toString());
+ }
+ }
+
+ return false;
+ }
+
+ public void describeTo(Description description) {
+ description.appendText("javadoc contains tag " + tagName + " " + tagValue);
+ }
+ };
+ }
+}
Propchange: cxf/xjc-utils/trunk/javadoc/src/test/java/org/apache/cxf/xjc/javadoc/JavadocTestHelper.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: cxf/xjc-utils/trunk/javadoc/src/test/resources/complexTypeWithDocumentedAttribute.xsd
URL: http://svn.apache.org/viewvc/cxf/xjc-utils/trunk/javadoc/src/test/resources/complexTypeWithDocumentedAttribute.xsd?rev=1543059&view=auto
==============================================================================
Binary file - no diff available.
Propchange: cxf/xjc-utils/trunk/javadoc/src/test/resources/complexTypeWithDocumentedAttribute.xsd
------------------------------------------------------------------------------
svn:mime-type = application/xml
Added: cxf/xjc-utils/trunk/javadoc/src/test/resources/complexTypeWithDocumentedProperties-javadoc-bindings.xjb
URL: http://svn.apache.org/viewvc/cxf/xjc-utils/trunk/javadoc/src/test/resources/complexTypeWithDocumentedProperties-javadoc-bindings.xjb?rev=1543059&view=auto
==============================================================================
--- cxf/xjc-utils/trunk/javadoc/src/test/resources/complexTypeWithDocumentedProperties-javadoc-bindings.xjb (added)
+++ cxf/xjc-utils/trunk/javadoc/src/test/resources/complexTypeWithDocumentedProperties-javadoc-bindings.xjb Mon Nov 18 15:43:41 2013
@@ -0,0 +1,30 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+ <jaxb:bindings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
+ xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd"
+ jaxb:version="2.1" schemaLocation="complexTypeWithDocumentedProperties.xsd"
+ node="//xs:complexType[@name='ComplexTypeWithDocumentedProperties']/xs:sequence/xs:element[@name='documentedElement']">
+
+ <jaxb:property>
+ <jaxb:javadoc>Documentation from JAXB binding customization</jaxb:javadoc>
+ </jaxb:property>
+
+</jaxb:bindings>
\ No newline at end of file
Added: cxf/xjc-utils/trunk/javadoc/src/test/resources/complexTypeWithDocumentedProperties.xsd
URL: http://svn.apache.org/viewvc/cxf/xjc-utils/trunk/javadoc/src/test/resources/complexTypeWithDocumentedProperties.xsd?rev=1543059&view=auto
==============================================================================
Binary file - no diff available.
Propchange: cxf/xjc-utils/trunk/javadoc/src/test/resources/complexTypeWithDocumentedProperties.xsd
------------------------------------------------------------------------------
svn:mime-type = application/xml
Added: cxf/xjc-utils/trunk/javadoc/src/test/resources/complexTypeWithoutProperties.xsd
URL: http://svn.apache.org/viewvc/cxf/xjc-utils/trunk/javadoc/src/test/resources/complexTypeWithoutProperties.xsd?rev=1543059&view=auto
==============================================================================
Binary file - no diff available.
Propchange: cxf/xjc-utils/trunk/javadoc/src/test/resources/complexTypeWithoutProperties.xsd
------------------------------------------------------------------------------
svn:mime-type = application/xml
Added: cxf/xjc-utils/trunk/javadoc/src/test/resources/enumDocumented-javadoc-bindings.xjb
URL: http://svn.apache.org/viewvc/cxf/xjc-utils/trunk/javadoc/src/test/resources/enumDocumented-javadoc-bindings.xjb?rev=1543059&view=auto
==============================================================================
--- cxf/xjc-utils/trunk/javadoc/src/test/resources/enumDocumented-javadoc-bindings.xjb (added)
+++ cxf/xjc-utils/trunk/javadoc/src/test/resources/enumDocumented-javadoc-bindings.xjb Mon Nov 18 15:43:41 2013
@@ -0,0 +1,30 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+ <jaxb:bindings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
+ xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd"
+ jaxb:version="2.1" schemaLocation="enumDocumented.xsd"
+ node="//xs:simpleType[@name='enumDocumented']">
+
+ <jaxb:typesafeEnumClass>
+ <jaxb:javadoc>Documentation from JAXB binding customization</jaxb:javadoc>
+ </jaxb:typesafeEnumClass>
+
+</jaxb:bindings>
\ No newline at end of file
Added: cxf/xjc-utils/trunk/javadoc/src/test/resources/enumDocumented.xsd
URL: http://svn.apache.org/viewvc/cxf/xjc-utils/trunk/javadoc/src/test/resources/enumDocumented.xsd?rev=1543059&view=auto
==============================================================================
Binary file - no diff available.
Propchange: cxf/xjc-utils/trunk/javadoc/src/test/resources/enumDocumented.xsd
------------------------------------------------------------------------------
svn:mime-type = application/xml
Modified: cxf/xjc-utils/trunk/pom.xml
URL: http://svn.apache.org/viewvc/cxf/xjc-utils/trunk/pom.xml?rev=1543059&r1=1543058&r2=1543059&view=diff
==============================================================================
--- cxf/xjc-utils/trunk/pom.xml (original)
+++ cxf/xjc-utils/trunk/pom.xml Mon Nov 18 15:43:41 2013
@@ -59,6 +59,7 @@
<module>wsdlextension-test</module>
<module>bug671</module>
<module>property-listener</module>
+ <module>javadoc</module>
<module>runtime</module>
</modules>
<repositories>
@@ -353,19 +354,19 @@
<dependency>
<groupId>org.apache.cxf.build-utils</groupId>
<artifactId>cxf-buildtools</artifactId>
- <version>2.5.0</version>
+ <version>2.6.0</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
- <version>2.6</version>
+ <version>2.9.1</version>
<dependencies>
<dependency>
<groupId>org.apache.cxf.build-utils</groupId>
<artifactId>cxf-buildtools</artifactId>
- <version>2.5.0</version>
+ <version>2.6.0</version>
</dependency>
</dependencies>
<configuration>
@@ -393,12 +394,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
- <version>2.4</version>
+ <version>3.0.1</version>
<dependencies>
<dependency>
<groupId>org.apache.cxf.build-utils</groupId>
<artifactId>cxf-buildtools</artifactId>
- <version>2.5.0</version>
+ <version>2.6.0</version>
</dependency>
</dependencies>
<configuration>