How to make Object class to be serializable?

I'm writing a session bean which contains an Object[][] as a return e.g
public Object[][] getFoo(){
I need the return to be of type Object since I'm constracting a 2D array of different object types e.g Integer, Double, HashMap, String etc. But EJBs require serializable objects for their public remote methods. Could you please advice me whether there is another class that I could use instead of the Object class to be serializable? I'm still using SDK1.3.1.
Thank you

I've already tried that before, but it doesn't work. When I try to assign different objects to my array as in the following example:
ABC[][] abc = new ABC[4][2];
abc[0][0] = new Integer(1);
abc[0][1] = new String("abc");
abc[0][2] = new HashMap();
I'm getting compilation error since Integer, String and HashMap can not be casted into ABC. My question is whether there is such a class (part of the SDK) which implements Serializable AND these classes can be casted to, as in the above example?

Similar Messages

  • How to make a class an array

    Hello, i am very confused as to how to make an array inside a class and use it from another class. For example, when making a "Book of hotties" where i would create entries in a book(objects) of hot women ,with parameters
    name, last name, phone number, and rating, and i am supposed to make a class for the book itself with a Person [ ] blackBook, and also a separete class called Person where i would create each person. How would i go about creating this array and where would i create it? and from that how can i access it in order to perform methods like sorting and checking entries? Tnx in advance.
    Edited by: Secmugen on May 5, 2009 6:19 AM
    Edited by: Secmugen on May 5, 2009 6:20 AM

    You probably need to start here: http://java.sun.com/docs/books/tutorial/java/nutsandbolts/arrays.html
    There is also a Java collection called ArrayList which is suitable for storing and retreiving objects such as BlackBook, Person etc...
    To access elements of an array within a class you would most likely use a public getter method. eg.
    public class BlackBook {
       private ArrayList<Person> persons = new ArrayList<Person>();
      public ArrayList<Person> getPersons() {
         return this.persons;
      public Person getPerson(int index) {
        this.persons.get(index);
    };etc..

  • How to use Object Class:orclDbServer in OID

    Not sure if i have posted in the correct forum, I am quite new to OID
    I am planning to use orclDbServer Object Class, but not sure how to use, i have searched in Google, and Oracle Documentation, there are so little information about this, there are only:
    Object Class: orclDbServer
    Description: Defines the attributes for database service entries
    Attributes: orclNetDescName, orclVersion
    Below is the ldif file i created for add one entry with object class orclDBServer:
    dn: cn=orclDBServer_test, cn=OracleContext, dc=ldapcdc, dc=lcom
    changetype: add
    objectclass: top
    objectclass: orclDBServer
    cn: orclDBServer_test
    orclNetDescName: (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST=10.182.114.121)(PORT = 1521))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = oh112)))
    after i use below command to add this entry:
    ldapadd -h localhost -p 389 -D "cn=orcladmin" -w welcome1 -f test_add.ldif
    then use ldapsearch to search:
    ldapsearch -h localhost -p 389 -b "dc=lcom" "objectclass=orclDBServer"
    the result is like below:
    cn=orclDBServer_test, cn=OracleContext, dc=ldapcdc, dc=lcom
    cn=orclDBServer_test
    orclnetdescname=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST=10.182.114.121)(PORT = 1521))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = oh112)))
    objectclass=top
    objectclass=orclDBServer
    objectclass=orclService
    It seems it added a line for me:
    objectclass=orclService
    Is there anything wrong with my ldif file when i want to use orclDbServer?
    Edited by: ening on Jan 5, 2010 9:31 PM

    Hi,
    if you are having main controller and sub-controller then you may need to use below coding to use application class reference.
    *Data declaration
      DATA:  obj_cntrl        TYPE REF TO cl_bsp_controller2,
             obj_sub_cntrl   TYPE REF TO z_cl_sub_cntl,
             application TYPE REF TO z_cl_application.
    *Get the controller
      CALL METHOD obj_main_cntrl->get_controller   "obj_main_cntrl is the object of main controller
        EXPORTING
          controller_id       = 'SUB'   "Controller ID
        RECEIVING
          controller_instance = obj_cntrl  .
      obj_sub_cntrl ?= obj_cntrl  .
      application ?= obj_sub_cntrl ->application.
    or simply use below code in your controller method.
      application ?= me->application.
    Thnaks,
    Chandra

  • How to create object class for a z table

    Hi All,
    I have a z table and I want to register the changes of fields should be logged to CDHDR and CDPOS table.
    Is this possible?
    If yes how can I creat an object class for a z table. I have already checked the change document option in z data element.
    Please help.
    Regards,
    Jeetu
    Moderator message: standard functionality, please search for available information/documentation before asking.
    locked by: Thomas Zloch on Oct 6, 2010 6:16 PM

    Tcode SCDO. You'll need to create a change document for you Z table and then use the FM created to record the changed data.

  • How to make a class immutable?

    I hav attend the interview where they ask this question.
    I know little bit is Make the class final and declare all variables as static final .
    Can any Help me.
    This question

    Thi is just my opinion;
    An immutable object is an object that once created, it's values can no longer be changed.
    Thus an immutable object could be an object that allows it's values to be changed only when created with the use of the constructor, and only has get methods to retrieve those values (no set methods).
    @Peetzore
    Defining them as final is something I never did, however it makes sense :) and will start doing so as well
    Regards,
    Sim085

  • How to make standard class as mandatory in eupiment master[class overview]

    Hi,
    In equipment master if I want to make standard class as mandatory field [Check standard class].
    If any any configuration is available please give me the path.
    Else Any user exist is available please suggest me.
    Reward points are available
    Thanks in advance.
    Hanamanta

    hi,
    Just follow the menu path given.
    Cross-Application Components > Classification System >
    Classes > Maintain Object Types and Class Types
    Assign required class type to table EQUI and remove the class types which are not required.
    This will definitely solve ur problem.
    with regards,

  • How to typecast Object Class object dynamically

    Hai every one
    i have a object of any particular class , but i don't know the variables in that class object. But i have string variable contains value of variables in that class object.
    So i use following method for get value of variables in that class object.
    class ObjectCLass
         Sub s=new Sub();
         public static void main(String[] args)
              ObjectCLass a=new ObjectCLass();
              try
                   System.out.println(*a.getClass().getDeclaredField("s").get(a)*);
              catch(Exception e)
                   System.out.println("Exception");
    class Sub
         int i=5;
         public void print()
              System.out.println("Hello World!");
    }Here the bolder line give Object class object. By using this Object class object i need access the variable i and method print(). So i need to cast Object class object into sub class
    so how can i typecast it
    i try with following methods , but i cant succeed
    1.(  *(a.getClass().getDeclaredField("s").get(a).getClass)*   a.getClass().getDeclaredField("s").get(a)   ).print() ;
    2.(  (Class.forName(�Sub�) ) a.getClass().getDeclaredField("s").get(a) ).print();Please any one one help me how to typecast it dynamically
    By
    Thiagu

    If you know you're going to invoke the "print" method on an object, then you also need to know the type of the class, or interface, which has that method.
    It seems what you are looking for is a tutorial on interfaces.
    http://java.sun.com/docs/books/tutorial/java/IandI/index.html
    In a nutshell, you can set up an interface which defines a "print" method, and create class(es) which implement that interface. Then as long as you have an object which implements that interface, but do not know the exact type of that object, you can simply cast it to the interface type and invoke the method.

  • How to make object dissapear and reappear?

    I was watching a video on YouTube on how to make an explosion. However, the video is not very helpful as the guy doesn't explain anything. I am not a complete newbie, but I still need some help on simple stuf sometimes. The part I am stuck on is when he makes a "patch" of the texture in the driveway, and then he covers up his explosive box. After that, he copies the box and is able to make appear and dissapear.
    The part of the video I don't understand is at 1 minute, 22 seconds.
    Here is the video link: http://www.youtube.com/watch?v=qL1KkAfwflk

    @Netcommercial, Sorry about the double post, nobody was replying so I thought maybe it wasn't specific enough. Anyway, changing the color of a box does not make it disappear. The guy in the video was able to make the box completely disappear (not by changing the color), and he was able to make it reappear too. That is what I need.
    @Rick Gerard, I understand he is using multiple layers, but how does he make the box reappear? Basically, you are saying that if I took a layer with an object, duplicated it, then put the original layer underneath the layer that has the mask, I would make the object disappear?

  • How java extends Object class?

    It is true that we cannot extend more than one class, it is true that java inherits Object class implicitly (if not explicitly) and it is also true that we can extend class X in class Y.
    My question is if java does not support multiple inheritance (directly, using extends) then how does it extends Object (implicitly) and my class X (explicitly)?
    In other words how does java inherits Object along with our specified class?
    Thanks in advance.
    Manish

    Java does support multi inheritance!Yes I know java support multiple inheritancethrough
    interfaces but what I meant was you cannot inherit
    multiple classes using "EXTENDS".and that is correct. Do you still have a question
    regarding this?Nop, actually due to over-concentration and over-thinking on this topic while reading I lost the track and asked this question.
    Thanks
    Message was edited by:
    Manish_India_1983

  • How to make a class serializable

     

    This is not a good place to learn general Java ... I suggest looking at the
    Java serialization specification from JDK1.1 (?) and understanding how
    serialization works.
    It is impossible to answer your question either 'yes' or 'no' ... by saying
    'implements serializable' it does make instances of the class serializable,
    but that does not mean that serialization will work on those instances, for
    example because the instance may have non-null non-transient fields that are
    not serializable. Further more, some of the state may not be appropriate for
    serialization (like a JDBC Connection reference ...).
    Peace,
    Cameron Purdy
    Tangosol Inc.
    << Tangosol Server: How Weblogic applications are customized >>
    << Download now from http://www.tangosol.com/download.jsp >>
    "zille9" <sdsd> wrote in message news:3bf6f272$[email protected]..
    can i make a simple java class serializable by just writing implementsserializable in its implemetation

  • How to make a class object  from a string representation of the same

    i have the name of a class whose object i want to make in the form of a string i.e. String s="S1"; i get this name after some prosessing. so what i want to do is to create an object of S1 which is actually one class that i have implemented.plz hlp. it is urgent.thnx in advance.

    reflection api...
    see java.lang.Class. Read the api docs.
    mostly, u need to do the following:
    Class myClass = Class.forName(s1);
    Object x = myClass.newInstance();
    reg
    s giri

  • How to make Singleton Class secure

    I have a Singleton class which I instantiate using reflection by a call to a public getInstance method that return the object from a private constructor. I have to use reflection as I dont have any other options since my class instantiation is decided on runtime. How will I secure other form instantiating the same class again by using reflection on my private constructor? Any ideas?

    How much do these different implementations of your singleton have in common? What I'm getting at is, is there some common code you could extract out of them all, and make that a singleton in it's own right? Needing to do this sort of hacking is often a sign you're fudging something together, that could be solved more elegantly. We use the Singleton pattern generally when the state of the object needs to exist exactly once. Can you extract that from the disparate objects?
    The singleton classes that I load do not have anything in common. They are all similar but unique, and independant in their own respect. I will have to decide only on what singleton object I have to load in runtime, based on certain criterion. This is done by reflection, by a call to the public getInstance() method of the respective singleton classes, since I am deciding on runtime. My problem is that can I prevent others from accessing my private constructor from outside the class using reflection, which enables them to create another duplicate object. Can I restrict them to use only my getInstance() method instead?? I know this is hacking to access the private members, but I want to know whether there is any way where I can restrict this hacking???In the above code I dont want these statements to work at any case
    java.lang.reflect.Constructor[] c = cl.getDeclaredConstructors();
    c[0].setAccessible(true);
    A anotherA  = (A) c[0].newInstance(new Object[]{"Duplicate"});

  • How to make asset class as chart of depreciation dependent

    Hello sap Experts
    we have a requirement from business user where they want that we make an asset class as chart of depreciation DEPENDENT.
    please suggest how to do this & what is the impact of it.
    Thanks & Reagrds
    Deepak Garg

    Dear,
    Deepak.
    You can lock the asset classed as per COD from t.code AM05 or one more you can lock the asset classes from OAOA.
    Go to OAOA select your said asset class see Lock Status area there you can see option Asset class is blocked Tick it. 
    If you need any further clarification please revert back.
    Regards,
    Pankaj Bhalerao.
    Edited by: pankaj_ab on Dec 7, 2009 9:50 AM

  • Urgent please. How to make objects to vector? CS6

    Hi please urgent, the printing press for signboard is looking for an vector of my design there are waiting for me right now. I send them the .eps format. I use pen tool for making different curves and shapes. How can I make it to a vector?
    Here is the .eps file
    http://www.solidfiles.com/d/5164de41a2/

    It's not clear what kind of production workflow will happen.
    Exactly. (At last!)
    Hi please urgent...
    Given the "urgentcy" I'll first ask you to forgive my being a little rough. None of this is meant to offend. It's meant to teach with some appropriate pointedness, hopefully to the benefit of all who come here having got themselves into similar jams. So be a little thick-skinned in reading this, but take it seriously. It's sound advice. It's good advice. It's given freely and represents considerable time, and so I consider myself at liberty to phrase it the way I see fit.
    This is how you (and many others) get into trouble. Failure to read instructions. Failure to become familiarized with the basic principles and mechanics of a reproduction method before charging customers for designing for those methods. Then relying upon user forums for answers to get you out of a jam, when there is no guarantee that others on a user forum know any more than you do. Wrong or incomplete "answers" here are at least as common as correct answers.
    Your situation is no more "urgent" than most who come here with questions.
    I send them the .eps format.
    EPS is Encapsulated PostScript. EPS (like PostScript) can contain any combination of raster, vector, or text objects. Think of EPS as just a "container." Just because a file is EPS does not necessarily mean its content is entirely vector paths.
    I use pen tool for making different curves and shapes.
    You used the Pen tool for drawing a few simple closed paths. You combined some of those simple paths into compound paths. You converted some text to paths. Those objects are vector paths which can be translated to HPGL instructions which a typical vinyl cutter can use to direct its cutting blade.
    But then you filled some of those objects with graduated fills. Grad fills are common constructs and can be thought of as "vector in nature" (resolution independent) in that they are mathematically-described printing instructions. But that is not something that can be reproduced by cutting pieces our of solid-colored vinyl sheet material.
    Then you applied raster-based effects (the fuzzy drop-shadows) to some of those vector-based paths.
    Plus, the compound paths in the EPS file contain raster images used as transparency masks for the shading. Like grad fills, raster images cannot be rendered by cutting a shape out of solid-colored vinyl. And Draw X4 isn't going to know what to do with that construct.
    So you are not delivering just vector-based paths in this file, no matter what file format in which you save it.
    Whenever you deliver a file for sign cutting/printing:
    Know the limitations of the sign shop you are using and its kind of equipment. Some sign shops only cut solid-colored vinyl on an HPGL-driven cutter. Other sign shops have more expensive equipment which can print raster images or grad tones onto vinyl first, and then cut the printed vinyl to shape after. Some sign shops use separate equipment for those two operations. Just as in print, you can't know how to properly prepare something for a particular output workflow unless you have at least a basic understanding of the operations involved.
    Ask the sign shop what software and version it is using. Ask what formats and versions their software can open/import.
    Best practice: Have your own copy of the software the sign shop will be using. (CorelDraw can be had by any Illustrator user at a modest competitive side-grade price, and you receive alot of other useful stuff in the deal. Any designer frequently delivering files to sign shops should make this investment.) That way, you can see what they will actually be dealing with before you send it.
    Failing that, at the very least re-open the file that you export from Illustrator in Illustrator before sending it so you can see what kind of objects you are actually sending. If you Open your EPS in Illustrator and tear it apart, you'll see the objects that I described above.
    "Dumb down" your content to the "lowest common denominator" constructs. When it comes down to it, almost everything in graphics boils down to simple vector paths, compound vector paths, vector paths used as clipping paths, raster images, and text objects. Avoid proprietary software-specific constructs like meshes and effects. Figure out the most basic and fewest kinds of objects required to build the graphic.
    Make sure you do not use compression on the file that you export.
    How can I make it to a vector?
    First, do not say "a vector." A vector-based graphics file is not "a vector." "A vector" is a direction, usually associated with a force. A vector-based graphics file is a collection of vector-based paths. "Vector path" or "vector drawing" or "vector file" are shorthand terms using the word "vector" as an adjective (modifying the path, drawing, or file), not a noun. This is not just a pet peeve of mine. It's one of those dead giveaways of beginners who usually don't really understand what they're dealing with.
    I sent them the .pdf format...
    A PDF file is like an EPS file in that it is also a "container" which may contain any combination of any number of vector paths, raster images, or text objects (as well as many other constructs, such as data fields).
    ...but they are still asking for the .esp....he will do it using CorelDraw X4...
    Just as there are designers selling services they don't understand, there are sign shops using software they don't understand. Smart designers working with such shops learn to watch for the "tell tale" signs of amateurism in the output houses they use.
    CorelDraw X4 can indeed "open" (i.e.; translate into its native constructs) PDF, EPS, and AI, so long as:
    The files are not newer versions which the particular version of CorelDraw predates.
    The files do not include Illustrator-native constructs which CorelDraw does not understand.
    (This is not because Illustrator is in any way "superior"; the same general principles apply when exchanging files in the other direction. Each software has its own proprietary constructs for which the others don't have a directly corresponding native construct.)
    CorelDraw dominates in the sign business (and for good reason). But sign shops are notorious for not keeping their Corel software up-to-date. Current version of Draw is X6, and a new version is no doubt just around the corner. You are using Illustrator CS6. You just need to save your Illustrator files back to an earlier format and CorelDraw X4 can open them. In fact, I just:
    Opened your EPS file in Illustrator CS3.
    Saved as Illustrator 8.
    Saved as PDF 1.3 (Acrobat 4)
    Opened both the PDF and the AI file in CorelDraw X3, with nothing missing.
    Why did this work? Because in saving back to earlier versions, the content was automatically "dumbed down" (deconstructed) to the more basic building blocks of graphics: Separate vector paths and raster images.
    Understand, this is still not ideal, because leaving that deconstruction to automated routines still results in needlessly messy and fragmented content. For example, when opened in CorelDraw, the AI 8 file contains 36 vector paths and 53 individual raster images. (This is not Draw's fault. It's what was exported from AI to the legacy format.)
    ...after I send the vector .eps format he said "which you send eps it open but not it vector it has more part" What he mean by it has more part?
    He meant there are objects in the design which are missing in the file you sent him after opening in Draw. That's because you did not save back to an earlier format which would deconstruct the file to more basic elements.
    He said "I have to cut acrylic & then the sticker printing...
    I'm assuming that he means cutting from vinyl adhesive film (although it's quite possible he does indeed mean acrylic plastic sheeting for a fabricated sign.) This implies (although it's still not certain from the poor wording) that the sign shop is not limited to just cutting sign vinyl, but also has the ability to print onto sign vinyl (to accommodate the grads and raster-based shading). Based on those assumptions, you still have some qestions to answer. Think of the basic operations. Think like the device(s) that have to build the physical sign:
    The solid-filled vector paths can be cut from sheets of solid-filled colored vinyl. The cut vinyl can then be applied to the (assumed) white sign board. That part is simple.
    The grad filled objects can be printed on white vinyl and then cut to shape. But there are three problems:
    Registration of print to cut. What if the printing and cutting are done in separate operations? Just as in offset printing traps and/or bleeds are typically included to allow for slight mis-registration of abutting colors, a similar trap or bleed may be required to allow for slight mis-registration between the printed grad fills and the paths which will then cut around them.
    How do you intend the drop shadows to be handled? They are graduated, so they will have to be printed. But then what? How do you cut to shape a soft fuzzy edged image from a solid piece of material? Where will the cut be made? Obviously, it has to be cut beyond the edges of the fuzzy printed image. But where? Will the whole graphic that involves the graduated fills and transparency masks (the circles, three curves, and drop shadows) be simply printed onto a piece of white vinyl and then that white vinly be cut to a single circular or rectangular shape? Or will it be cut to an offset contour running parallel to the outer edges of the whole graphic? If so, can you live with the visibility of that cut edge which is not actually part of the design? What about when that cut edge becomes more visible (as it will in the real world, especially if deployed outdoors)? Either way, you have not provided a cut path for the drop shadow portion at all.
    Or do you want the entire design to be rendered on a single sheet of vinly so as to avoid that problem of a cut edge outside the bounds of the drop shadows? If so, you don't need any vector content at all. The whole thing could just be one big raster image.
    Crosscuts: Back to the assumption that you do intend for the smaller graphic to be cut out of individual shapes, you have two dark blue vector paths overlapping. If the cutter blade follows those two paths, then they will be cut up into five separate pieces. Those paths should have been unioned into one path. A similar overlap situation exists between two green paths. unnecessary crosscuts are a bad thing in sign vinyl. Climate changes can cause slivers or peeling to appear between the unecessary cuts.
    Overlaps: Overlapping vinyl pieces can also be problematic in built-up multi-layer vinyl signs. The vinyl is usually glossy and lighting can cause the bumps at overlaps to become distractingly visible. Where that is considered a possible issue, path operations should be used to "punch" different-colored paths from each other, and then appropriate offsets added to accommodate registration, much like building traps in offset printing.
    (The above considerations are among the reasons why proper logo designs are intentionally designed as line art to avoid dependency upon graduated effects. If essential to the design, graduated effects are not just problematic for signage, but also for low-res printing like flexography, engraving on plaques or writing pens, single-color printing, screen printing, and other common needs.)
    So to do this right, you have some decisions to make:
    If this design is to be rendered from individual cut vinyl pieces adhered to a white substrate, especially for outdoor use, I would:
    Convert to solid-colored line art. Ditch the drop shadows and grad fills altogether.
    Union the two overlapping dark blue paths.
    Union the two overlapping green paths.
    Punch the green and light blue paths from the dark blue paths.
    Create offset paths of the green and light blue paths. Intersect these with the dark blue paths. Union the intersections with the green and light blue paths.
    Assemble in this order: Light blue, green, dark blue. This would provide a slight "trap" of the two ligher colors underneath the dark blue where they "kiss."
    The above treatment would be the simplest and most outdoor-durable since no printing is involved.
    If this design is to be rendered from individual cut vinyl pieces adhered to a white substrate, but I insisted on the grad fills and drop shadows, I would:
    Provide one raster image consisting of the small graphic.
    Provide one vector cut path for that image.
    Povide solid-filled cut paths for everything else.
    JET

  • How to make exit class unicode complaint

    Hi Experts,
    I am trying to make class of category 'Exit class' unicode complaint as it shows me error message as "The program "ZCL_EX_DEF_STP_GATEWAY========CP" is not     
         Unicode-compatible, according to its program attributes."
    But in properties section whenever I try to check unicode flag it shows message as
    "Exit classes/interfaces can only be edited using the BADI Builder".It do not allow.
    Is there any way to make it unicode complaint?

    hi Yogesh,
    Try to use SE18 and see if there is any option for this.
    Regards,
    Vivek

Maybe you are looking for

  • Hide column in SSRS is not working while exporting to CSV format.

    Hi, I have a report where some columns are hidden based on parameter value. When I export to Excel all the hidden columns are hiding which is fine, but the issue is when I exported to CSV all the hidden columns are exporting to csv. I tried to using 

  • How do I export a slideshow with music from iphoto to facebook?

    I have a Bloggie camer/video recorder and I took some pictures and video of an outing I had with some friends. I'd like to share the iphoto slideshow on facebook with my friends in the slideshow format that includes the default music of choice. Any s

  • Infotype log details

    Hi Experts..........      Here I have a custom Infotype.... for which some fields are not present in Development where as in Quality I can find all those fields....      I need a report which gives all the changes that have been made to that Custom I

  • Multiple selection in Query filter

    Hello, We have a requirement wherein in the Search Master Agreements and Agreements Query, we need to search on the Collaborators on a particular MA. We have duplicated the OOB query and have been able to acheive this, so this post is not regarding t

  • Sup Wermonitor is broken - Lenovo Please Answer and FIx

    I have had an X230 for 18 months. I am on the third build using your recovery DVD's. Sup Wermonitor is broken. It "stopped working" after Settings Dependency updated itself to V2.2.0.28. Three of these errors yesterday in the space of 30 minutes (yes