|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Configurable
Objects that can be configured by reading a file or configuration information given as text, typically in XML format, should implement this interface. This enables a user of a component to recognize that such file-based configuration is possible, and permits configuration to be specified via the MoML configure element. For example, a plotter actor implements this interface to allow the visual appearance of the plot to be set using PlotML. An icon for an actor implements this interface to allow the actor-specific visual features of the icon to be specified using graphics markup. Additionally, a filter actor could implement this interface to allow the filter specification to be given using markup.
This interface can also be used for actors which load configuration information from non-XML formats, such as GIF images or binary lookup tables. The source argument of the configure() method simply points to such a file.
This interface is designed to be reversible, so that an object can also provide enough information to reconstruct its current configuration. This mechanism is used when writing MoML from instantiated objects, although it could also be used to write a description of the object in other forms. In order for this to work properly calling the configure method on any object of the same type, given the data returned by the getSource and getText methods should result in an object that resemble the first as closely as possible.
CompositeActor,
AtomicActor
| Green (bart) |
| Green (neuendor) |
| Method Summary | |
|---|---|
void |
configure(java.net.URL base,
java.lang.String source,
java.lang.String text)
Configure the object with data from the specified input source (a URL) and/or textual data. |
java.lang.String |
getConfigureSource()
Return the input source that was specified the last time the configure method was called. |
java.lang.String |
getConfigureText()
Return the text string that represents the current configuration of this object. |
| Method Detail |
|---|
void configure(java.net.URL base,
java.lang.String source,
java.lang.String text)
throws java.lang.Exception
This method is defined to throw a very general exception to allow classes that implement the interface to use whatever exceptions are appropriate.
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.
java.lang.Exception - If something goes wrong.java.lang.String getConfigureSource()
java.lang.String getConfigureText()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||