Typesafe and refactoring friendly bean binding alternative to jGoodies?

I've just read some jGoodies docs. It seems poewrful but it does have a problem: property names have to be specified as strings, so the compiler cannot enforce static type checking and refactoring becomes a nightmare.
PropertyConnector pc = new PropertyConnector(bean, "value", uicomp, "value");I'm surprised no one has invented something better yet, and I hope it was my fault when I searched for it. I mean, if you can get a Class reference from the language with
MyBean.class;it seems obvious you could do the same also with field members of a class, something like:
java.lang.reflect.Field myBeanProp = MyBean.fieldname.field;I understand that this would require the compiler to understand each field name as a keyword, and also that the above syntax is somewhat ambiguous, but I guess those problems can be worked around by using a new single fixed operator with two arguments, name it "property", something like the instanceof operator. I imagine something like:
java.lang.reflect.Field myBeanProp = MyBean property fieldname;This way refactoring can take place with standard IDEs tools and the Field instance has more chances to carry enough static type informations than a String so that the compiler can enforce type checking.
Do you know if something like this already exists? Do you know if JSR 295 is going to address these issues? If it does not, what do you think about this idea?
Your feedback is very appreciated.
Lucio.

930039 wrote:
Hi user404,
I am unable to instamtiate this class:
Warper warp = new Warper();
I think it should be Wrapper warp = new Wrapper ();
But still I am unable to instantiate this as well.
Do I need to create superate Wrapper.java class?.
I tried serializing AppModuleLocalImpl implements Serializable, it throwing java.lang.InstantiationException.
please suggest.
thanks,
VeereshOw yes, my bad. It should be Wrapper.
If you make a normal java class named Wrapper and paste the code provided by dario you should be able to make a Wrapper object in your AppModuleImpl.
You could also return a string (since your output param is VARCHAR) instead of Wrapper or Object since String is seriazable (if you can't get the Wrapper object working).
Trying to make your AppModule seriazable is not a good idea.

Similar Messages

  • Netbeans beans binding

    __How TO Bind The Domain object Directly To Detail View ?__
    when we create master detail table with netbeans .netbeans uses the following binding patern.bind the list to master table and master tables selected element to lists domain object
    how to use netbeans beans binding feature create a from which only have detail view (no master table )
    and bind domain (customer) object directly to GUI fields
    and i should have to the abilty to add new (create new ) domain object using the same form.
    I don’t want jtable in my form
    note:-and I have to be able to persist the old object and create new object in the same form
    ie :- add new button on the same form
    please visit following link for picture
    [http://netbeans7.blogspot.com/]

    I'll give my usual comment here:
    Take this to a NetBeans forum--since it's how to use the NetBeans GUI tool and hasn't anything to do with you coding Java--or go back and learn how to code GUI's without an auto-coder. I and many others are very reluctant to give any advice other than that to anyone that wants to use the auto-code features of a product.

  • Remove unwanted backing bean binding

    Hi All,
    My JSFX page has around 200 fields and I have to manipulate only a few fields in the backing bean. When I use this method to bind the UI components with the backing bean Design--> Page Properties ---> Component Binding ---> Auto Bind, all the page UI components get bound. This creates unnecssary binding and my backing bean java files becomes quite messy and runs into 5000 lines. Is it possible to remove the unwanted ones manually without causing any harm. What's the best practice by the way.
    Thanks
    Edited by: user5108636 on Mar 10, 2011 8:38 PM

    Hi,
    This creates unnecssary binding and my backing bean java files becomes quite messy and runs into 5000 lines
    This exactly is why the auto-generate option for backing beans is disabled by default in JDeveloper. There is no functionality in the IDE to remove unneeded bindings (how would the tool be able to tell what you need and what you don't need given that managed beans can be referenced from other managed beans and are referenced from EL in the component binding property).
    Best practices for working with backing beans is to not create them by default and instead use managed bean that you turn into backing beans (which is when they have a page component binding reference) only when needed. This way you stay in control
    Sorry, I have no better answer for this
    Frank

  • Why my new 4s call out and my friends can not hear me?

    why my new 4s call out and my friends can not hear me?

    Sounds like your microphone might be busted.  Test it by doing a voice memo. If this is the case you should take it to your service provider/carrier/nearest apple store to have it looked at.
    Alternatively, try using headphones or a bluetooth headset. These are all steps to make sure it's not the mic that's damaged.

  • Beans Binding: JList + Converter = convertForward not called

    Hello,
    I'm having difficulty getting beans binding of a JList selectedElements to work with a converter.
    I have a master detail generated app in Netbeans 6.1 b1. When I select the master table, my detail elements are all updating nicely except for a JList. The source property is a String (CSV) which I would like to run through a converter to turn the CSV into a List that the JList selectedElements can use. Unfortunately the converter's convertForward method is never called. If I select items in my JList, then the converter's convertReverse is called however the underlying source value is not updated. I'm obviously missing something here (either code or understanding!), could anyone please help me?
    Best regards,
    Chris.
    The code is as follows:
    Converter:
    import java.util.*;
    import org.jdesktop.beansbinding.Converter;
    public class AdditionalFeaturesConverter extends Converter<String, List<MyEntity>>{
        @Override
        public List<MyEntity> convertForward(final String csv) {
            // will implement once I get this called ;)
            return new ArrayList<MyEntity>();
        @Override
        public String convertReverse(final List<MyEntity> selected) {
            final StringBuilder csv = new StringBuilder();
            for (MyEntity entity : selected) {
                if (csv.length() > 0) {
                    csv.append(',');
                csv.append(entity.getId());
            return csv.toString();
    Netbeans generated code. Note: the EL worked perfectly for the default generated String -> JTextField binding.
    private void initComponents() {
           binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, masterTable, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.additionCashbackFeatures}"), jList1, org.jdesktop.beansbinding.BeanProperty.create("selectedElements"));
            binding.setConverter(new testapp.AdditionalFeaturesConverter());
            bindingGroup.addBinding(binding);
    }

    There is definitely something strange going on here.
    When I select from my master list, the binding does not set the selected items in the JList. In fact, the opposite is true - when I select from the master table and the newly selected property is overwritten with the last selection state of the JList.
    Has anyone seen this before?

  • Is the imessage server down? because is not working in my ipod and my friend's one

    because is not working in my ipod and my friend's one, then i logoff but now it doesnt let me log in :/

    Hi check here
    http://www.apple.com/support/systemstatus/
    As you can see imessage is down right now, so all you can do is wait for apple to fix whatever is wrong

  • My MBP mid2010 and my friend's MBP mid2011 SD card reader stopped working after upgrading to Mountain Lion. Please help

    Prior to Mountain lion upgrade we were running OS X Lion and everything was working fine. we upgraded to Mountain Lion and didnt notice the issue until a couple of months when we tried using the SD card reader to import pictures. i rolled back to snow leopard recently to wipe clean my hard disk and the SD card started working again but after updating to mountain lion the same issue occurs. need help thanks!

    Take you and your friend to an Apple store or AASP.

  • I just got a new iphone 4 for att and my friend installed the sim card in it for me. the imessage function isnt connecting with the my cell number. a while back i had logged into my apple account on someone elses cell phone and their number keeps showing.

    i just got a new iphone 4 for att and my friend installed the sim card in it for me. the imessage function isnt connecting with the my cell number. a while back i had logged into my apple account on someone elses cell phone and their number keeps showing. when i try to just select my number to send and recieve imessages from it will not show up. i can send and recieve regular text but not pictures or imessage. i have tried logging off and restarting and nothing has worked.help please!!

    Did you remove your account information from the other person's iPhone?

  • HT201342 My ID for apple is my email address with earthlink. Will I need to change my ID to my iCloud address. I want to be able to continue use my earthlink ID. I have had my earthlink email since 1997 and my friend and various services know and use my a

    I use my earthlink address as my apple ID. Will I have to change it if I add my iCloud email
    Account and send email from it. I intend to keep my earthlink account and email
    Address as I have had it since 1997 and my friends and several services I use know
    me by my earthlink handle. Will that be a problem?

    I'm not sure if I understand your question, but if you create a new iCloud account with a different ID your existing ID isn't effected by this.  It will continue to work as it does now, you will just have an additional Apple ID.  If you have an earthlink email address you can continue to use it as a separate account, and it can continue to be your default account if you set it to be (in Settings>Mail,Contacts,Calendars>Default Account).  If I'm misunderstanding your question, please explain further.

  • How to get stateful and stateless session bean in second jsp

    I create stateful session bean in the first jsp, then how can I get the stateful session bean in the second jsp? I find that somebody store the bean in HttpSession.
    If I store the stateful session bean in HttpSession, then I can get it in the second jsp. My problem is that I can store the stateless session bean in HttpSession, and get it in the second jsp. Then, both stateful and stateless can maintain the state in the second jsp. What is the difference between stateful and stateless session bean in this case ?
    I understand the definition of stateful and stateless session bean, but I'm confuse how to use session bean. Can anyone provide sample jsp to show difference of stateful and stateless? How the stateful session bean can maintain the state for the client?

    Greetings,
    I create stateful session bean in the first jsp, then how can I get the stateful session bean in the
    second jsp? I find that somebody store the bean in HttpSession.Which is the correct scope for sharing client-specific data when 'request' scope is insufficient.
    If I store the stateful session bean in HttpSession, then I can get it in the second jsp. My problem is
    that I can store the stateless session bean in HttpSession, and get it in the second jsp. Then, bothWhy is that a "problem"? Does your application not require the stateless bean to be shared? If so, then don't store the EJBObject reference in the session...
    stateful and stateless can maintain the state in the second jsp. What is the difference betweenWhat do you mean by this exactly?..
    stateful and stateless session bean in this case ?Statefulness of session beans is in regard to maintaining client state (er, in all cases). If your "stateless" bean is receiving information from the client (i.e. its caller) - either through a create method or a business method - and that information is available (retrievable from the bean) on subsequent method calls, then that bean is, in fact, stateful - regardless of how it is deployed.
    I understand the definition of stateful and stateless session bean, but I'm confuse how to use
    session bean.The correct question, it here seems, is "when" to use which type... Use a "stateful" bean when information about (from) the client (i.e. the caller) must be maintained across method calls of the bean. Use a "stateless" bean for general business methods that do not depend on "prior knowledge" of the client (i.e. the caller).
    Can anyone provide sample jsp to show difference of stateful and stateless? How the statefulA "sample JSP" would yield nothing additional... The semantics of calling, using, and "persisting", bean references are always the same - regardless of type or class. However, the reason(s) for using one over the other depends entirely on the needs of your application.
    session bean can maintain the state for the client?I recommend that you spend more time learning about EJBs generally. In particular, it seems you require more fundamental understanding of their scope and lifecycle. Refer to sections 4, 6, and 7 of the EJB 2.0 Specification.
    Regards,
    Tony "Vee Schade" Cook

  • My iPod touch isn't being recognized by my pc. The lock button on it won't work due to water damage, and a friend of mine fixed the problem by restoring it on his computer. How do I restore it without the lock button?

    My iPod touch isn't being recognized by my pc. The lock button on it won't work due to water damage, and a friend of mine fixed the problem by restoring it on his computer. How do I restore it without the lock button?

    first try:
    iOS: Device not recognized in iTunes for Windows
    next
    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.

  • Hello apple I have the problem with my iPhone and my friends have this problem too. My iPhone have the problem about calling and answer the call. When I use my iPhone to call I can't hear anything from my iPhone but the person that I call can answer it bu

    Hello apple
    I have the problem with my iPhone and my friends have this problem too.
    My iPhone have the problem about calling and answer the call. When I use my iPhone to call I can't hear anything from my iPhone but the person that I call can answer it but when answer both of us can't hear anything and when I put my iPhone to my face the screen is still on and when I quit the phone application and open it again it will automatic call my recent call. And when my friends call me my iPhone didn't show anything even the missed call I'm only know that I missed the call from messages from carrier. Please check these problem I restored my iPhone for 4 time now in this week. I lived in Hatyai, Songkhla,Thailand and many people in my city have this problem.
    Who have this problem??

    Apple isnt here. this is a user based forum for technical questions. The solution is to restart, reset, and restore as new which is in the manual after that get it replaced for hard ware failure. if your within your one year warranty its replaced if it is out of the warranty then it is 199$

  • IMessage works fine for me and my friend when talking with other Apple guys but doesn't work when we want to chat with each other

    Hello. Both me and my friend has got an iPhone. We both have the newest version of iOS7. We both have iMessage turned on and it works for both of us while we want to chat with other iPhone/iPad/iPod friends. But... when we want to send each other an iMessage... it doesn't work. Let's say my friend's contact name is "D" so i go to Messages -> New Message and in the recipient field i write D. I can choose her number and if it was iMessage "D" would obviously turn in blue like it does. But no, it turnes green and forces me to send normal SMS as if she didn't have an Apple device. Please help, klejbroda.

    Make sure the send address you are using for the friend (and vice versa) are actually one of those you have set for iMessage.

  • How to upload a file into server using j2ee jsp and servlet with bean?

    How to upload a file into server using j2ee jsp and servlet with bean? Please give me the reference or url about how to do that. If related to struts is more suitable.
    Anyone help me please!

    u don't need j2ee and struts to do file uploading. An example is as such
    in JSP. u use the <input> file tag like
    <input type="file"....>You need a bean to capture the file contents like
    class FileUploadObj {
        private FormFile srcFile;
        private byte[] fileContent;
        // all the getter and setter methods
    }Then in the servlet, you process the file for uploading
        * The following loads the uploaded binary data into a byte Array.
        FileUploadObj form = new FileUploadObj();
        byte[] byteArr = null;
        if (form.signFile != null) {
            int filesize = form.srcFile.getFileSize();
            byteArr = new byte[filesize];
            ByteArrayInputStream bytein = new ByteArrayInputStream (form.srcFile.getFileData());
            bytein.read(byteArr);
            bytein.close();
            form.setFileContent(byteArr);
        // Write file content using Writer class into the destination file in the server.
        ...

  • IPAD3/IPAD2 :PDF files/ attachments  sent in an email  displayed inline ( embedded within the main email) in the message text on both my Ipad2 and Ipad three, however the same email displayed the PDF File icons/ attachment on both my Iphone and a friend's

    IPAD3/IPAD2 :PDF files/ attachments  sent in an email  displayed inline ( embedded within the main email) in the message text on both my Ipad2 and Ipad three, however the same email displayed the PDF File icons/ attachment on both my Iphone and a friend’s PC. How do i get both my IPAD devices to display the PDF icons/attachments? Bearing in mind if i open the same email over the internet the PDF Icons/attachments display OK!
    Has anyone come across this? Your advice/help would be most appreciated

    This happens to me all the time.
    If is a one page PDF it seems as though it comes over already open and inline in the body of the email. Multiple page PDF files show as the PDF icon.
    I can't find any official documentation of this - other than based on my own experience with PDF attachments in my various email accounts.
    Message was edited by: Demo

Maybe you are looking for