| By David Bismut, Krishnakumar Pooloth, Swaminathan Natarajan | Article Rating: |
|
| July 31, 2005 07:00 PM EDT | Reads: |
44,417 |
Adding a New Meta-Attribute
In some cases, you might need to add one or more custom attri-butes to handle a new type properly. Say, in the previous example, we wanted to build the ability to store the name of the base class (for the JDBC driver this would be java.sql.Driver) whose subclasses we want to select from. It would make the new control more generic. To implement it, we would need to add a new meta-attribute specific to this type, say, BASECLASS. To enable the framework to parse this new meta-attribute, you'd need to add a new regular expression pattern to the Parser class that matches the newly defined meta-attribute and then write the required processing so this data is passed to the constructor of the corresponding Parameter class.
Conclusion
Property files are frequently used in Java-based applications so their execution can be controlled externally. In this article we described the design and use of a lightweight framework for managing these property files. The framework is easily adoptable and allows for extensions. However, we believe it can be made even better. Java 1.5 supports the XML format for specifying properties. Enabling this framework support would ease the task of specifying documentation attributes (currently documentation need to be specified in a single line). We hope you enjoy working with this framework as much as we did developing it.
References
- http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html - Read the documentation about the Properties class. It also specifies the format in which property file needs to be specified.
- http://java.sun.com/docs/books/tutorial/uiswing/components/tabbedpane.html - Read the Java tutorial on how to use JTabbedPane.
- http://java.sun.com/docs/books/tutorial/uiswing/components/table.html - Read the Java tutorial on how to use JTable.
- www-106.ibm.com/developerworks/java/library/j-tiget02254.html - A more comprehensive read about the property file XML format introduced in Tiger.
- www.javaworld.com/javaworld/javatips/jw-javatip135.html - This article discusses a layered approach so that a large property file can be split into manageable smaller ones. It also introduces a tool helpful in managing these layered property files.
- http://java.sun.com/docs/books/tutorial/extra/regex - Read the Java tutorial on how to work with regular expressions.
Published July 31, 2005 Reads 44,417
Copyright © 2005 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By David Bismut
David Bismut is a third-year student at the Ecole des Mines in Nantes (EMN), a French engineering school. He specializes in information management technologies. He was part of InStep, Infosys's global internship program in 2004.
More Stories By Krishnakumar Pooloth
Krishnakumar Pooloth is a senior technical architect with Infosys Technologies. His areas of expertise include object design, component technology, Java, and expert systems. He holds a Bachelor's degree in electronics and communication from Calicut University, India.
More Stories By Swaminathan Natarajan
Swaminathan Natarajan is a technical architect with Infosys Technologies. His area of expertise is Java, repository technologies, and metadata management.
![]() |
Java Developer's Journal 07/31/05 06:42:09 PM EDT | |||
Enterprise Java - Properties Editor Framework |
||||
- Kindle 2 vs Nook
- Why IBM’s Server Chief Got Busted
- Is Cloud Computing Like Teenage Sex?
- Industry Experts Discuss the State of Cloud Computing
- Performance Tuning Essentials for Java
- Confessions of a Ulitzer Addict
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- It's the Java vs. C++ Shootout Revisited!
- Cloud Computing Can Revitalize Your Career as Software Developer
- IBM Could "Reinvent" Java: Mills
- Oracle & Cloud Computing: Exclusive Q&A with SVP Richard Sarwal
- A Brief History of Cloud Computing
- Kindle 2 vs Nook
- Cloud CEOs, CTOs & SVPs to Speak at 4th International Cloud Computing Expo
- Why IBM’s Server Chief Got Busted
- Is Cloud Computing Like Teenage Sex?
- Industry Experts Discuss the State of Cloud Computing
- Performance Tuning Essentials for Java
- The Difference Between Web Hosting and Cloud Computing
- Cloud Computing Expo: Exclusive Q&A with Yahoo! SVP Cloud Computing
- Ajax in RichFaces 3.3, JSF 2 and RichFaces 4
- Confessions of a Ulitzer Addict
- My Thoughts on Ulitzer
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- A Cup of AJAX? Nay, Just Regular Java Please
- Java Developer's Journal Exclusive: 2006 "JDJ Editors' Choice" Awards
- The i-Technology Right Stuff
- JavaServer Faces (JSF) vs Struts
- Rich Internet Applications with Adobe Flex 2 and Java
- Java vs C++ "Shootout" Revisited
- Bean-Managed Persistence Using a Proxy List
- Reporting Made Easy with JasperReports and Hibernate
- Creating a Pet Store Application with JavaServer Faces, Spring, and Hibernate
- What's New in Eclipse?
- Why Do 'Cool Kids' Choose Ruby or PHP to Build Websites Instead of Java?
- i-Technology Predictions for 2007: Where's It All Headed?




































