ptolemy.moml.filter
Class HideAnnotationNames

java.lang.Object
  extended byptolemy.moml.filter.HideAnnotationNames
All Implemented Interfaces:
MoMLFilter

public class HideAnnotationNames
extends java.lang.Object
implements MoMLFilter

When this class is registered with the MoMLParser.addMoMLFilter() method, it will cause MoMLParser to add a _hideName property property for any annotations.

Since:
Ptolemy II 2.0
Version:
$Id: HideAnnotationNames.java,v 1.20 2004/05/03 17:13:38 eal Exp $
Author:
Christopher Hylands
Accepted Rating:
Red (cxh)
Proposed Rating:
Red (cxh)

Constructor Summary
HideAnnotationNames()
           
 
Method Summary
 java.lang.String filterAttributeValue(NamedObj container, java.lang.String attributeName, java.lang.String attributeValue)
          If the attributeName is "name" and attributeValue ends with "annotation", then is added if it is not yet present.
 java.lang.String filterEndElement(NamedObj container, java.lang.String elementName)
          Given the elementName, perform any filter operations that are appropriate for the MOMLParser.endElement() method.
 java.lang.String toString()
          Return a string that describes what the filter does.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HideAnnotationNames

public HideAnnotationNames()
Method Detail

filterAttributeValue

public java.lang.String filterAttributeValue(NamedObj container,
                                             java.lang.String attributeName,
                                             java.lang.String attributeValue)
If the attributeName is "name" and attributeValue ends with "annotation", then
   
   
  
  is added if it is not yet present.

Specified by:
filterAttributeValue in interface MoMLFilter
Parameters:
container - The container for this attribute. in this method.
attributeName - The name of the attribute.
attributeValue - The value of the attribute.
Returns:
the value of the attributeValue argument.

filterEndElement

public java.lang.String filterEndElement(NamedObj container,
                                         java.lang.String elementName)
                                  throws java.lang.Exception
Given the elementName, perform any filter operations that are appropriate for the MOMLParser.endElement() method.

Specified by:
filterEndElement in interface MoMLFilter
Parameters:
container - The container for this attribute. in this method.
elementName - The element type name.
Returns:
the filtered element name, or null if MoMLParser.endElement() should immediately return.
Throws:
java.lang.Exception

toString

public java.lang.String toString()
Return a string that describes what the filter does.

Specified by:
toString in interface MoMLFilter
Returns:
the description of the filter that ends with a newline.