| java.lang.Object org.cougaar.lib.aggagent.query.ScriptSpec
ScriptSpec | public class ScriptSpec implements Serializable(Code) | | An instance of this class may be used to represent a script, including the
code itself plus a variety of information concerning the intended usage of
the script.
|
Constructor Summary | |
public | ScriptSpec(ScriptType t, Language l, String s) Create a new ScriptSpec for the provided script with the purpose and
language specified. | public | ScriptSpec(Language l, XmlFormat f, String s) Create a new ScriptSpec for an IncrementFormat, with the language and
XmlFormat specified. | public | ScriptSpec(Language l, AggType agg, String s, String ids) Create a new ScriptSpec for an Aggregator, with the aggregation type,
collation IDs, and script language specified. | public | ScriptSpec(ScriptType t, String s, Map p) Create a new ScriptSpec for a Java implementation. | public | ScriptSpec(XmlFormat f, String s, Map p) Create a new ScriptSpec for an IncrementFormat in Java. | public | ScriptSpec(AggType agg, String s, String ids, Map p) Create a new ScriptSpec for an Aggregator in Java. | public | ScriptSpec(Element root) Reconstitute a ScriptSpec that has been converted to XML. |
ScriptSpec | public ScriptSpec(ScriptType t, Language l, String s)(Code) | | Create a new ScriptSpec for the provided script with the purpose and
language specified. Everything else is left as its default value.
|
ScriptSpec | public ScriptSpec(Language l, XmlFormat f, String s)(Code) | | Create a new ScriptSpec for an IncrementFormat, with the language and
XmlFormat specified.
|
ScriptSpec | public ScriptSpec(Language l, AggType agg, String s, String ids)(Code) | | Create a new ScriptSpec for an Aggregator, with the aggregation type,
collation IDs, and script language specified.
|
ScriptSpec | public ScriptSpec(ScriptType t, String s, Map p)(Code) | | Create a new ScriptSpec for a Java implementation. Here, the purpose
of the script, the class name, and a parameter map for the Java class are
supplied by the caller.
|
ScriptSpec | public ScriptSpec(XmlFormat f, String s, Map p)(Code) | | Create a new ScriptSpec for an IncrementFormat in Java. The XmlFormat,
class name, and parameter list are provided by the caller.
|
ScriptSpec | public ScriptSpec(AggType agg, String s, String ids, Map p)(Code) | | Create a new ScriptSpec for an Aggregator in Java. The caller supplies
the AggType, class name, collation IDs, and a parameter map for the Java
class.
|
ScriptSpec | public ScriptSpec(Element root)(Code) | | Reconstitute a ScriptSpec that has been converted to XML. In effect,
this constructor is the inverse of the toXml() method of this class.
|
getAggIdString | public String getAggIdString()(Code) | | Retrieve the list of collation IDs for an Aggregator script.
|
getAggType | public AggType getAggType()(Code) | | Retrieve the type of aggregation that this script provides. See
Enum.AggType for details. This value is only meaningful if the script
type is Enum.ScriptType.AGGREGATOR, and should be ignored otherwise.
|
getFormat | public XmlFormat getFormat()(Code) | | Retrieve the type of XML encoding that this script provides. See
Enum.XmlFormat for details. This value is only meaningful if the script
type is Enum.ScriptType.INCREMENT_FORMAT, and should be ignored otherwise.
|
getLanguage | public Language getLanguage()(Code) | | Tell the language in which this script is written. See Enum.Language
for details.
|
getText | public String getText()(Code) | | Supply the caller with the text of the script. In the case of a Java
representation, the class name is returned.
|
getType | public ScriptType getType()(Code) | | Tell the basic purpose of the script. See Enum.ScriptType for details.
|
makeAggregator | public static Aggregator makeAggregator(Element elt) throws Exception(Code) | | Create an Aggregator directly from an XML representation. If the
document does not specify an Aggregator, an Exception may be raised.
|
makeAlert | public static Alert makeAlert(Element elt) throws Exception(Code) | | Create an Alert directly from an XML representation. If the document
does not specify an Alert, an Exception may be raised.
|
makeIncrementFormat | public static IncrementFormat makeIncrementFormat(Element elt) throws Exception(Code) | | Create an IncrementFormat directly from an XML representation. If the
document does not specify an IncrementFormat, an Exception may be raised.
|
makeObject | public static Object makeObject(Element elt) throws Exception(Code) | | Create an Object of the appropriate type directly from an XML
representation.
|
makeUnaryPredicate | public static UnaryPredicate makeUnaryPredicate(Element elt) throws Exception(Code) | | Create a UnaryPredicate directly from an XML representation. If the
document does not specify a UnaryPredicate, an Exception may be raised.
|
toAggregator | public Aggregator toAggregator() throws Exception(Code) | | Create an Aggregator from this ScriptSpec, if appropriate. If the
language spec is not one of those recognized, then this method will
return null. If the script is not an Aggregator script, then an
Exception will be raised.
|
toAlert | public Alert toAlert() throws Exception(Code) | | Create an Alert from this ScriptSpec, if appropriate. If the language
spec is not one of those recognized, then this method will return null.
If the script is not an Alert script, then an Exception will be raised.
|
toIncrementFormat | public IncrementFormat toIncrementFormat() throws Exception(Code) | | Create an IncrementFormat from this ScriptSpec, if appropriate. If the
language spec is not one of those recognized, then this method will
return null. If the script is not an IncrementFormat script, then an
Exception will be raised.
|
toObject | public Object toObject() throws Exception(Code) | | Convert this ScriptSpec to a Java Object of the appropriate type.
|
toUnaryPredicate | public UnaryPredicate toUnaryPredicate() throws Exception(Code) | | Create a UnaryPredicate from this ScriptSpec, if appropriate. If the
language spec is not one of those recognized, then this method will
return null. If the script is not a UnaryPredicate script, then an
Exception will be raised.
|
toXml | public String toXml()(Code) | | Convert this ScriptSpec to XML for transmission over a network. The
parsed XML document can then be used to reconstruct the ScriptSpec using
the constructor that takes an Element as its argument.
|
|
|