megamek.test
Class TinyXMLTest

java.lang.Object
  extended by megamek.test.TinyXMLTest
All Implemented Interfaces:
gd.xml.XMLResponder

public class TinyXMLTest
extends java.lang.Object
implements gd.xml.XMLResponder


Constructor Summary
TinyXMLTest(java.lang.String type, java.lang.String fname)
           
 
Method Summary
 java.io.InputStream getDocumentStream()
          This method is always called exactly once, before all other callbacks.
 void recordAttlistDeclaration(java.lang.String element, java.lang.String attr, boolean notation, java.lang.String type, java.lang.String defmod, java.lang.String def)
          This method is called when an attribute definition is parsed from an attlist tag in a DTD.
 void recordCharData(java.lang.String charData)
          This method is called to return character data to the application.
 void recordComment(java.lang.String comment)
          This method is called to return comments to the application.
 void recordDocEnd()
          This method is called to indicate that the document stream has been successfully closed.
 void recordDocStart()
          This method is called to indicate that the document stream has been opened successfully.
 void recordDoctypeDeclaration(java.lang.String name, java.lang.String pubID, java.lang.String sysID)
          This method is called after all the DTD related information is has been passed back.
 void recordElementDeclaration(java.lang.String name, java.lang.String content)
          This method is called when an element declaration is met in a DTD.
 void recordElementEnd(java.lang.String name)
          This method is called to indicate the closure of an element (tag).
 void recordElementStart(java.lang.String name, java.util.Hashtable attr)
          This method is called to indicate the start of an element (tag).
 void recordEntityDeclaration(java.lang.String name, java.lang.String value, java.lang.String pubID, java.lang.String sysID, java.lang.String notation)
          This method is called whenever an general entity declaration is parsed from a DTD.
 void recordNotationDeclaration(java.lang.String name, java.lang.String pubID, java.lang.String sysID)
          This method is called whenever a notation is parsed from a DTD.
 void recordPI(java.lang.String name, java.lang.String pValue)
          This method is called to passback program instructions to the application.
 java.io.InputStream resolveDTDEntity(java.lang.String name, java.lang.String pubID, java.lang.String sysID)
          This method is called to obtain an external DTD.
 java.io.InputStream resolveExternalEntity(java.lang.String name, java.lang.String pubID, java.lang.String sysID)
          This method is called when an external entity must be resolved for insertion into the document its DTD.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TinyXMLTest

public TinyXMLTest(java.lang.String type,
                   java.lang.String fname)
Method Detail

recordNotationDeclaration

public void recordNotationDeclaration(java.lang.String name,
                                      java.lang.String pubID,
                                      java.lang.String sysID)
                               throws gd.xml.ParseException
Description copied from interface: gd.xml.XMLResponder
This method is called whenever a notation is parsed from a DTD.

Specified by:
recordNotationDeclaration in interface gd.xml.XMLResponder
Parameters:
name - the name of the notation
pubID - the public ID of the notation if it was specified or null otherwise
sysID - the system ID (typically filename) of the notation (or null if unspecified)
Throws:
gd.xml.ParseException

recordEntityDeclaration

public void recordEntityDeclaration(java.lang.String name,
                                    java.lang.String value,
                                    java.lang.String pubID,
                                    java.lang.String sysID,
                                    java.lang.String notation)
                             throws gd.xml.ParseException
Description copied from interface: gd.xml.XMLResponder
This method is called whenever an general entity declaration is parsed from a DTD. Most applications will have no use for this information.

Specified by:
recordEntityDeclaration in interface gd.xml.XMLResponder
Parameters:
name - the name assigned to this entity
value - the replacement text of this entity
pubID - the public ID of the entities replacement text (or null if unspecified)
sysID - the system ID of the entities replacement text (or null if unspecified)
notation - specifies the notation associated with this entity (null if entity to be parsed as XML)
Throws:
gd.xml.ParseException

recordElementDeclaration

public void recordElementDeclaration(java.lang.String name,
                                     java.lang.String content)
                              throws gd.xml.ParseException
Description copied from interface: gd.xml.XMLResponder
This method is called when an element declaration is met in a DTD. Most applications will have no use for this information.

Specified by:
recordElementDeclaration in interface gd.xml.XMLResponder
Parameters:
name - the tag name given to this element
content - a regexp-like expression which specifies which elements and character data may appear within this element
Throws:
gd.xml.ParseException

recordAttlistDeclaration

public void recordAttlistDeclaration(java.lang.String element,
                                     java.lang.String attr,
                                     boolean notation,
                                     java.lang.String type,
                                     java.lang.String defmod,
                                     java.lang.String def)
                              throws gd.xml.ParseException
Description copied from interface: gd.xml.XMLResponder
This method is called when an attribute definition is parsed from an attlist tag in a DTD. Applications may wish to record these definitions to apply default values to element tags.

Specified by:
recordAttlistDeclaration in interface gd.xml.XMLResponder
Parameters:
element - the element to which this attribute applies
attr - the name of the attribute being described by this declaration
notation - the notation (if any) which applies to this attribute
type - the type of value defined by this attribute
defmod - describes the nature of this attributes default value (one of 'FIXED', 'REQUIRED', 'IMPLIED' - as per XML spec - or 'DEFAULT' indicating a 'basic' default value)
def - the default value of this attribute (may be null, indicating no default specified)
Throws:
gd.xml.ParseException

recordDoctypeDeclaration

public void recordDoctypeDeclaration(java.lang.String name,
                                     java.lang.String pubID,
                                     java.lang.String sysID)
                              throws gd.xml.ParseException
Description copied from interface: gd.xml.XMLResponder
This method is called after all the DTD related information is has been passed back. It supplies information about the document type applied to the document.

Specified by:
recordDoctypeDeclaration in interface gd.xml.XMLResponder
Parameters:
name - the name of the document type
pubID - the public ID of the document type (may be null)
sysID - the system ID of the document type (null if no external DTD is specified)
Throws:
gd.xml.ParseException

recordDocStart

public void recordDocStart()
Description copied from interface: gd.xml.XMLResponder
This method is called to indicate that the document stream has been opened successfully.

Specified by:
recordDocStart in interface gd.xml.XMLResponder

recordDocEnd

public void recordDocEnd()
Description copied from interface: gd.xml.XMLResponder
This method is called to indicate that the document stream has been successfully closed.

Specified by:
recordDocEnd in interface gd.xml.XMLResponder

recordElementStart

public void recordElementStart(java.lang.String name,
                               java.util.Hashtable attr)
                        throws gd.xml.ParseException
Description copied from interface: gd.xml.XMLResponder
This method is called to indicate the start of an element (tag).

Specified by:
recordElementStart in interface gd.xml.XMLResponder
Parameters:
name - the name of the element (tag name)
attr - a hashtable containing the explicitly supplied attributes (as strings)
Throws:
gd.xml.ParseException

recordElementEnd

public void recordElementEnd(java.lang.String name)
                      throws gd.xml.ParseException
Description copied from interface: gd.xml.XMLResponder
This method is called to indicate the closure of an element (tag).

Specified by:
recordElementEnd in interface gd.xml.XMLResponder
Parameters:
name - the name of the element (tag) being closed
Throws:
gd.xml.ParseException

recordPI

public void recordPI(java.lang.String name,
                     java.lang.String pValue)
Description copied from interface: gd.xml.XMLResponder
This method is called to passback program instructions to the application.

Specified by:
recordPI in interface gd.xml.XMLResponder
Parameters:
name - the name of the program instruction
pValue - the data associated with this program instruction

recordCharData

public void recordCharData(java.lang.String charData)
Description copied from interface: gd.xml.XMLResponder
This method is called to return character data to the application. As per the XML specification, newlines on all platforms are converted to single 0x0A's. Contiguous character data may be returned with successive calls to this method.

Specified by:
recordCharData in interface gd.xml.XMLResponder
Parameters:
charData - character data from the document.

recordComment

public void recordComment(java.lang.String comment)
Description copied from interface: gd.xml.XMLResponder
This method is called to return comments to the application. Most applications will have no use for this information. param comment the contents of the comment tag

Specified by:
recordComment in interface gd.xml.XMLResponder

getDocumentStream

public java.io.InputStream getDocumentStream()
                                      throws gd.xml.ParseException
Description copied from interface: gd.xml.XMLResponder
This method is always called exactly once, before all other callbacks. It is used to retrieve an inputstream from which the XML document will be parsed. This method may not return null.

Specified by:
getDocumentStream in interface gd.xml.XMLResponder
Returns:
an InputStream which supplies the document text.
Throws:
gd.xml.ParseException

resolveExternalEntity

public java.io.InputStream resolveExternalEntity(java.lang.String name,
                                                 java.lang.String pubID,
                                                 java.lang.String sysID)
                                          throws gd.xml.ParseException
Description copied from interface: gd.xml.XMLResponder
This method is called when an external entity must be resolved for insertion into the document its DTD. This method may return null as an indication that the application declines to retrieve the entity.

Specified by:
resolveExternalEntity in interface gd.xml.XMLResponder
Parameters:
name - the name of the entity to be retrieved.
pubID - the public ID of the entity (may be null)
sysID - the system ID of the entity
Returns:
an InputStream which supplies the entity's replacement text
Throws:
gd.xml.ParseException

resolveDTDEntity

public java.io.InputStream resolveDTDEntity(java.lang.String name,
                                            java.lang.String pubID,
                                            java.lang.String sysID)
                                     throws gd.xml.ParseException
Description copied from interface: gd.xml.XMLResponder
This method is called to obtain an external DTD. Most applications will simply refer this call to the resolveExternalEntity method. This separate callback method is made available, should the application need to resolve the ID's differently.

Specified by:
resolveDTDEntity in interface gd.xml.XMLResponder
Parameters:
name - the name of the DTD
pubID - its public ID (may be null)
sysID - its system ID
Returns:
an InputStream which supplies the DTD for this document
Throws:
gd.xml.ParseException