com.ibm.btt.config.impl
Class SimpleXMLTagProvider
java.lang.Object
com.ibm.btt.config.impl.SimpleXMLTagProvider
- All Implemented Interfaces:
- Initializer, TagProvider
- Direct Known Subclasses:
- RegexTagProvider
public class SimpleXMLTagProvider
- extends java.lang.Object
- implements TagProvider, Initializer
Field Summary |
protected java.util.Map<java.lang.String,Tag> |
tags
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
tags
protected java.util.Map<java.lang.String,Tag> tags
SimpleXMLTagProvider
public SimpleXMLTagProvider()
SimpleXMLTagProvider
public SimpleXMLTagProvider(java.lang.String fullPath)
- a SimpleXMLTagProvider always read the tag from a specified xml file.
- Parameters:
fullPath
- path to the xml file.rootTagName
- the tag name of the root xml tag in the xml file.
- Throws:
ConfigException
initialize
public void initialize(java.lang.String file)
throws TagProviderException
- Throws:
TagProviderException
getTag
public Tag getTag(java.lang.String key)
throws TagNotFoundException,
TagProviderException
- Description copied from interface:
TagProvider
- find a Tag identified by the id.
the behavior of this method depends on the implementaion.
You can choose to use SimpleXMLTagProvider, as its defines all the tag in
one file,
or, you can implement your own TagProvider, according to your
requirments.
You should throw a TagNotFondException when the tag for id is not defined rather than return a null value.
- Specified by:
getTag
in interface TagProvider
- Parameters:
key
- id of the tag.
- Returns:
- corresponding tag.
- Throws:
TagNotFoundException
- cannot find the tag because of no definition for the id.
TagProviderException
- Some error exist in TagProvider or its definition file.
cleanup
public void cleanup(KeyedCollection config)
throws BTTCleanUpException
- Specified by:
cleanup
in interface Initializer
- Throws:
BTTCleanUpException
initialize
public void initialize(KeyedCollection config)
throws BTTInitException
- Specified by:
initialize
in interface Initializer
- Throws:
BTTInitException
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
(c) Copyright IBM Corporation 1998, 2008