How can I invoke a method on a subclass based on the runtime type?

Hi all,
I have defined a base class OrderDetail, and 2 subclasses which extend it: OrderDetailSingleReservation and OrderDetailMonthReservation. Furthermore, I have a method:
    public Order order_generate(OrderDetail orderDetail) {
        if (orderDetail instanceof OrderDetailSingleReservation) {
            return order_generate((OrderDetailSingleReservation) orderDetail);
        }  else if (orderDetail instanceof OrderDetailMonthReservation) {
            return order_generate((OrderDetailMonthReservation) orderDetail);
        } else {
            Misc.alert("orderAndInvoice_Generate(GENERIC): unsupported type.");
            return null;
    }The type of this method's parameter is OrderDetail, as you can see. (This particular method only serves as a kind of dispatcher and is therefore not very interesting in itself, but the same pattern using 'instanceof' occurs in a codebase I am working on several times, and I would like to factor it out if possible.)
My question: it seems that the invocation of order_generate() from within this method requires an explicit downcast to one of the two subclasses. If not, java invokes the method on the superclass. But at runtime, the JVM knows what type of object it is dealing with, right? So is there no way to do this without the explicit downcast?
A similar problem occurs when trying to invoke a method on an object whose type is one of the subclasses; the method on superclass is called, instead of the one in the appropriate subclass that overrides it.
Any help would be greatly appreciated!
Thanks,
Erik

Thanks for your replies! I was editing my post last night to clarify it, but my connection went down and the edit was lost :(
Anyway, yes, it should be done with polymorphism. I was constructing an example using the famous Animal, Cat and Dog classes to demonstrate my question more clearly, and to my surprise the problem does not occur in my example code.
LRMK: Invoking a method such as in your example, where the method is inside the class itself, works fine. However for MVC's sake, I have a separate class called Invoicing with methods as below:
class invoicing
  // the method for the superclass
  public Invoice invoice_create(OrderDetail orderDetail) {
     System.out.println("type: " + orderDetail.getClass());
     return null;
  // the method for one of the subclasses (this method is being not invoked)
  public Invoice invoice_create(OrderDetailSingleReservation orderDetail) {
     return null;
  // ...nor is this one.
  public Invoice invoice_create(OrderDetailMonthReservation od) {
     return null;
}Now I attempt to invoke these methods:
// create example objects
OrderDetailSingleReservation odSingle = new OrderDetailSingleReservation();
OrderDetailMonthReservation odMonth = new OrderDetailMonthReservation();
// this call displays "odSingle type: OrderDetailSingleReservation"
System.out.println("odSingle type: " + odSingle.getClass());
// this call displays "odMonth type: OrderDetailMonthReservation"
System.out.println("odMonth type: " + odMonth.getClass());
// this call invokes Invoicing.invoice_create(OrderDetail)
// instead of Invoicing.invoice_create(OrderDetailSingleReservation)
Invoicing.invoice_create(odSingle);
// this call invokes Invoicing.invoice_create(OrderDetail)
// instead of Invoicing.invoice_create(OrderDetailMonthReservation)
Invoicing.invoice_create(odMonth);So these calls will invoke the method for the superclass, i.e. Invoicing.invoice_create(OrderDetail od). That method then then executes the System.out.println() call which displays the class type of its parameter as one of { OrderDetailSingleReservation | OrderDetailMonthReservation }, that is, the expected subclass types!
So the dynamic dispatch isn't working the way I would expect it to. If I do the explicit if-else checking using instanceof, as described in my first post, the correct methods are called.
I hope the problem is somewhat clearer now. I am a bit lost as to what might be causing this, or how to monitor what's going on inside the jvm. Any ideas? BTW, the OrderDetail class and its subclasses are JPA entities (though I don't think it should matter).
Thanks!
Erik

Similar Messages

  • How can i invoke a file chooser dialog box with out using input type=file

    how can i invoke a file chooser dialog box with out using <input type=file> can any one help me mail me to [email protected]

    You could use an applet...
    Or maybe Javascript has some way to do it.

  • How can i display my portal  with a certain language in the runtime

    I am imp[lemeting a portal page
    their will be a language choice  English   -   French  - Arabic
    I want the portal page to be displayed in the Arabic if the user choose Arabic
    I want the portal page to be displayed in the French if the user choose French
    I want the portal page to be displayed in the Englis if the user choose English
    How can i achieve that target
    Regards
    Mohamed Hammed                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Sandeep
    How can i "Set Language" Portlet
    My portal page contains
    many portlets
    many items
    many subpage links
    i want all of this to function with the chosen language
    Regards
    Mohamed Hammed

  • How can I create a whitelist of banking websites based on the server certifcates of legitimate sites?

    I want to configure FF so that I can optionally activate a whitelist of my legitimate banking websites. When the whitelist is turned on, FF should only be able to display those sites. When the whitelist is turned off, FF works as usual and displays all sites. I would create the whitelist by visiting my banking websites and somehow adding the server certificates of those sites to the whitelist. So the whitelist would consist of the server certs of my banking websites. When whitelisting is then turned on, FF would allow me to visit only those sites whose server certs match those on the whitelist. This would protect me against phishing sites. How can I do this? Thanks

    I believe that did it! Thank you. I am running those changes on a secondary E-Mail address for the same job and server and it appears to be working properly.

  • How can I specify different settings in CustomSettings.ini based on the OS that is being deployed?

    I originally thought this could be achieved using "OSVersion" or "OSCurrentVersion" but (unless I'm mistaken) those variables are in fact tied to the OS from witch you actually launch the MDT Wizard right? i.e. say I run MDT from within
    Windows PE to deploy Windows 8. The "OSVersion" and "OSCurrentVersion" will contain values for the Windows PE instance that is currently running MDT and not the Windows 8 OS I am actually deploying right? Assuming that is the case then
    is there some variable in MDT that stores version information about the OS you are currently deploying? If so can I use that in CustomSettings.ini to specify different settings for specific OSes I deploy?

    Rens,
    First thanks for responding. Next please don't take my response the wrong way but this is a bit of a pet peeve of mine. Maybe I'm just "doing it wrong" but I have used the TaskSequenceID trick in the past and thats actually where my problem lies.
    Too many people are recommending this course of action without including the caveats. Your response implies that using TaskSequenceID is as simple as just adding "TaskSequenceID" to priority and then creating entries based on the TSIDs themselves.
    In reality getting this to work is far more challenging. One needs to only check the following threads (and several others) for the issues other people are having when they try to use TaskSequenceID in CustomSettings.ini:
    http://social.technet.microsoft.com/Forums/en-US/e17a1952-d1f7-41ef-8231-0d6fcc41882e/mdt-2012-settings-per-task-sequence?forum=mdt#f0810428-e6fd-468e-8c76-ca18b210c191
    http://social.technet.microsoft.com/Forums/en-US/320aafee-07d2-4b96-9138-a902fec7edf5/mdt-2012-custom-rules-by-tasksequenceid-not-working-now
    In fact, following the steps outlined here was the *only* way I was able to get TaskSequenceID to work for me:
    http://www.the-d-spot.org/wordpress/2012/07/20/how-to-use-different-settings-per-task-sequence-with-mdt-2012/
    Even then its causing some erratic issues in some areas like button lag in the Wizard because ZTIGather has to run twice and pre-checked Applications in the wizard still installing even if they are unchecked. Since my needs are more OS-specific (as opposed
    to Task Sequence specific) I was hoping for a better solution. I suppose I can check BDD.log but I was hoping someone here had already encounter this same issue and hit upon a solution they could share. 
    Anyone?

  • How can one invoke a WebLogic EJB from a BPEL Server hosted on OC4J?

    How can one invoke a WebLogic EJB from a BPEL Server hosted on OC4J?
    Reason I ask is I keep getting this error:
    javax.naming.NoInitialContextException: Cannot instantiate cla
    ss: weblogic.jndi.WLInitialContextFactory [Root exception is java.lang.ClassNotF
    oundException: weblogic.jndi.WLInitialContextFactory]
    Note: I am using <bpelx:exec> as a way to execute some java program.
    Essentially my java client (essentially an EJB client hosted on Oc4J) needs access to wlclient.jar since it needs access to weblogic.jndi.WLInitialContextFactory. I have a EJB client running on BPEL server hosted on Oc4J that needs to access some EJBs hosted on weblogic.
    Where do I place this wlclient.jar so that BPEL PM can start peacefully and at runtime discover the InitialContextFactory classes?
    Placing it in the j2ee/home/applib doesn't solve the problem. The server fails to start up if I do this
    I tried placing it in BPEL-INF\lib directory ...
    I still get the same exception...see below for exception dump
    I verified the BPEL suitcase, and it in fact does contain the jar file wlclient.jar
    integration\orabpel\domains\default\deploy contains the bpel_BPELProcess2_1.0.jar file and snapshot of that is as follows:
    <PRE>
    &#9474; bpel.xml
    &#9474; BPELProcess2.bpel
    &#9474; BPELProcess2.jpr
    &#9474; BPELProcess2.wsdl
    &#9474; bpel_BPELProcess2_1.0.jar
    &#9474; build.xml
    &#9474; buildxml.copy
    &#9474; graphics.xml
    &#9474;
    &#9500;&#9472;&#9472;&#9472;BPEL-INF
    &#9474; &#9492;&#9472;&#9472;&#9472;lib
    &#9474; myEJB.jar
    &#9474; wlclient.jar
    &#9474;
    &#9500;&#9472;&#9472;&#9472;META-INF
    &#9474; MANIFEST.MF
    &#9474;
    &#9492;&#9472;&#9472;&#9472;output
    bpel_BPELProcess2_1.0.jar
    </PRE>
    I tried using the BPEL-INF\jar directory...Is this something the obant automatically detects? or do I have to modify the build.xml? I created this directory and let Jdev deploy to local BPEL server->default domain handle it
    #####################3
    I even tried copying the wlclient.jar to
    integration\orabpel\system\classes but this doesn't help since the BPEL PM fails to start if I explode this jar into this directory.
    In short,where do I place the wlclient.jar so that this exception can be contained.
    I edited the build.xml to point to the jar, that too didn't work, unless I made some mistake in the file
    <bpelc classpath="${basedir}/BPEL-INF/classes;${home}/system/classes;${home}/lib/j2ee_1.3.01.jar;${basedir}/BPEL-INF/jar/wlclient.jar" input="${basedir}/bpel.xml" rev="${rev}" deploy="${deploy}" />
    </target>
    </project>
    DETAILS on ERROR
    I get the following error
    Process "BPELProcess2" (revision "1.0") successfully compiled.
    <2005-12-14 09:17:55,770> <INFO> <default.collaxa.cube.engine.deployment> Proces
    s "BPELProcess2" (revision "1.0") successfully loaded.
    05/12/14 09:18:36 weblogic.jndi.WLInitialContextFactory
    javax.naming.NoInitialContextException: Cannot instantiate cla
    ss: weblogic.jndi.WLInitialContextFactory [Root exception is java.lang.ClassNotF
    oundException: weblogic.jndi.WLInitialContextFactory]
    05/12/14 09:18:36 at javax.naming.spi.NamingManager.getInitialContext(Nami
    ngManager.java:652)
    05/12/14 09:18:36 at javax.naming.InitialContext.getDefaultInitCtx(Initial
    Context.java:243)
    05/12/14 09:18:36 at javax.naming.InitialContext.init(InitialContext.java:
    219)
    05/12/14 09:18:36 at javax.naming.InitialContext.<init>(InitialContext.jav
    a:195)
    05/12/14 09:18:36 at com.ejb.test.MapFinder.getDefaultMapName(Map
    Finder.java:37)
    ##################3
    with the bpelx all I have is two lines of code that creates a java object and calls a method on it.
    The method does this:
        private String initialContextFactory = "weblogic.jndi.WLInitialContextFactory";
        private String providerUrl = "t3://localhost:7001";
        private String urlPkgPrefixes = "";
        private String mapEjbJndiName = "ejb/mycompany/Redlands";
        public String getDefaultMapName() {
          try {
              Hashtable env = new Hashtable();
              env.put(Context.INITIAL_CONTEXT_FACTORY, getInitialContextFactory());
              env.put(Context.PROVIDER_URL, getProviderUrl());
              if (getUrlPkgPrefixes() != null && !getUrlPkgPrefixes().equals(""))
                  env.put(Context.URL_PKG_PREFIXES, getUrlPkgPrefixes());
              System.out.println("    " + getInitialContextFactory());
              System.out.println("    " + getProviderUrl());
              System.out.println("    " + getUrlPkgPrefixes());
              System.out.println("    " + getEjbName());
              // Get a naming context
              context = new InitialContext(env);
               Object ms  = context.lookup(getEjbName());
              MyEJBHome home = (MyEJBHome ) PortableRemoteObject.narrow(ms, MyEJBHome.class);
              myEjb = home.create();
              return myEjb.getDefaultName();
          } catch (RemoteException re){
              System.out.println(re.getCause().getMessage());
          catch (Exception ex) {
              ex.printStackTrace();
          return null; //if unable to resolve the context factory etc...
        }

    I did exactly as you suggested. I edited the application.xml and added this
    <library path="C:\ArcGIS\test\bea\wlclient.jar"/>
    I didn't add weblogic because the needed classes were all in wlclient.jar
    I also edited the BASE_OB_CLASSPATH to include this jar.
    Here is the result when I just start BPEL PM Server. Somehow BPEL PM doesn't like to have wlclient.jar in its classpath during startup.
    Failed to create "worker" bean; exception reported is: "javax.naming.NameNotFoun
    dException: remaining name: env
    at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:49)
    at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:57)
    at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:62)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at com.collaxa.cube.engine.ejb.impl.WorkerBean.ejbCreate(WorkerBean.java
    :49)
    at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.evermind.server.ejb.MessageDrivenHome.getInstance(MessageDrivenHo
    me.java:1235)
    at com.evermind.server.ejb.MessageDrivenHome$2.run(MessageDrivenHome.jav
    a:1150)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(Relea
    sableResourcePooledExecutor.java:186)
    at java.lang.Thread.run(Thread.java:534)
    <2005-12-29 13:39:05,281> <ERROR> <collaxa> <ServerManager::loadAllDomains>
    ORABPEL START-UP ERROR!!!!!!!!
    OraBPEL run-time system failed to start due to exception:
    Could not initialize jms connection pool.
    Could not initialize connection pool for connection factory "java:comp/env/jms/
    ollaxa/BPELInvokerQueueFactory"; the reason is remaining name: env/jms/collaxa/
    PELInvokerQueueFactory.
    Note: So what I did was to removed the entry from application.xml and tried with just obsetenv.bat having the wlclient.jar added to it. This too failed!!
    Here is a snapshot of the error I got.
    Process "BPELProcess2" (revision "1.0") successfully compiled.
    <2005-12-29 13:53:11,207> <INFO> <default.collaxa.cube.engine.deployment> Proces
    s "BPELProcess2" (revision "1.0") successfully loaded.
    05/12/29 13:53:32 Cannot instantiate class: weblogic.jndi.WLInitialContextFactor
    y
    05/12/29 13:53:32 javax.naming.NoInitialContextException: Cannot instantiate cla
    ss: weblogic.jndi.WLInitialContextFactory [Root exception is java.lang.ClassNotF
    oundException: weblogic.jndi.WLInitialContextFactory]
    05/12/29 13:53:32 at javax.naming.spi.NamingManager.getInitialContext(Nami
    ngManager.java:652)
    05/12/29 13:53:32 at javax.naming.InitialContext.getDefaultInitCtx(Initial
    Context.java:243)
    05/12/29 13:53:32 at javax.naming.InitialContext.init(InitialContext.java:
    219)
    05/12/29 13:53:32 at javax.naming.InitialContext.<init>(InitialContext.jav
    a:195)
    05/12/29 13:53:32 at com.esri.adf.ejb.test.MapFinder.getDefaultMapName(Map
    Finder.java:57)
    05/12/29 13:53:32 at bpel.p0.ExecLetBxExe1.execute(ExecLetBxExe1.java:62)
    05/12/29 13:53:32 at com.collaxa.cube.engine.ext.wmp.BPELXExecWMP.__execut
    eStatements(BPELXExecWMP.java:49)
    05/12/29 13:53:32 at com.collaxa.cube.engine.ext.wmp.BPELActivityWMP.perfo
    rm(BPELActivityWMP.java:185)
    05/12/29 13:53:32 at com.collaxa.cube.engine.CubeEngine.performActivity(Cu
    beEngine.java:3398)
    05/12/29 13:53:32 at com.collaxa.cube.engine.CubeEngine.handleWorkItem(Cub
    eEngine.java:1905)
    05/12/29 13:53:32 at com.collaxa.cube.engine.dispatch.message.instance.Per
    formMessageHandler.handleLocal(PerformMessageHandler.java:75)
    05/12/29 13:53:32 at com.collaxa.cube.engine.dispatch.DispatchHelper.handl
    eLocalMessage(DispatchHelper.java:100)
    05/12/29 13:53:32 at com.collaxa.cube.engine.dispatch.DispatchHelper.sendM

  • How can I create a method with throws  instruction

    Hello Everybody!
    How can I create this method inside WebDynpro.
    I enter "throws CloneNotSupportedException" manually an it removes always.
    What is wrong ?
    public java.lang.Object clone( ) throws CloneNotSupportedException{
        //@@begin clone()
         __Tdag__Is_Charactconfig that= (__Tdag__Is_Charactconfig)super.clone();
           return that;
        //@@end
    Regards
    sas

    I only checked in my 7.1 IDE and there this section exists.
    If it does not exist in your IDE, just create the method manually in the //@@begin others ... //@@end user-coding-area at the end of the controller class. This solves the issue for methods that are called from inside the controller. For public methods to be called from other controllers, this will not help.
    Armin

  • How can I invoke the web service manually in websphere?

    Hi
    I've developed a webservice application using Rational Application Developer (RAD). I deployed it in a websphere 6.1 application server, using the administration console to import the war file that I had previously exported with RAD.
    My webservice application is listed in the "Enterprise Applications" section of websphere's administration console as started.
    My question is: how can I invoke the web service manually? Is there some kind of websphere generated webpage that I can use to call it manually?
    I tried http://<server:port>/<contextroot> and http://<server:port>/<contextroot>/<servicename> in a webbrowser, but it doesn't work. Is it possible to invoke the web service manually, or do I need to develop a client?
    Thanks in advance
    Pedro

    Hi Bo Wang,
        Go to the Portal -> System Administration -> System Configuration
                               -> Portal Content folder
                               -> Open Visual Composer folder
        There you can see the Webservice Systems you have created through VC.
    You can delete the unwanted system here.
    Regards,
    Shemim

  • How can I execute a method on a specified time?

    How can I execute a method on a specified time such as method1() will be executed on 1:00 p.m and the method2() will be executed in 1:00 a.m?

    BilgeTonyukuk99 wrote:
    How can I execute a method on a specified time such as method1() will be executed on 1:00 p.m and the method2() will be executed in 1:00 a.m?As a simple example, take a look at http://www.javapractices.com/topic/TopicAction.do?Id=54.
    As an alternative (and looks like better approach), you could use the ScheduledThreadPoolExecutor.

  • How can i pass rowiterator method

    hi how can i pass rowiterator method
    i got below method how can i pass it to my postchanges mothod e.g
    SmsPropertiesImpl property = getSmsProperties();
    am in jdeveloper 11.1.2.1.0
    public class SmsPartyAddressImpl extends EntityImpl {
        public RowIterator getSmsProperties() {
            return (RowIterator)getAttributeInternal(SMSPROPERTIES);
        public void postChanges(TransactionEvent e) {
            /* If current entity is new or modified */
            if (getPostState() == STATUS_NEW ||
            getPostState() == STATUS_MODIFIED) {
            /* Get the associated property for the postaladdress */
           // SmsPropertiesImpl property = getSmsProperties();
            //SmsPropertiesImpl property  = getSmsProperties();
                SmsPropertiesImpl property = new SmsPropertiesImpl();
               // SmsPartyAddressImpl property = new SmsPartyAddressImpl();
            /* If there is an associated property */
            if (property != null) {
            /* And if its post-status is NEW */
            if (property.getPostState() == STATUS_NEW) {
            * Post the property first, before posting this
            * entity by calling super below
            property.postChanges(e);
            super.postChanges(e);
    }

    hi how can i pass rowiterator method
    i got below method how can i pass it to my postchanges mothod e.g
    SmsPropertiesImpl property = getSmsProperties();
    am in jdeveloper 11.1.2.1.0
    public class SmsPartyAddressImpl extends EntityImpl {
        public RowIterator getSmsProperties() {
            return (RowIterator)getAttributeInternal(SMSPROPERTIES);
        public void postChanges(TransactionEvent e) {
            /* If current entity is new or modified */
            if (getPostState() == STATUS_NEW ||
            getPostState() == STATUS_MODIFIED) {
            /* Get the associated property for the postaladdress */
           // SmsPropertiesImpl property = getSmsProperties();
            //SmsPropertiesImpl property  = getSmsProperties();
                SmsPropertiesImpl property = new SmsPropertiesImpl();
               // SmsPartyAddressImpl property = new SmsPartyAddressImpl();
            /* If there is an associated property */
            if (property != null) {
            /* And if its post-status is NEW */
            if (property.getPostState() == STATUS_NEW) {
            * Post the property first, before posting this
            * entity by calling super below
            property.postChanges(e);
            super.postChanges(e);
    }

  • How can i edit payment method if i signed up for non payment

    How can i edit payment method if i signed up for non payment?

    Contact iTunes Customer Service and request assistance with your issue.
    Apple  Support  iTunes Store  Contact Us

  • How can I call a Method in a Transformation Routine

    Hello Experts,
    How can I call a Method in a Transformation Routine ??
    THNXX

    Hi,
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/6090a621-c170-2910-c1ab-d9203321ee19?quicklink=index&overridelayout=true
    It will be help full .
    Regards,

  • HT201363 How can I make an Apple ID without credit card if the "none" tab is not visible to me?

    How can I make an Apple ID without credit card if the "none" tab is not visible to me?
    Help me out please

    Hello, aligt9p. 
    Thank you for visiting Apple Support Communities. 
    To create an Apple ID without a credit card, there is a specific series of steps that have to be processed in order to allow the payment to be set as none on creation of the account.
    Creating an iTunes Store, App Store, iBooks Store, and Mac App Store account without a credit card
    http://support.apple.com/kb/HT2534
    Why can’t I select None when I edit my payment information?
    http://support.apple.com/kb/TS5366
    If the specific steps have not been processed, a credit or debit card will be required to complete the setup the account.
    However, it can be removed and payment method changed to none as long as there is not an outstanding balance.
    iTunes Store: Changing account information
    http://support.apple.com/kb/ht1918
    Cheers,
    Jason H. 

  • How can i import an mp3 to a Notification Ringtone under the "Sound Settings"?

    how can i import an mp3 to a Notification Ringtone under the "Sound Settings"? (i can do it to "Phone Ringtones" easy, but not Notifactions)

    This might work as well and will allow drag and drop of mp3 files. This is written as if the phone is connected to the computer.
    In the sd card, check if there is a folder called media. In the media folder verify or create a folder called audio. Within the audio folder create the following folders: alarms, notifications, and ringtones. These should be typed exactly as written. Copy or move the files into the folder you want them in. Disconnect the phone from the computer and let the remount the sd card. Now go into your notification or ringtones list. The files you put into the individual folders should automatically be there.
    I know that this works on the Eris and I got the method back when only the eris and droid 1 was available. I just can't remember exactly where I got it. Hopefully it also works for the Droid 1.
    @Ron
    Be nice please.

  • How can I select to answer a mail with or without the message

    Hello
    When a mail is received and then opened, I have the options to answer to the sender or to all. In the account preferences, I can specify if the original message is copied or not. This option applies to ALL the answers. How can I choose when editing a mail if I want the message to be copied or not ?
    Kind regards
    JP

    This is the easiest method I have found that will resolve your issue.
    'Tools' > 'Account Settings' > 'Composition & Addressing' for the maill account
    or
    'menu icon' > 'Options' > 'Account Settings' > 'Composition & Addressing' for the mail account.
    deselect / do not select 'Automatically quote the original message when replying'.
    Click on OK to save changes.
    To send a 'Reply' with no original message, simply click on 'Reply' button.
    To send a 'Reply' with all or part of original message.
    Highlight the section of the message or all of the message and then click on 'Reply' button

Maybe you are looking for