Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@XmlAccessorType in package-info ignored #43

Closed
mwinkels opened this issue Jul 13, 2012 · 3 comments
Closed

@XmlAccessorType in package-info ignored #43

mwinkels opened this issue Jul 13, 2012 · 3 comments
Labels
Milestone

Comments

@mwinkels
Copy link

No description provided.

@mwinkels
Copy link
Author

Here is a patch for this issue:

From e192e2fbc792887a720cb3e3289cf7a81e54988b Mon Sep 17 00:00:00 2001
From: Maarten Winkels maarten.winkels@ing.nl
Date: Fri, 13 Jul 2012 14:57:14 +0200
Subject: [PATCH] Fix for issue #43: Use @XmlAccesorType in package-info.java.


.../main/java/com/lunatech/doclets/jax/Utils.java | 4 ++++
.../lunatech/doclets/jax/jaxb/model/JAXBClass.java | 5 ++++-
2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/doclets/src/main/java/com/lunatech/doclets/jax/Utils.java b/doclets/src/main/java/com/lunatech/doclets/jax/Utils.java
index 61f38a8..57fcd40 100644
--- a/doclets/src/main/java/com/lunatech/doclets/jax/Utils.java
+++ b/doclets/src/main/java/com/lunatech/doclets/jax/Utils.java
@@ -166,6 +166,10 @@ public class Utils {
return findAnnotation(parameter.annotations(), soughtAnnotations);
}

  • public static AnnotationDesc findAnnotation(final PackageDoc pack, final Class<?>... soughtAnnotations) {
  • return findAnnotation(pack.annotations(), soughtAnnotations);
  • }
  • public static AnnotationDesc findAnnotation(final AnnotationDesc[] annotations, final Class<?>... soughtAnnotations) {
    for (final AnnotationDesc annotation : annotations) {
    final AnnotationTypeDoc annotationType = annotation.annotationType();
    diff --git a/doclets/src/main/java/com/lunatech/doclets/jax/jaxb/model/JAXBClass.java b/doclets/src/main/java/com/lunatech/doclets/jax/jaxb/model/JAXBClass.java
    index 425f913..2817caa 100644
    --- a/doclets/src/main/java/com/lunatech/doclets/jax/jaxb/model/JAXBClass.java
    +++ b/doclets/src/main/java/com/lunatech/doclets/jax/jaxb/model/JAXBClass.java
    @@ -84,8 +84,11 @@ public class JAXBClass implements Comparable {
    private void setupMembers(ClassDoc klass) {
    ClassDoc accessorAnnotationType = Utils.findAnnotatedClass(klass, XmlAccessorType.class);
    AnnotationDesc accessorAnnotation = null;
  • if (accessorAnnotationType != null)
  • if (accessorAnnotationType != null) {
    accessorAnnotation = Utils.findAnnotation(accessorAnnotationType, XmlAccessorType.class);
  • } else {
  •  accessorAnnotation = Utils.findAnnotation(klass.containingPackage(), XmlAccessorType.class);
    
  • }
    XmlAccessType accessType = XmlAccessType.PUBLIC_MEMBER;
    // System.err.println("Accessor: " + accessorAnnotation);
    if (accessorAnnotation != null) {
    --
    1.7.8.msysgit.0

@FroMage
Copy link
Owner

FroMage commented Jul 24, 2012

Thanks. Could you do a pull request for this please?

FroMage added a commit that referenced this issue Jul 24, 2012
Changes for issue #42 and issue #43
@FroMage
Copy link
Owner

FroMage commented Jul 24, 2012

Sorry you already did, thanks a lot :)

@FroMage FroMage closed this as completed Jul 24, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants