Menu

#52 Storing additional user information in tag nodes

open
nobody
None
5
2007-01-26
2007-01-26
No

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;
}

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.