Package ptolemy.moml.filter
Class NamedObjClassesSeen
- java.lang.Object
-
- ptolemy.moml.filter.MoMLFilterSimple
-
- ptolemy.moml.filter.NamedObjClassesSeen
-
- All Implemented Interfaces:
MoMLFilter
public class NamedObjClassesSeen extends MoMLFilterSimple
Create a Set of classes that extend NamedObj that are in the MoML parsed thus far. This filter does not modify the model.- Since:
- Ptolemy II 5.2
- Version:
- $Id$
- Author:
- Christopher Brooks, Edward A. Lee
- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Red (cxh)
-
-
Constructor Summary
Constructors Constructor Description NamedObjClassesSeen(java.util.HashMap classesToBeIndexed)
Create a filter that looks for classes that extend NamedObj.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
filterAttributeValue(NamedObj container, java.lang.String element, java.lang.String attributeName, java.lang.String attributeValue, java.lang.String xmlFile)
If the attributeName is "class" and the attributeValue extends NamedObj, then add the attributeValue to the set of classes we are interested in.void
filterEndElement(NamedObj container, java.lang.String elementName, java.lang.StringBuffer currentCharData, java.lang.String xmlFile)
In this class, do nothing.void
reset(java.lang.String modelPath)
Reset the filter.java.lang.String
toString()
Return a string that describes what the filter does.-
Methods inherited from class ptolemy.moml.filter.MoMLFilterSimple
filterAttributeValue, filterEndElement
-
-
-
-
Constructor Detail
-
NamedObjClassesSeen
public NamedObjClassesSeen(java.util.HashMap classesToBeIndexed)
Create a filter that looks for classes that extend NamedObj.- Parameters:
classesToBeIndexed
- A HashMap, where the key is a fully qualified dot separated String naming the class; and the key is a Set where each element is a String that is a relative path that refresh to the model.
-
-
Method Detail
-
filterAttributeValue
public java.lang.String filterAttributeValue(NamedObj container, java.lang.String element, java.lang.String attributeName, java.lang.String attributeValue, java.lang.String xmlFile)
If the attributeName is "class" and the attributeValue extends NamedObj, then add the attributeValue to the set of classes we are interested in.- Parameters:
container
- The container for this attribute. in this method.element
- The XML element name.attributeName
- The name of the attribute.attributeValue
- The value of the attribute.xmlFile
- The file currently being parsed.- Returns:
- the value of the attributeValue argument.
-
filterEndElement
public void filterEndElement(NamedObj container, java.lang.String elementName, java.lang.StringBuffer currentCharData, java.lang.String xmlFile) throws java.lang.Exception
In this class, do nothing.- Parameters:
container
- The object created by this element.elementName
- The element name.currentCharData
- The character data, which appears only in the doc and configure elementsxmlFile
- The file currently being parsed.- Throws:
java.lang.Exception
- Not thrown in this base class.
-
reset
public void reset(java.lang.String modelPath)
Reset the filter.- Parameters:
modelPath
- The new model path.
-
toString
public java.lang.String toString()
Return a string that describes what the filter does.- Specified by:
toString
in interfaceMoMLFilter
- Overrides:
toString
in classjava.lang.Object
- Returns:
- the description of the filter that ends with a newline.
-
-