ptolemy.actor.ptalon
Class PtalonMLHandler

java.lang.Object
  extended by com.microstar.xml.HandlerBase
      extended by ptolemy.actor.ptalon.PtalonMLHandler
All Implemented Interfaces:
XmlHandler

public class PtalonMLHandler
extends HandlerBase

XML handler to be used for "configure" code when parsing a MoML model that contains a PtalonActor.

Since:
Ptolemy II 6.1
Version:
$Id: PtalonMLHandler.java 54721 2009-06-26 22:32:23Z cxh $
Author:
Adam Cataldo, Elaine Cheong
Accepted Rating:
Red (cxh)
Proposed Rating:
Red (cxh)

Field Summary
(package private)  PtalonActor _actor
          The actor that created this handler.
(package private)  java.util.Hashtable<java.lang.String,java.lang.String> _attributes
          Each element in this hashtable maps a name to a value.
 
Constructor Summary
PtalonMLHandler(PtalonActor actor)
          Create a PtalonMLHandler, which will be used to recover the AST and code manager specified in the PtalonML.
 
Method Summary
 void attribute(java.lang.String aname, java.lang.String value, boolean isSpecified)
          Process a PtalonML attribute.
 void endElement(java.lang.String elname)
          Process the end of a PtalonML element.
 void startElement(java.lang.String elname)
          Process the start of a PtalonML element.
 
Methods inherited from class com.microstar.xml.HandlerBase
charData, doctypeDecl, endDocument, endExternalEntity, error, ignorableWhitespace, processingInstruction, resolveEntity, startDocument, startExternalEntity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_actor

PtalonActor _actor
The actor that created this handler.


_attributes

java.util.Hashtable<java.lang.String,java.lang.String> _attributes
Each element in this hashtable maps a name to a value.

Constructor Detail

PtalonMLHandler

public PtalonMLHandler(PtalonActor actor)
Create a PtalonMLHandler, which will be used to recover the AST and code manager specified in the PtalonML.

Parameters:
actor - The actor to associate with this handler.
Method Detail

attribute

public void attribute(java.lang.String aname,
                      java.lang.String value,
                      boolean isSpecified)
               throws java.lang.Exception
Process a PtalonML attribute.

Specified by:
attribute in interface XmlHandler
Overrides:
attribute in class HandlerBase
Parameters:
aname - The name of the attribute.
value - The value of the attribute, or null if the attribute is #IMPLIED.
isSpecified - True if the value was specified, false if it was defaulted from the DTD.
Throws:
java.lang.Exception - If there is any trouble creating the AST or code manager,
See Also:
XmlHandler.attribute(java.lang.String, java.lang.String, boolean)

endElement

public void endElement(java.lang.String elname)
                throws java.lang.Exception
Process the end of a PtalonML element.

Specified by:
endElement in interface XmlHandler
Overrides:
endElement in class HandlerBase
Parameters:
elname - The element type name.
Throws:
java.lang.Exception - If there is any trouble creating the AST or code manager.
See Also:
XmlHandler.endElement(java.lang.String)

startElement

public void startElement(java.lang.String elname)
                  throws java.lang.Exception
Process the start of a PtalonML element.

Specified by:
startElement in interface XmlHandler
Overrides:
startElement in class HandlerBase
Parameters:
elname - The element type name.
Throws:
java.lang.Exception - If there is any trouble creating the AST or code manager,
See Also:
XmlHandler.startElement(java.lang.String)