[Htmlparser-developer] How to store additional data objects in Tag class?
Brought to you by:
derrickoswald
From: Axel <ax...@gm...> - 2007-01-20 16:15:12
|
Hi I've asked this already some time ago. I would like to use some extra information in the tag nodes. Therefore I inserted the following methods in the Tag and TagNode classes. Does it make sense to have this simple methods in the standard htmlparser libraries? Or is it better to have something like a Tag#setExtraAttribute (String key, Object value) and Object Tag#getExtraAttribute (String key) methods which could store additional information per Tag as an special attribute? ****** Insert in file Tag.java ****** /** * Get the customer information for this tag * @return */ public Object getCustomerInfo(); /** * Set the customer information for this tag if necessary */ public void setCustomerInfo(Object customerInfo); ****** Insert in file TagNode.java ****** private Object mCustomerInfo=null; public Object getCustomerInfo(){ return mCustomerInfo; } public void setCustomerInfo(Object customerInfo){ mCustomerInfo= customerInfo; } -- Axel Kramer WikiBlog: http://www.groovy-news.org/e/page/axelclk |