public interface MoMLExportable extends Nameable
<elementName name="name" class="className" source="source"> body, determined by the implementor </elementName>or
<class name="name" extends="className" source="source"> body, determined by the implementor </class>The elementName is the string returned by getElementName(). The name is the string returned by getName(). The className is the string returned by getClassName(). The source is the string returned by getSource(). If either of the last two methods returns null, then that XML attribute is omitted from the description.
If this object has no container (and for the exportMoML() methods that take a depth argument, if that argument is zero), then the exportMoML() methods prepend XML file header information, which is:
<?xml version="1.0" standalone="no"?> <!DOCTYPE entity PUBLIC "-//UC Berkeley//DTD MoML 1//EN" "http://ptolemy.eecs.berkeley.edu/xml/dtd/MoML_1.dtd">In the above, "entity" may be replaced by "class", "property", or "port".
NamedObj
Modifier and Type | Method and Description |
---|---|
java.lang.String |
exportMoML()
Return a MoML description of this object.
|
java.lang.String |
exportMoML(java.lang.String name)
Return a MoML description of this object with its name replaced by
the specified name.
|
void |
exportMoML(java.io.Writer output)
Write a MoML description of this object using the specified
Writer.
|
void |
exportMoML(java.io.Writer output,
int depth)
Write a MoML description of this entity with the specified
depth in a hierarchy.
|
void |
exportMoML(java.io.Writer output,
int depth,
java.lang.String name)
Write a MoML description of this entity with the specified
depth in a hierarchy and with the specified name substituting
for the name of this object.
|
java.lang.String |
getClassName()
Return the class name.
|
java.lang.String |
getElementName()
Get the XML element name.
|
java.lang.String |
getSource()
Get the source, which gives an external URL
associated with an entity (presumably from which the entity
was defined).
|
boolean |
isPersistent()
Return true if this object is persistent.
|
void |
setPersistent(boolean isPersistent)
Set the persistence of this object.
|
void |
setSource(java.lang.String source)
Set the source, which gives an external URL
associated with an entity (presumably from which the entity
was defined).
|
description, getContainer, getDisplayName, getFullName, getName, getName, setName
java.lang.String exportMoML()
isPersistent()
java.lang.String exportMoML(java.lang.String name)
name
- The name that is used as a replacement.isPersistent()
void exportMoML(java.io.Writer output) throws java.io.IOException
exportMoML(new OutputStreamWriter(System.out))
output
- The writer to write to.java.io.IOException
- If an I/O error occurs.isPersistent()
void exportMoML(java.io.Writer output, int depth) throws java.io.IOException
output
- The output writer to write to.depth
- The depth in the hierarchy.java.io.IOException
- If an I/O error occurs.isPersistent()
void exportMoML(java.io.Writer output, int depth, java.lang.String name) throws java.io.IOException
output
- The output writer to write to.depth
- The depth in the hierarchy, to determine indenting.name
- The name to use in the exported MoML.java.io.IOException
- If an I/O error occurs.isPersistent()
java.lang.String getClassName()
Instantiable.getParent()
java.lang.String getElementName()
java.lang.String getSource()
setSource(String)
boolean isPersistent()
setPersistent(boolean)
void setPersistent(boolean isPersistent)
isPersistent
- False to make this object non-persistent.isPersistent()
void setSource(java.lang.String source)
source
- The source, or null if there is none.getSource()