JAXB: How to have my generated classes subclass some other outside class ?

With my XJS and DTD, JAXB generates the following:
public class FraisMessage
    extends MarshallableRootElement
    implements RootElement
{ etc...I would like it to generate this instead:
public class FraisMessage extends MyOtherClass
    extends MarshallableRootElement
    implements RootElement
{ etc...MyOtherClass is another class outside the scope of JAXB
How do I do this ? What do I have to put in my XJS to get this ?

You cannot do that. TheJAVA language does not allow a class to "extend" more than one upper class.
Typically, the solution is to modify your architecture a little bit. Just use the "has a" relationship instead of "is a". That means something like that:public class MyFraisMessage
    extends MyOtherClass
    private FraisMessage message;
  etc...You write an extension "MyFraisMessage" of your upper class "MyOtherClass", which has the JAXB generated object as an attribute. This structure is often useful, when you think you would need multiple inheritance.

Similar Messages

  • Does any one know how to have a time pulse every some time ?

    does any one know how to have a time pulse every some time to a TimeListener?
    I'm new at java, i encountered into com classes, but i understand they only work on microsoft platform,
    what are the java classes to imlpement this?
    Thank you,
    joy

    That is surprising. java.util.Timer and TimerTask are available since 1.3.
    There is a simple Timer example in Core Java vol II,
    class Timer extends Thread
        public Timer(int i, TimerListener t)
            target = t;
            interval = i;
            setDaemon(true);
        public void run()
            try
                while(!interrupted)
                    sleep(interval);
                    target.timeElapsed(this);
            catch(InterruptedException ie) { }
    private TimerListener target;
    private int interval;
    }The interface TimerListener is quite simple:
    interface TimerListener
        void timeElapsed(Timer t);
    }Implement the Listener in your class where you want the timed pulse.
    HTH,
    Dewang

  • What is actually happenning when we are importing a class of some other pac

    Sirs,
    I have a doubt which is very basic to java,
    I want to import a class say "HashMap" to my class.
    If i put import "java.util.HashMap" or "import java.util.*;"
    Which will be better ?
    If i put "import java.util.*; " will it affect the performance?
    What is actually happenning when we are importing a class of some other package to our class
    Your help solicited,
    Sudheesh K S

    Many of your questions of this nature can be quickly answered by a search of prior posts to the forums, like this:
    http://forum.java.sun.com/thread.jspa?forumID=54&threadID=631979
    And why do you tend to post boldened text? It's harder to read.

  • TtyS4 and ttyS5 how do I activate using 'setserial' or some other way

    Is there a 'setserial' expert in the house?
    I've got a daughter board/card that has a bunch of I/O on it.  All devices work except the two serial ports.  I have 4 serial ports on the main board plus these two on the daughter board for a total of 6 serial ports.  The 4 ttyS* on the main board work but I can't get /dev/ttyS4 and /dev/ttyS5 to work.  (these serial ports on this exact hardware work on Solaris 10 x86)
    Here's what I've tried / found out so far:
    Using 8250.nr_uarts=6" parameter to boot options in /boot/grub/grub.conf so once booted there is /dev/ttyS4 and /dev/tty5 (in addition to the standard ones).
    Now I want to use "lspci -v" to find UART device info for ttyS4 and ttyS5 so I can use 'setserial' to specify port, interrupt and so on.  This is where I run into trouble.  I see from a block diagram from the manufacturer of the hardware that there are two Exar DUART chips: XR17D152 DUART for ttyS2 and ttyS3, and a XR16L2551 DUART for ttyS4 and ttyS5.  Problem is, when I do a 'lspci -v' only the  XR17D152 DUART for ttyS2 and ttyS3 shows up.  'lspci -v' does not report anything for the XR17D152 DUART, which is for ttyS4 and ttyS5.  I look at a block diagram of the daughter board where the XR17D152 DUART is and see it is NOT on the main bus but under a PLX  PCI9656  I/O accelerator chip.  I do see the info for the PCI9656 chip when I 'lspci -v' but not the DUART that's attached to it.  With nothing to lose,  I tried using the 'lspci' info from the PCI965 I/O accelerator as parameters to setserial for ttyS4 and ttyS5, but of course that didn't get results. Furthermore I see when I 'dmesg | grep tty' that that serials ttyS2 and ttyS3 use MMIO, which I'm not sure that 'setserial' can specify MMIO, only port IO.
    # lspci -v - output that shows the I/O acceler
    04:05.0 Serial controller: Exar Corp. XR17C/D152 Dual PCI UART (rev 02) (prog-if 02 [16550])
            Control: I/O- Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
            Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
            Interrupt: pin A routed to IRQ 17
            Region 0: Memory at 80503000 (32-bit, non-prefetchable) [size=1K]
            Kernel driver in use: serial
    02:01.0 Bridge: PLX Technology, Inc. Device 9601 (rev ba)
            Subsystem: PLX Technology, Inc. Device 9656
            Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
            Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
            Interrupt: pin A routed to IRQ 7
            Region 0: Memory at 80160000 (32-bit, non-prefetchable) [size=512]
            Region 1: I/O ports at 3000 [size=256]
            Region 2: Memory at 80040000 (32-bit, non-prefetchable) [size=128K]
            Region 3: Memory at 80060000 (32-bit, non-prefetchable) [size=128K]
            Capabilities: [40] Power Management version 2
                    Flags: PMEClk- DSI- D1+ D2- AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold-)
                    Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
            Capabilities: [48] CompactPCI hot-swap <?>
            Capabilities: [4c] Vital Product Data
                    Unknown large resource type 35, will not decode more.
    #dmesg | grep tty - this output shows that ttyS2 and ttyS3 use MMIO, there is no info for the XR16L2551, because it's not detected.  I need to know how to tell the kernel about it.
    [    2.008167] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
    [    2.033915] serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
    [    2.074052] 00:08: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
    [    2.100632] 00:09: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
    [    2.110283] 0000:04:05.0: ttyS2 at MMIO 0x80503000 (irq = 17) is a XR17D15X
    [    2.116775] 0000:04:05.0: ttyS3 at MMIO 0x80503200 (irq = 17) is a XR17D15X
    Questions:
    -  XR16L2551 DUART (serial ttyS4 and ttyS5) is not detected by 'lspci -v'  Can I find it some other way?  Does it have a known MMIO? A way to probe for it’s MMIO?
    - Can setserial specify MMIO for ttyS4 and ttyS5 once I find out what it is?
    - Since the XR16L2551 resides under a PLX Technology PCI9656  chip which IS found by 'lspci -v' can I use memory info from it to probe for the  XR16L2551, or can I even use the 'lspci' info from the PLX chip as parameters to 'setserial?
    - How can I get these serials, ttyS4 and ttyS5 to work?
    Last edited by Mogombus (2012-04-06 22:54:24)

    lizziepaige wrote:
    ... having nothing but problems ...
    See your other posts...
    https://discussions.apple.com/message/20666642#20666642
    https://discussions.apple.com/message/20666702#20666702

  • Child-class refering to other Child-classes

    Hello!
    I am an inexperienced Java-programmer who have recently given the following some thought: if I have a Parent class that creates an instance of another class, and that class, in turn, needs to refer back to a sibling instance in the Parent class, what is the best way to go?
    I can see possibilities with creating a static method in Parent, that returns a reference to whatever other child class you might need to access. Also, I guess you could send the Parent-class to the child class as an argument, and save it in a reference-variable to use when you need to use one of the Parents non-static methods. Probably there are more possible ways.
    But what I'm asking is; which way is the most "legitime" when it comes to OOP? Surely it's butt-ugly to have a load of static methods in a Parent-class, or to propagate the Parent class through levels and levels of childs and grand-childs.
    If I haven't made myself clear -- I have doubts about my English :P -- I'll try to illustrate my question with a short code-snippet below
    Class Parent
    Child myChild;
    Sibling mySibling;
    public Parent()
    myChild = new Child();
    mySibling = new Sibling();
    // ... more follows
    Class Child
    public Child()
    // Here, I want to somehow access "mySibling" in class Parent
    // ... more follows
    // ... more follows
    Class Sibling
    // ... more follows
    }

    As I tried to illustrate with my code snippet, the children are of separate classes. I could yet again clarify my point by giving a more concrete example, one that's the actual cause of my question.
    I have a class [MainClass] that extends JFrame, implements MouseListener, and calls its own constructor in a main()-method.
    The constructor then goes about creating the Frame's interior by creating instances of JPanels and, in one case, an extenden JPanel called CardPanel (implements ActionListener). So now we have three JPanels (including the extended) active:
    JPanel cardPanelButtons; // is the topmost panel in the frame, and lets the user switch between the different cards in the CardPanel. It contains three buttons that are in a ButtonGroup to make sure only one of them is pressed at any one time.
    CardPanel cardPanel; // is centered in the frame, and contains every interactive item in the application, except for the buttons in the cardPanelButtons-JPanel
    JPanel statusPanel; // contains a non editable JTextArea for status-messages
    CardPanel creates three panels in its constructor, and adds these to itself.
    In one of these panels (that are selected by the user, clicking on the buttons in the cardPanelButtons-JPanel) there is a "Search"-button that when pressed, performs a Database-search and then pops up the next card in the CardPanel with the apropiate query result filled in and displayed. This is all good, however for GUI-purposes, this action requires the apropiate button in the cardPanelButtons-JPanel to be "pushed" automatically when this switch between cards take place. Since these buttons are unknown to CardPanel, it needs to somehow reach them, which is where I'm starting to wonder what the best way around this is.
    Should I have the CardPanel-constructor take the parent class as an argument, and access the buttonGroup by a public getter-method in MainClass. Or should I static a public getter-method in the MainClass, letting me ignore to pass on the MainClass for reference. Should I ignore extending JPanel to create CardPanel altogether, and add everything straight into the JFrame from a MainClass-method?
    What is the most correct way, or the way programmers usually go about this type of problem?
    (In order to make myself perfectly clear, this reply is quite extensive. I apologize if I got a bit carried away..)

  • Oracle forms classes don't work with some others signed classes

    Using formserver6i patchset11 with JInitiator 1.3.1.9
    I've re-signed f60all_jinit.jar with my own identity...if I try to use some other signed PJC,the form doesn't start(.. is blocking)...Does someone knows why this is happening...the PJC's worked with JInitiator 1.17.*...

    I've resigned f60_all.jar and now all the forms works fine...but I still have some doubts about the parameters in formsweb.cfg...here my formsweb.cfg has:
    archive_jini=f60all_sandu.jar,testtooltip.jar,Host.jar
    archive_ie=f60all_sandu.jar
    At this moment,Jinitiator doesn't downloads f60_jinit.jar...and all works fine..What's the differnce betwen archive_jini and archive_ie?
    What's the differnce betwen f60_jinit.jar,and f60all.jar?
    Replacing f60_jinit.jar with f60all will cause any problems?

  • How to change wildcard "_" (underscore) to some other character ?

    Hello Tech Gurus,
    I want to search for "_"( underscore) in a string using LIKE function.
    The query is:
    Select col1,col2
    from table1
    where col1 LIKE ('%ABC_%');
    I want to search for string 'ABC_'. But, If I use '%ABC_%' the last underscore will be taken as wildcard.
    How can I change wildcard underscore to any other character.
    Or is there any other way/function to search for underscore in a string.
    Thank you for your time.
    Pramod

    Hope This Solves yr Problem
    select * from b;
    A B
    1 ABC_
    2 ABC_D
    3 ABCD
    select b from b where b LIKE 'ABC\_%' ESCAPE '\';
    B
    ABC_
    ABC_D
    select b from b where b LIKE 'ABC\__%' ESCAPE '\'
    B
    ABC_D
    Ashok

  • How can we stop generating spools for some batch jobs?

    HI guys,
    Is memory will be occupied in SAP  during spool generation from batch jobs ?
    If yes, to reduce occupied memory, we want to stop generating spools for few batch jobs. Please suggest me the way how we can acheive this.(Step details)
    Please help me.
    Thanks in Advance.
    Regards,
    Sahil

    Stopping the spool generation for background jobs will not help you to reduce the memory load.
    First check what is the total memory utilization and type of processes where the memory is being utilized more.
    EWA can give you better idea to get the above details.
    Spooling concept doesn't eat that much of memory what you are expecting.
    Regards,
    Nick Loy

  • How can i mimic the look of some other movies?

    Hello, i enjoy using Color to try and mimim how some movies look. I know how to make things look like Minority Report but i was wondering about other movies that may have a cool look to them. Is there a site that may have a lot of them or do any of you know any ideas off the bat? Thanks!

    Expectations.
    The lines are definitely blurred now, even more so than in the past ten years. People who do not do this on a day in day out basis cannot know what is possible, impossible, practical or somewhere in between. A creative producer brought me some 16mm film (a little more than 10 years ago) and stated that the look he was going for was reminiscent of Degas' "Boater's Party", Oil on canvas, 1880.
    "Sure", I said, I'll just slap on the "Degas" filter -- which is not the "DeGauss" button, by the way.
    ... I don't think I'll finish this anecdote, to protect the guilty.
    Photoshop types are used to layering up these kinds of treatments and some day we might be able to, too. (And finish the job within the same fiscal year!)
    jPo

  • Single open tab, Click "x" to close, browser defaults to a web page for my bank. How can I change to "blank" or some other page?

    Have a single open tab. Regardless of the website active in that tab, if I close it (click "x"), FF shows my bank's homepage. I'd prefer not to display my bank homepage. How can I change to another page or, preferably, a "blank" page?
    This happens regardless of the page current when I close the single tab and after I close and restart FF. Haven't tried rebooting computer.
    Windows XP Home, Ver. 5.1, SP3.
    FF 5.0.

    Check the links below for options to remove the Adware.
    The Easy, safe, effective method:
    http://www.adwaremedic.com/index.php
    If you are comfortable doing manual file removals use the somewhat more difficult method:
    http://support.apple.com/en-us/HT203987
    Also read the articles below to be more prepared for the next time there is an issue on your computer.
    https://discussions.apple.com/docs/DOC-7471
    https://discussions.apple.com/docs/DOC-8071

  • How to add relay here and missing some other components

    This is my diagram to make the simulation
    but before simulation, I am stuck at adding the relay and couple of other things
    any help please ?
    I have attached so far done file to check ....
    Attachments:
    Circuit Diagram.JPG ‏518 KB
    Main_draft 3.ms13 ‏551 KB

    Hi patrick, thanks a lot to engaze your valueable time in replying us
    Relay is 12 V, 1C/O Relay. 
    I have attached 3 files to  undestand things better.
    Also, how do I put the code in the micro controller here ?
    what i get is option to enter main.c program, but I have program written in assembly language, what to do with that ?
    sorry for asking the noob questions here
    Attachments:
    Relay.ms13 ‏107 KB
    Main_draft 3.ms13 ‏593 KB
    Waternew.zip ‏11 KB

  • How to insert this date colum into some other table

    Hi all,
    I have to write a procedure to select the data from one table & insert date column data into another table,the data is in different date formats,but in the second table date column format should be (mm/dd/yyyy) .
    example:
    if the date in first table is 1992 it should be modify to "01-01-1992" & insert into the second table.But the values should be different(below are the different types).
    RELEASE_DATE
    1992
    1962
    July 1987
    Aug 1968
    10/30/06
    6/1/2005
    2004
    7.25.1951
    12/12/2006
    12/1/2005
    1992
    2003
    2005
    1958
    2002
    11/11/03
    1/1/91
    50-21-2001
    10.28.1991
    Please any body can help.

    <FONT FACE="Arial" size=2 color="2D0000">
    Thanks..! for giving the data type..
    Here is an example..
    SQL> desc atestdate
    Name                                      Null?    Type
    CHARDATE                                           VARCHAR2(10)
    ACTDATE                                            DATE
    SQL> select * from atestdate;
    1992
    July 1987
    Aug 1968
    10/30/06
    6/1/2005
    2004
    7.25.1951
    12/12/2006
    12/1/2005
    1992
    2003
    2005
    1958
    2002
    11/11/03
    1/1/91
    50-21-2001
    10.28.1991
    18 rows selected.
    SQL> select <font color="#0000ff">char_trim_x</font>(chardate) from atestdate;
    1992
    July-1987
    Aug-1968
    10-30-06
    6-1-2005
    2004
    7-25-1951
    12-12-2006
    12-1-2005
    1992
    2003
    2005
    1958
    2002
    11-11-03
    1-1-91
    50-21-2001<font color="#8000ff">--? 50 can not be a month nor a date  do not give  junk values</font>
    10-28-1991
    18 rows selected.
    <font color="#0000ff">char_trim_x</font> This is a function which I have created with REPLACE function
    this brings to some extent of an orderly format..
    <font color="#008000">But you have not yet posted your work ..</font>
    -SK
    </FONT>

  • Why isn't there a simpler way to initialize a subclass with its super class

    Let me explain my doubt with an example...
    public class Parent {
    �    public String parent;
    public class Child extends Parent{
    �    public String child;
    I've an instance of Parent p. I want to construct Child c, with the data in p.
    The only way that is provided by Java language seems to be, having a constructor in Child like
    public class Child extends Parent{
    �    public String child;
    �    public Child(Parent p){
    �    �    parent = p.parent;
    �    }
    The problem with this is there is lot of redundant assignment code.
    What I don't understand is why there is not a simpler way of doing this when a subclass is after all super class data + some other data(excuse me for not looking at the bahavior part of it)
    I'm looking for something as simple as Child c = p, which I know is wrong and know the reasons too.
    Yes, we can wrap Child over Parent to do this, but it necessitates repeating all the methods in Parent.
    Why is the language writers didn't provide a simple way of doing this? I should be missing something here...I'm just searching for an explanation. May be I'm asking a dumb question, but this bugs me a lot...
    Regards,
    Kothapalli.

    To answer DrClap, I'm demanding it now :-). Let me
    not suggest something that Mr.Gosling didn't think of;
    he should be having some reasons in not providing it.Because it's essentially impossible in the general case. One of the reasons you may be extending a class is to add new invariants to the superclass.
    eg- extend java.awt.Rectangle by BoundedRectangle - extra invariant that none of its corner points may be less than 0 or more than 100 in any dimension. (The rectangle must be entirely contained in the area (0,0)-(100,100))
    What would happen if you try to create a BoundedRectangle from a rectangle representing (50,50)-(150,150)? Complete invariant breakdown, with no generic way to handle it, or even recognise it.
    Actually, BIJ and sgabie are asking for it. Provide an
    automatic copy constructor. Every object should have
    an implicit copy constructor defined. From any
    subclass, I should be able to invoke
    super(parentClass). From the subclass, we can invoke
    super(parentClass) first and then go on to initialize the
    subclass data.
    I really don't know the implementation issues of this,
    but what I'm looking for is something like this. I'm just
    curious to know the implementation issues.Implementation issue #1: Classes that should not, under any circumstane, be copied.
    * eg 1- Singleton objects. If there's an automatic copy constructor, then multiple singletons can be created, making them essentially useless. This by extension kills the Typesafe Enum pattern also.
    * eg 2- Objects with extra information, such as java.sql.Connection - if you copied this, would the copy be using the same socket connection, or would another connection be required? What happens if opening another connection, and the JDBC driver requires the password to be entered for every new connection? If the wrong password is entered, what happens to the newly creating connection?
    Implementation issue #2: Copying implementation?
    * Already mentioned by RPWithey. The only guaranteed way to perform the copy would be with a shallow copy, which may end up breaking things.
    Why can't you write the copy constructor yourself? If it's a special case, it only has to be done once. If it's a recurring case, you could write a code generation tool to write them for you, along with most of the rest of the class.

  • How to check when admin or some other account has been logging in to the server

    Hi
    How can I check when admin or some other particular account has logged in to the server? So that I can check login times for users.

    Hi,
    You can try to edit the XML file to filter events by logon types.
    In addition, explicit credentials mean that we input our user name and password in front of a computer through keyboard (or other more advanced means). After that, Windows system will pack our credentials as tickets for further
    purposes like access network resources, tickets are implicit credentials.
    More information for you:
    Advanced XML filtering in the Windows Event Viewer
    http://blogs.technet.com/b/askds/archive/2011/09/26/advanced-xml-filtering-in-the-windows-event-viewer.aspx
    Best Regards,
    Amy

  • How to get the subclass from a super class( or interface)

    hi,
    I want to get subclass from a super class (or a interface), how to do that? the subclass of a interface means the class implementing the interface.
    for example;
    List ls;
    I want to get the subclass of ls, i.e., LinkedList, Stack, Vector......
    AbstractList al;
    the subclass of al, i.e., ArrayList, Vector.......
    thanks
    Aiwu

    List ls = new ArrayList();Since ls has been declared as a List we can only use List methods
    with it. This is a good thing because we might later want to change
    it to some other sort of List.
    I want to get subclass from a super class (or a interface), how to do
    that?The instance of the subclass declared above did not really come
    from the super class. A class "knows nothing" about its
    subclasses: many sub classes would not even exist at the time
    the class was written.

Maybe you are looking for

  • My iphone 6 is locked in zoom mode and is unusable. how do i fix this?

    My I phone 6 is locked in zoom mode and I cant get out. Display is on standard but remains in zoom mode....what should I do?

  • How to open a log file form a frame in linux

    Hy, Can anyone knows how to open a pdf file in linux from java?? and also a conf file(when I try Runtime.getRuntime().exec("path") -gives me an error like -I don't have the right to open that file , how can I open that file as root??) Thanks in advan

  • 1:N mapping without using BPM

    Hi All, I am facing a problem in 1:N mapping without using BPM... I would explain regarding it first... Scenarion is from SAP > XI> 3files I have 4 XSD's 1) one is Source Idoc XSD (all xsd's imported to External def.s)                       2) target

  • Fail safe cannot move Group

    Hello, i have installed Windows 2003 with Microsoft Cluster and 4 Nodes, Oracle fail Safe 3.3.2. The Problem is i can move the Groups using MCSC but when i try to move a group with FS-Manager nothing is done. I press the button move group nothing hap

  • Printing in client side

    how can i print in the client side? my printDialog appears on the server side, why is this? pf = pjob.pageDialog (pf); paper = pf.getPaper (); pjob.setPrintable (new AppletPinProcessor (aRecord), pf); boolean doPrint = pjob.printDialog(); thanks :)