com.palserv.XMidi
Class Tag

java.lang.Object
  extended by com.palserv.XMidi.Tag
All Implemented Interfaces:
iTag
Direct Known Subclasses:
TagCHANNEL, TagCHUNK, TagContent, TagDELTA, TagEDATA, TagFORMAT, TagNOTE_OFF, TagSTATUS, TagTIME_SIG, TagXMidi

public class Tag
extends java.lang.Object
implements iTag

Base class for all Tag classes. This class should never be instantiated.


Constructor Summary
Tag()
           
 
Method Summary
 java.lang.String createEndXML(State state)
          Create the XML end tag, if needed.
 java.lang.String createStartXML(State state)
          Create the XML start tag.
 void endElement(State state)
          Handle the end of each element.
 java.lang.String getName()
          Get the tag name.
static Tag getTag(java.lang.String tName)
          Factory method to get a Tag by name.
 void startElement(org.xml.sax.Attributes attr, State state)
          Handle the beginning of each element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tag

public Tag()
Method Detail

getTag

public static Tag getTag(java.lang.String tName)
Factory method to get a Tag by name.

Parameters:
tName - - the tag name.
Returns:
the correct Tag object.

startElement

public void startElement(org.xml.sax.Attributes attr,
                         State state)
Handle the beginning of each element. Invoked by the XM.startElement method of XM, which implements the SAX interface.

Specified by:
startElement in interface iTag
Parameters:
attr - - a list of attributes (org.xml.sax.Attributes)
state - - the State object.

endElement

public void endElement(State state)
Handle the end of each element. Invoked by the XM.endElement method of XM, which implements the SAX interface.

Specified by:
endElement in interface iTag
Parameters:
state - - the State object.

createStartXML

public java.lang.String createStartXML(State state)
Create the XML start tag. This is invoked from various places during MX processing.

Specified by:
createStartXML in interface iTag
Parameters:
state - - the State object.
Returns:
the start tag.

createEndXML

public java.lang.String createEndXML(State state)
Create the XML end tag, if needed. This is invoked from various places during MX processing.

Specified by:
createEndXML in interface iTag
Parameters:
state - - the State object.
Returns:
the end tag.

getName

public java.lang.String getName()
Get the tag name.

Returns:
the tag name.