Announcement Announcement Module
Collapse
No announcement yet.
Read / Write Beans Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Read / Write Beans

    Hello.

    I want to write a java program that opens an XML file containing any
    beans, show them and their properties to me, allow me to change some
    of properties and again, save the XML file with changes.

    Would you please help me?

  • #2
    What help do you need exactly?

    Spring will allow you to read beans in from an XML file and then you can use Introspection to find out their values, but Spring won't help you to persist any property changes back to file. For that you would need to extend Spring and add the persistence code yourself.

    Rob

    Comment


    • #3
      OK!
      Thanx for your help, but how, can i do the first part (reading the contents
      of an xml file, getting it's beans and their definitions)?

      Sincerely,

      Narsis.

      Comment


      • #4
        Hi

        Originally posted by narsis1313
        OK!
        Thanx for your help, but how, can i do the first part (reading the contents
        of an xml file, getting it's beans and their definitions)?

        Sincerely,

        Narsis.
        The first part is easy ... You can do it either through the ClassPathXmlApplicationContext or FileSystemXmlApplicationContext class. But what I don't understand is why is there a need to change its properties and save it back to the xml file again? Are you trying to do some sort of "dynamic" bean?

        Comment


        • #5
          Hi.
          OK! I want to write a visual program that allows the programmer to
          load a xml file, see the beans defined in it in a JTree,
          select a bean in the JTree and see it's properties and if want, change
          them and at last, save the changes in the original xml file.

          Sincerely,

          Narsis.

          Comment


          • #6
            This does not seem to be Spring related?

            There is the Spring IDE Eclipse plug-in that does great stuff, then there are some Bean documentation projects coming around.

            What you describe seems like a generic requirement. A web search shows many references, for example, http://www.devx.com/getHelpOn/10MinuteSolution/16694

            A 'subject' for this would be XML binding and editing. Many frameworks for this.

            Comment


            • #7
              OK!!!

              Thanx for your help jbetancourt.

              Sincerely.

              Comment

              Working...
              X