Class TransformationAttribute

    • Field Detail

      • condition

        public Parameter condition
        The condition under which this attribute is applicable. It must evaluate to a BooleanToken. If its value is false, execution of the transformation causes no effect.
    • Constructor Detail

      • TransformationAttribute

        public TransformationAttribute​(NamedObj container,
                                       java.lang.String name)
                                throws NameDuplicationException,
                                       IllegalActionException
        Construct an attribute with the given name contained by the specified entity. The container argument must not be null, or a NullPointerException will be thrown. This attribute will use the workspace of the container for synchronization and version counts. If the name argument is null, then the name is set to the empty string. Increment the version of the workspace.
        Parameters:
        container - The container.
        name - The name of this attribute.
        Throws:
        IllegalActionException - If the attribute is not of an acceptable class for the container, or if the name contains a period.
        NameDuplicationException - If the name coincides with an attribute already in the container.
      • TransformationAttribute

        public TransformationAttribute​(Workspace workspace)
        Construct an attribute in the specified workspace with an empty string as a name. You can then change the name with setName(). If the workspace argument is null, then use the default workspace. The object is added to the directory of the workspace. Increment the version number of the workspace.
        Parameters:
        workspace - The workspace that will list the attribute.
    • Method Detail

      • addExecutionListener

        public void addExecutionListener​(ExecutionListener listener)
        Add an execution listener to the list of execution listeners, which are invoked at specific points when the transformation is executed.
        Parameters:
        listener - The listener.
        See Also:
        removeExecutionListener(ExecutionListener)
      • clone

        public java.lang.Object clone​(Workspace workspace)
                               throws java.lang.CloneNotSupportedException
        Clone the object into the specified workspace. The new object is not added to the directory of that workspace (you must do this yourself if you want it there). The result is an attribute with no container.
        Overrides:
        clone in class Attribute
        Parameters:
        workspace - The workspace for the cloned object.
        Returns:
        The new Attribute.
        Throws:
        java.lang.CloneNotSupportedException - Not thrown in this base class
        See Also:
        NamedObj.exportMoML(Writer, int, String), NamedObj.setDeferringChangeRequests(boolean)
      • configure

        public void configure​(java.net.URL base,
                              java.lang.String source,
                              java.lang.String text)
                       throws java.lang.Exception
        Configure the object with data from the specified input source (a URL) and/or textual data. The object should interpret the source first, if it is specified, followed by the literal text, if that is specified. The new configuration should usually override any old configuration wherever possible, in order to ensure that the current state can be successfully retrieved.

        This method is defined to throw a very general exception to allow classes that implement the interface to use whatever exceptions are appropriate.

        Specified by:
        configure in interface Configurable
        Parameters:
        base - The base relative to which references within the input are found, or null if this is not known, or there is none.
        source - The input source, which specifies a URL, or null if none.
        text - Configuration information given as text, or null if none.
        Throws:
        java.lang.Exception - If something goes wrong.
      • executeTransformation

        public void executeTransformation()
                                   throws java.lang.Exception
        Execute the transformation with the container of this attribute as the model to be transformed.
        Throws:
        java.lang.Exception - If error occurs in the transformation.
        See Also:
        executeTransformation(CompositeEntity)
      • executeTransformation

        public void executeTransformation​(CompositeEntity model)
                                   throws java.lang.Exception
        Execute the transformation with the given model as the model to be transformed.
        Parameters:
        model - The model to be transformed.
        Throws:
        java.lang.Exception - If error occurs in the transformation.
      • getConfigureSource

        public java.lang.String getConfigureSource()
        Return the input source that was specified the last time the configure method was called.
        Specified by:
        getConfigureSource in interface Configurable
        Returns:
        The string representation of the input URL, or null if the no source has been used to configure this object, or null if no external source need be used to configure this object.
      • getConfigureText

        public java.lang.String getConfigureText()
        Return the text string that represents the current configuration of this object. Note that any configuration that was previously specified using the source attribute need not be represented here as well.
        Specified by:
        getConfigureText in interface Configurable
        Returns:
        A configuration string, or null if no configuration has been used to configure this object, or null if no configuration string need be used to configure this object.
      • getModelUpdater

        public PteraModalModel getModelUpdater()
        Get the model updater encapsulated in this attribute.
        Returns:
        The model updater.
      • removeExecutionListener

        public void removeExecutionListener​(ExecutionListener listener)
        Remove an execution listener from the list of execution listeners, which\ are invoked at specific points when the transformation is executed.
        Parameters:
        listener - The listener to be removed.
        See Also:
        addExecutionListener(ExecutionListener)
      • _exportMoMLContents

        protected void _exportMoMLContents​(java.io.Writer output,
                                           int depth)
                                    throws java.io.IOException
        Write a MoML description of the contents of this object, which in this base class is the attributes. This method is called by _exportMoML(). If there are attributes, then each attribute description is indented according to the specified depth and terminated with a newline character. Callers of this method should hold read access before calling this method. Note that exportMoML() does this for us.
        Overrides:
        _exportMoMLContents in class NamedObj
        Parameters:
        output - The output stream to write to.
        depth - The depth in the hierarchy, to determine indenting.
        Throws:
        java.io.IOException - If an I/O error occurs.
        See Also:
        NamedObj.exportMoML(Writer, int)