info.informatica.html.tag
Class TagParser

java.lang.Object
  extended by info.informatica.html.tag.TagParser

public class TagParser
extends Object

HTML / XML tag parser.

Author:
Carlos Amengual

Field Summary
 Properties tagmap
          Map between tag names and HTMLTag-inherited specialized classes.
 
Method Summary
 HTMLTag create(String tagname)
          Creates an HTMLTag with the given characteristics.
 HTMLTag create(String tagname, info.informatica.doc.FragmentPosition pos)
          Creates an HTMLTag with the given characteristics.
 HTMLTag create(String tagname, String tagid)
          Creates an HTMLTag with the given characteristics.
 HTMLTag create(String tagname, String tagid, info.informatica.doc.FragmentPosition pos)
          Creates an HTMLTag with the given characteristics.
static TagParser getInstance()
           
 void initDefaultTagmap()
          Initializes a default TagMap
 HTMLTag parse(String tag)
          Parses a String to create an HTMLTag.
 HTMLTag parse(String tag, info.informatica.doc.FragmentPosition pos)
          Parses a String to create an HTMLTag with the given position.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tagmap

public Properties tagmap
Map between tag names and HTMLTag-inherited specialized classes.

It is public so it can be set externally.

If null, no map will be used and GenericHTMLTag will be used.

You have an initDefaultTagmap() method to initialize the tag map with some defaults.

Method Detail

getInstance

public static TagParser getInstance()

initDefaultTagmap

public void initDefaultTagmap()
Initializes a default TagMap


parse

public HTMLTag parse(String tag,
                     info.informatica.doc.FragmentPosition pos)
              throws TagParsingException
Parses a String to create an HTMLTag with the given position.

Parameters:
tag - a String containing the tag
pos - the position to initialize the tag
Throws:
TagParsingException

parse

public HTMLTag parse(String tag)
              throws TagParsingException
Parses a String to create an HTMLTag.

Parameters:
tag - a String containing the tag
Throws:
TagParsingException

create

public HTMLTag create(String tagname,
                      info.informatica.doc.FragmentPosition pos)
Creates an HTMLTag with the given characteristics.

Parameters:
tagname - the name (type) of the tag.
pos - the position to initialize the tag.
Throws:
NullPointerException - if tagname is null.

create

public HTMLTag create(String tagname)
Creates an HTMLTag with the given characteristics.

Parameters:
tagname - the name (type) of the tag

create

public HTMLTag create(String tagname,
                      String tagid)
Creates an HTMLTag with the given characteristics.

Parameters:
tagname - the name (type) of the tag
tagid - the ID for the tag

create

public HTMLTag create(String tagname,
                      String tagid,
                      info.informatica.doc.FragmentPosition pos)
Creates an HTMLTag with the given characteristics.

Parameters:
tagname - the name (type) of the tag
tagid - the ID for the tag
pos - the position to initialize the tag