Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.2
    • Fix Version/s: not determined
    • Component/s: xjc
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      639

      Description

      It’s possible to add a “removeAnnotatation()� method to the JAnnotatable interface?

      This wouldn’t be that hard, because all classes that implement the
      JAnnotatable interface (JDefinedClass, JEnumConstant, JMethod, JPackage, Jvar,
      ...) implement the annotations as an List like:

      private List<JAnnotationUse> annotations = null;

      All JAXB plugin developers would profit from this improvement!
      (This can be handy, if JAXB annotated a JVar with an annotation, but a plugin
      developer does something mysterious with this JVar, so new annotations are
      needed (no problem with the current design) and other annotations have to go
      (quite hard to do with the current design)

        Activity

        Hide
        florianbachmann added a comment -

        all plattforms are affected by this issue

        Show
        florianbachmann added a comment - all plattforms are affected by this issue
        Hide
        Pavel Bucek added a comment -

        Why would you want remove any annotation? What "mysterious" thing you plan to do
        with that JVar?

        Show
        Pavel Bucek added a comment - Why would you want remove any annotation? What "mysterious" thing you plan to do with that JVar?
        Hide
        florianbachmann added a comment -

        We have a frequently changing schema that is fixed for me. A XJC Plugin analysis
        the structure and adjusts the generated classes to our needs. The schema
        compiler produces, as defined by the spec, a List<String> and annotates the list
        with @XmlList. But in some cases we need to change the datatype of the list (we
        don’t use a binding customization, since we depend on type specified criteria):

        @XmlElement(namespace = "http://ANameSpace“)
        @XmlJavaTypeAdapter(AClassConverter.class)
        protected List<AClassFomerlyAString> theannotationissue;

        Adding annotations isn’t a big deal, but at the moment we use an external Perl
        script run after the build process that removes the @XmlList annotation.
        If you could enrich the API which a removeAnnotation method, we can put the
        functionality from the Perl script back into the XJC plugin. And maybe someday
        we can get rid of the Perl script and do all our work within the plugin.

        PS. A list of the annotations already set would be useful too (:

        Show
        florianbachmann added a comment - We have a frequently changing schema that is fixed for me. A XJC Plugin analysis the structure and adjusts the generated classes to our needs. The schema compiler produces, as defined by the spec, a List<String> and annotates the list with @XmlList. But in some cases we need to change the datatype of the list (we don’t use a binding customization, since we depend on type specified criteria): @XmlElement(namespace = "http://ANameSpace“) @XmlJavaTypeAdapter(AClassConverter.class) protected List<AClassFomerlyAString> theannotationissue; Adding annotations isn’t a big deal, but at the moment we use an external Perl script run after the build process that removes the @XmlList annotation. If you could enrich the API which a removeAnnotation method, we can put the functionality from the Perl script back into the XJC plugin. And maybe someday we can get rid of the Perl script and do all our work within the plugin. PS. A list of the annotations already set would be useful too (:
        Hide
        florianbachmann added a comment -

        any possible solution in sight?

        Show
        florianbachmann added a comment - any possible solution in sight?

          People

          • Assignee:
            Martin Grebac
            Reporter:
            florianbachmann
          • Votes:
            2 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: