Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getValues in TagSupport

 
nikhil krish
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody tell me what will be returned by the getValues in TagSupport class. This method does not take any argument. So will it return an enumeration of all values set using setValue methods. Kindly clarify
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
TagSupport has an internal Map storage that you can use. You can add Objects to that Map that you may need in your processing but, don't want to make a variable with getters and setters for. To add it you call the setValue(String, Object) To get it, you can call getValue(String) and as with all Map's you can get all the Keys that where added to the Map you use getValues() This returns an Enumertion of the Keys to the Map (Kind of a misleading name, should be getValueKeys()).
This is useful when you need to have access in a child tag to an Object in a parent Tag but, don't want to have it available outside the Tags life cycle.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic