Class Name customization in JAXB

Does Sun Jaxb allows customizing class names so that they are same as in schema definition, instad of Java format. For example, if a purhcaseorder schema has complex type named purchaseorder, jaxb generates Class by PurchaseOrder, is there a way to not to do this. Similllary for elements and attributes
Thanks

Customize JAXB? Ha ha ha! That's a good one.
I can't remember if this is one of the irregular selection of things you can specify. Have you messed around with the binding document? I can't remember what they call it. It's a mapping doucment that's supposed to allow you to do this type of thing but I find it's often not functional.

Similar Messages

  • Customize names of generated JAXB classes

    I have a peculiar requirement. We have been using JAXB1.0 in our project to parse XMLs. External binding files were used to provide proper names for the generated JAXB classes. Now, I have an xml that looks something like this:
    //sample xml. Original format is much bigger
    <b>
    <MasterTag>
    <attr id="123">Value1</attr>
    <attr id="736">Value2</attr>
    <attr id="900">value3</attr>
    </MasterTag>
    </b>
    There's a property file which has key value pairs for the attr id
    Eg:
    <b>
    123=CompanyID
    736=CompanyAddress
    900=CompanyPinCode
    </b>
    Is it possible to generate JAXB classes names based on the attr id value? These values finally need to persisted in the db. JAXB is the preferred technology.
    Any other ideas are also welcome. Thanks.

    I might be misunderstanding your question, but if you control the single large schema, it would be simple to define the things that you want to treat specially as either individual elements or complexTypes inside the single schema file. Using psuedo-schema, say you have something like this now:
    <xs:element name='Information'>
      <xs:complexType>
        <xs:sequence>
          <xs:element name='Header'>
              <!-- your definition here -->
          </xs:element>
          <xs:element name='Item' maxOccurs='unbounded'>
              <!-- your definition here -->
          </xs:element>
        </xs:sequence>
      </xs:complexType>
    </xs:element>You can change that to:
    <xs:element name='Information'>
      <xs:complexType>
        <xs:sequence>
          <xs:element ref='Header'/>
          <xs:element name='Item' maxOccurs='unbounded'>
              <!-- your definition here -->
          </xs:element>
        </xs:sequence>
      </xs:complexType>
    </xs:element>
    <xs:element name='Header'>
      <!-- your definition here -->
    </xs:element>That should produce distinct classes for your Information and Header elements. You similary can break out the Item and Trailer elements.

  • Automate Customization of "Application customization class name" in BPM

    Hi,
    I am from BPM Process Accelerators team.
    We are trying to automate the "Process Accelerator" install process in DTE.
    As part of PA post install tasks, we have to add the value *"oracle.bpmpa.global.model.WorkspaceExternalApp"* against the *"Application customization class name"* field in Application Preferences page in BPM.
    We have to automate this activity by writing appropriate script/code.
    Any suggestions on how we can achieve this ?
    Thanks,
    MD

    Hi Madhusudan,
    See if this might help: http://java.net/downloads/oraclebpmsuite11g/Samples/bpm-CustomizingWorkspace/BPM-CustomizingWS.pdf
    Dan

  • Modify Application Customization Class Name in BPM Workspace

    Hi,
    We are working on automating the installation of BPM PAs and execution of MATS tests from DTE topo. One of the post install tasks (after installing BPM PA) involves modifying the value of Application Customization Class Name in BPM Workspace.
    Steps to modify it are as below :
    1.Login to BPM workspace
    2.Navigate to Administration -> Application Preferences
    3.Modify the Application Customization Class Name
    4.Restart the application.
    I am looking for info on how to automate the above steps. Any Java APIs that can be of use ?
    Any suggestions would be helpful.
    Thanks,
    Madhusudan

    Hi Madhusudan,
    See if this might help: http://java.net/downloads/oraclebpmsuite11g/Samples/bpm-CustomizingWorkspace/BPM-CustomizingWS.pdf
    Dan

  • JAXB compiler for class names with special characters

    Hi,
    I trying to run the xjc against an XSD where element names (class names) have an "_" in them. For eg ACCOUNT_AKG.
    JAXB creates a class ACCOUNTAKG and omits the "_". I need "_" to be preserved in the class name of the class is generated.
    Can someone show me the right direction , so I can create classes with "_" preserved in the class name.
    This would be a big help
    thanks
    Jax

    Hi,
    I trying to run the xjc against an XSD where element names (class names) have an "_" in them. For eg ACCOUNT_AKG.
    JAXB creates a class ACCOUNTAKG and omits the "_". I need "_" to be preserved in the class name of the class is generated.
    Can someone show me the right direction , so I can create classes with "_" preserved in the class name.
    This would be a big help
    thanks
    Jax

  • How to change generated class name when create binding files.

    I have a dtd file, which has lines like this:
    <!ELEMENT rights (
         %plain-text;
         | rights.owner
         | rights.startdate
         | rights.enddate
         | rights.agent
         | rights.geography
         | rights.type
         | rights.limitations
         )*>
         <!ELEMENT rights.type (%plain-text;)*>
    when i use xjc to create binding files, I got an error:
    trying to create the same field twice: value.
    I suspect that the reason is because the name of rights and rights.type.
    so, i'd like to know how can i control the generated class name. for example, i want to generate a class RightTypeEle for element rights.type. how can do that?
    btw, i use latest version of jaxb.
    Thanks in advance.

    hi Vincentq,
    What function are you using to create the attachment?  Have you looked at SAP_WAPI_ATTACHMENT_ADD?
    Cheers,
    Sue

  • Help - Class name and descriptions for a function location.

    Hi Guys
    i have to write a report that displays the class and class descriptions for a function location. the user passes in either the function location(TPLNR) or the class name and  the report should display the the class characteristics and resp. values. Is there a FM that i coud use?
    please help.
    many thanks.
    seelan.

    sadiepu1 wrote:
    When I set up Words with Friends on my Fire it asked for my username and password which from a previous reply to my inquiry above stated that the S 3 doesn't store due to privacy issues. I have tried all my usual combinations of usernames and passwords and my Fire won't let me access the game as it keeps telling me that one or the other is not correct. I have deleted the app from my Fire and re-downloaded it but have the same error comes up. I have accessed the Words with Friends support both on my phone and their website but there is no live chat. I might have to take both to a Verizon store. Also, my Fire won't let me access the game without a correct username and password. To say that I am frustrated would be an understatement as well I have tried everything I can think of with no luck! Thanks for any help you can give!
    Did you use facebook to log in? 
    Verizon will not be able to help you retrieve any of the information you need.  You will have to contact Zynga.

  • How can i get all java class names from a package using reflection?

    hi,
    can i get all classes name from a package using reflection or any other way?
    If possible plz give the code with example.

    You can't, because the package doesn't have to be on the local machine. It could be ANYWHERE.
    For example, via a URLClassLoader (ie from the internet) I could load a class called:
    com.paperstack.NobodyExpectsTheSpanishInquisitionI haven't written it yet. But I might tomorrow. How are you going to determine if that class is in the package?
    This subject comes up a lot. If you want to do something a bit like what you're asking for (but not quite) there are plenty of threads on the subject. Use google and/or the forum search facility to find them.
    But the answer to your question, as you asked it, is "you can't do that".

  • How to find the class name of the  BO

    HI
      How to find out a class for a business object.
    For example for the Business Object FORMABSENC i want to find out the class name.
    iam not able to find out from se24 or swo1.
    Or please suggest me how can i use the method createbapistructure of this businessobject.
    Regards
    vijaya

    Hello Vijay
    When you double-click on "method" AbsenceForm.CreateBapiStructure (transaction SWO1) and switch to tab ABAP you see (on ERP 6.0) that the field Name is empty meaning this BO "method" has not yet been implemented.
    Other methods are implemented by modules of function group SWXA. Checking package SWX you will see that there are no suitable classes around for this object.
    Final remark: Methods of business objects has just a semantic meaning and has nothing to do with object orientation (i.e. classes).
    Regards
      Uwe

  • Object class name does not exist in IDM

    Hi Team
    We are process of Integrating GRC 10.1 to Enterprise Portal.Followed accordingly as per the SAP Note No. 1977781.
    While running the Schema Job, we get a message Schema Imported Suxcessfully. While running the Job : GRAC_REPOSITORY_SYNC_JOB, the job
    shows successful, but a Warning Message : User Adaptor Empty in SLG1 T.code.
    I have checked the Path suffix,connectors,data source and all are maintained but no sure about this warning message.
    Secondly,I tried for test creation of user on Portal via GRC 10.1.I am getting below error
    "Object class name does not exist in IDM" Please see log below
    Request gets closed stating Auto Provisioning failed.Please advice if someone has faced same issue and the steps taken to rectify it.
    Thanks
    Nitesh

    Hi Nitesh,
    We worked on this issue for quiet sometime with SAP to get this finally fixed You can check all below mentioned notes.
    First Check:
    Please check the Note: 1915763 - Error Provisioning from GRC 10 to SAP Portal while adding or removing a role in Change Account request type.
    This Note says that if your LDAP set as data source is read-only in Portal, then you need to change it to Modifiable in order to allow create or change user belonging to LDAP.
    We have set the UME correctly and no longer read-only. But our access requests still used to fail with the following messages.
    "Object class name does not exist in IDM".
    Second Check:
    Kindly ensure the field mapping for portal is done in IMG settings properly.
    If it is fine please check below note 2033714 - AC10.0: error in SGL1 "Object class name does not exist in IDM".
    This note is only to check if you have made any mistake with your portal mapping and doesn't address the correct issue.
    Third Check:
    Finally after implementing SAP note 1941250 - UAM: Truncated parameters provisioned on changing users from Access Request
    our issue got fixed.
    Regards,
    Madhu.

  • Class name of  stub for EJBHome Impl

    Hi,
    I am doing a context.lookup to find the EJBHome stub and I print the class name
    of the object that is looked up, every time a diffrent name comes up.
    Object obj = ic.lookup("ejb/test");
    System.out.println(hh.getClass().getName());
    I get $Proxy1
    and when I add the two more lines
    Object obj1 = ic.lookup("javax/jms/QueueConnectionFactory");
    System.out.println(obj1.getClass().getName());
    Object obj = ic.lookup("ejb/test");
    System.out.println(obj.getClass().getName());
    and re-run only my client I get:
    weblogic.jms.client.JMSConnectionFactory
    $Proxy2
    I understand that weblogic generates the stub dynamically, but how come (class name
    of) a object bound to JNDI tree keeps changing?
    and why does that happen for the connection factory(is that not a RMI stub too)?
    viswa

    viswa <[email protected]> wrote:
    Hi,
    I am doing a context.lookup to find the EJBHome stub and I print the class name
    of the object that is looked up, every time a diffrent name comes up.
    Object obj = ic.lookup("ejb/test");
    System.out.println(hh.getClass().getName());
    I get $Proxy1
    and when I add the two more lines
    Object obj1 = ic.lookup("javax/jms/QueueConnectionFactory");
    System.out.println(obj1.getClass().getName());
    Object obj = ic.lookup("ejb/test");
    System.out.println(obj.getClass().getName());
    and re-run only my client I get:
    weblogic.jms.client.JMSConnectionFactory
    $Proxy2
    I understand that weblogic generates the stub dynamically, but how come (class name
    of) a object bound to JNDI tree keeps changing?You can look at java/lang/reflect/Proxy.java to see how proxy class names are generated.
    BTW, it looks like WebLogic 7.0 doesn't use JDK dynamic proxies anymore and generates
    stub/skeleton bytecode by itself, so Stub class names are no longer $Proxy123 but xxx_WLStub.
    and why does that happen for the connection factory(is that not a RMI stub too)?My guess is that the actual stub reference is buried somewhere else.
    viswa--
    Dimitri

  • Class name and file name

    if i have putiple classes in a single file then if a clas declared as public then the file name shoud me same as class name.... why?
    if i declare two public class in a same source fiel what will happen????????
    plz help................
    thanks in advance

    And i bet a million dollars that even you don't
    search the forum before posting anything . So stop
    suggesting that .Too bad that I wasn't included in the bet. You won't be coz you are a veteran and it's from you and the other veterans(I will include my peers as well) that i learnt a lot including good googling.
    It happens
    that I search the forum before I post an answer.
    Searching the forum using google is actually very
    effective.Yes and thats the very reason i didn't mention googling in that reply because i know that google gives the results from the threads in the forum as i myself have read a lot of posts at this forum using google and obtained solutions.But it's a different case when a person has to manually search the forum(without google) to see if a topic matches his needs and as i just mentioned off lately most of the posts come out with crappy headers like "Please Help Me" ; "Error" ; "Can't compile" ; "Help Needed" ; "What's wrong in this".How much sense does these headers make with respect to the what the post is really about.One can't expect a person to verify each such post with such crappy headers and read each's contentns.Just imagine how frustrating it is.Even the posters lose their cool when someone posts with such titles.Then just imagine what will be the condition of the person who is asked to check the forum before posting.But i totally endorse googling.There is no pardon or any sort of respite for a person who has posted without googling which would have fetched him top notch answers.
    Oh God!That looks really long!

  • Class name and package name clashing

    When i have a class and a package with the same name, I cannot access classes in the package. For example I have 3 classes and 1 package as below
    - Test.java
    - PackageName.java
    + PackageName // this is a directory
    - MyClass.java
    Below are the codes of .java files
    Test.java
    =======
    public class Test { PackageName.MyClass a = new PackageName.MyClass ();}
    PackageName.java
    ===============
    public class PackageName{ }
    MyClass.java
    ==========
    package PackageName; public class MyClass { }
    I can compile PackageName.java and MyClass.java but not Test.java. It says
    cannot resolve symbol
    symbol : class MyClass
    location: class PackageName
    PackageName.MyClass a = new PackageName.MyClass ();
    But if I remove the PackageName.java, I can compile Test.java perfectly. I think when I use PackageName.MyClass, java thinks that I try to access an inner class MyClass of PackageName class, and that does not exists. Is there any way to solve this ambiguation, other than making the package name and class name different? Thank you very much.

    This works fine: just add an import to Test.java.
    import PackageName.MyClass;
    public class Test
        public static void main(String [] args)
            MyClass a = new MyClass();
    public class PackageName {}
    package PackageName;
    public class MyClass {}It's a pretty wacky, useless example, but it works.
    Plus I thought inner classes would have a dollar sign in their .class file names. When I compile this:
    public class OuterClass
        public static void main(String [] args)
            OuterClass outer = new OuterClass();
            System.out.println(outer);
        public String toString() { return "I'm an OuterClass"; }
        class InnerClass
            public String toString() { return "I'm an InnerClass"; }
    }I see two .class files: OuterClass.class and OuterClass$InnerClass.class
    Why make up examples like this? It's hard enough writing code, and it's easy to disambiguate for the compiler.

  • Driver Class name and JDBC URL Format

    Hi,
    I'm trying to use the oracle jdbc driver to connect to an (what a surprise) oracle database.
    I need a 'driver class name' and the JDBC URL Format. But I cannot find these anywhere.
    Can anyone help me out here?
    Regards,
    Laurens

    http://myjdbc.tripod.com/basic/jdbcurl.html

  • How to convert a String variable as class name and method name?

    i have two classes
    class Student
    public String insertStudent(String sname)
    { return("Student has been inserted ");     }
    class Teacher
    public String execute(String methodName, String className)
    {  //return statement of the method 'insertStudent' in the class 'Student'; }
    }Now, i have a class with the main method. Here, i would like to call the method *'insertStudent'* of class *'Student'*
    using the method *'execute'* of class *'Teacher',* passing the method-name and the class-name (viz. insertStudent, Student) as the
    String parameter.
    Can anyone please help me out. Thanks
    regards,
    chinglai

    You should have just added that as a comment on your [initial posting|http://forums.sun.com/thread.jspa?threadID=5334953] instead of starting a new thread.
    Now, i have a class with the main method. Here, i would like to call the method 'insertStudent' of class 'Student'using the method 'execute' of class 'Teacher', passing the method-name and the class-name (viz. insertStudent, Student) as the
    String parameter.
    Why oh why? What do you want to achieve?
    Let me tell you: there is a way to do what you try to do, but it's not recommended and should be used only very sparingly. Especially not in anything like your code, that resembles normal business logic (as opposed to an application framework such as Spring, for example).
    Can you explain what exactly you want to do with that? Why should a Teacher be able to call any random method ony any other class. And what good would that do?

Maybe you are looking for

  • How to upload multiple items of sales order?

    I have extracted open sales order and transferred it to an excel file. Some SO doument has multiple items on one SO. If I will upload that SO document (with multiple items) into a new server, how am I suppose to itemize that this document has multipl

  • Early 2008 Mac Pro wakes up from sleep with Mavericks.

    Ever since I upgraded to OSX Mavericks on Tuesday, my early 2008 Mac Pro keeps waking up from sleep mode every couple hours. It goes back to sleep again on its own though after a minute, so I'm thinking it's some kind of new automated feature that I'

  • Not all of the host cluster nodes are marked as possible owners for the vms on this cluster

    I get this message in a cluster's properties after having replaced nodes' hardware (but keeping the same names). I noticed that some of the VMs in their settings have all the nodes but one checked as Possible Owners. What is a quick (PowerShell) way

  • Some notification fields are not available at

    Hello, I am customizing PM notification/ I tried to change field selection  of several notification fields. I have suceeded to change most of the fields But I fopund no way of changing field selection for some fields such as:     ILOA-MSGRP (ROOM)   

  • How to combine a content search with an attribute search with the API

    Hi I have been working with searches in Content Services using the API and I have successfully set up the search over the contents of a document and inside of the Category attributes of the document. My problem comes when I try to combine this 2 kind