Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 333601 - Enhancement: Customizable Name Mangling Algorithm
Summary: Enhancement: Customizable Name Mangling Algorithm
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 332770 348117
  Show dependency tree
 
Reported: 2011-01-05 15:12 EST by Blaise Doughan CLA
Modified: 2022-06-09 10:19 EDT (History)
1 user (show)

See Also:


Attachments
Proposed code changes (38.91 KB, patch)
2011-04-11 16:24 EDT, Denise Smith CLA
no flags Details | Diff
Proposed test changes (35.75 KB, patch)
2011-04-11 16:25 EDT, Denise Smith CLA
no flags Details | Diff
Proposed code changes -updated (43.70 KB, patch)
2011-04-12 15:57 EDT, Denise Smith CLA
no flags Details | Diff
Proposed test changes -updated (39.69 KB, patch)
2011-04-12 15:57 EDT, Denise Smith CLA
no flags Details | Diff
Proposed changes (49.73 KB, patch)
2011-04-20 13:35 EDT, Denise Smith CLA
no flags Details | Diff
Proposed test changes (44.07 KB, patch)
2011-04-20 13:36 EDT, Denise Smith CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Blaise Doughan CLA 2011-01-05 15:12:35 EST
A mechanism should be provided to allow the customization of the name mangling algorithm used by JAXB.  

This could be implemented as an annotation like the following (with an equivalent XML representation) that could be specified at the package/type/field/property level.  This annotation would take an impl class that provides the name mangling algorithm.

    @XmlNameMangler(UpperCaseNameMangler.class)

The impl class would need to implement an interface like the following:

    public interface NameMangler {
        mangeName(String namespaceURI, String name);

    }

MOXy could provide several implementations of this interface:

   1.  default - the standard algorithm
   2.  upper case - everything is upper case
   3.  lower case - everything is lower case
Comment 1 Blaise Doughan CLA 2011-01-05 15:15:36 EST
Some consideration should be given as to whether this can be made consistent with the schema annotation "nameXmlTransform" as described in section 7.6.1 of the JAXB 2.1 specification.
Comment 2 Blaise Doughan CLA 2011-01-07 16:06:46 EST
Correction:

The NameMangler interface should look something like:

    /**
     * Return the XML local name based on the Java attribute name
     */
    public interface NameMangler {
        String mangleName(String name);

    }
Comment 3 Denise Smith CLA 2011-04-11 16:24:16 EDT
Created attachment 192976 [details]
Proposed code changes
Comment 4 Denise Smith CLA 2011-04-11 16:25:17 EDT
Created attachment 192977 [details]
Proposed test changes
Comment 5 Denise Smith CLA 2011-04-12 15:57:13 EDT
Created attachment 193088 [details]
Proposed code changes -updated
Comment 6 Denise Smith CLA 2011-04-12 15:57:34 EDT
Created attachment 193089 [details]
Proposed test changes -updated
Comment 7 Denise Smith CLA 2011-04-20 13:35:33 EDT
Created attachment 193726 [details]
Proposed changes
Comment 8 Denise Smith CLA 2011-04-20 13:36:06 EDT
Created attachment 193727 [details]
Proposed test changes
Comment 9 Denise Smith CLA 2011-05-02 13:27:31 EDT
Fixed with patches attached.
Comment 10 Eclipse Webmaster CLA 2022-06-09 10:19:47 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink