Business Objects
Quark Platform Documentation
Version 1.7.0_0
Business Objects

org.openquark.cal.metadata
Class ArgumentMetadata

java.lang.Object
  extended by org.openquark.cal.metadata.CALFeatureMetadata
      extended by org.openquark.cal.metadata.ArgumentMetadata

public class ArgumentMetadata
extends CALFeatureMetadata

ArgumentMetadata models an argument to a CAL functional agent. It provides support for UI clients that want to assist the user in interactively providing a value for the argument.

Author:
Bo Ilic

Field Summary
static String DEFAULT_ARGUMENT_NAME
          The default argument name for arguments.
 
Constructor Summary
ArgumentMetadata(CALFeatureName featureName, Locale locale)
          Constructor for a new ArgumentMetadata object.
 
Method Summary
 CALFeatureMetadata copy(CALFeatureName featureName, Locale locale)
          
 CALFeatureMetadata copyTo(CALFeatureMetadata metadata)
          Copies this metadata object into the given metadata object.
 CALExpression getDefaultValuesExpression()
           
 CALExpression getPromptingTextExpression()
           
 CALExpression getValueValidationExpression()
           
 void loadXML(Node metadataNode)
          Loads this metadata object from the given node.
 void saveXML(Node parentNode)
          Saves this metadata object as a child of the given node.
 void setDefaultValuesExpression(CALExpression expression)
           
 void setDefaultValuesOnly(boolean defaultValuesOnly)
           
 void setPromptingTextExpression(CALExpression expression)
           
 void setValueValidationExpression(CALExpression expression)
           
 boolean useDefaultValuesOnly()
           
 
Methods inherited from class org.openquark.cal.metadata.CALFeatureMetadata
addRelatedFeature, clearAttribute, clearAttributes, clearRelatedFeatures, copy, getAttribute, getAttributeNames, getAuthor, getCreationDate, getDisplayName, getFeatureName, getLocale, getLongDescription, getModificationDate, getNRelatedFeatures, getNthRelatedFeature, getResourceName, getShortDescription, getVersion, isExpert, isHidden, isPreferred, removeRelatedFeature, setAttribute, setAuthor, setCreationDate, setDisplayName, setExpert, setHidden, setLongDescription, setModificationDate, setPreferred, setShortDescription, setVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ARGUMENT_NAME

public static final String DEFAULT_ARGUMENT_NAME
The default argument name for arguments.

See Also:
Constant Field Values
Constructor Detail

ArgumentMetadata

public ArgumentMetadata(CALFeatureName featureName,
                        Locale locale)
Constructor for a new ArgumentMetadata object.

Parameters:
featureName - the feature name of the argument
Method Detail

getPromptingTextExpression

public CALExpression getPromptingTextExpression()
Returns:
a CALExpression which evaluates to a value of type String. It is intended to be used as the prompting text for the user to enter a value for the argument.

setPromptingTextExpression

public void setPromptingTextExpression(CALExpression expression)
Parameters:
expression - the expression that returns the prompting text if the argument value is invalid

getDefaultValuesExpression

public CALExpression getDefaultValuesExpression()
Returns:
If the argument has type a, then this is a CAL expression that evaluates to a value of type [a], which is interpreted as an ordered list of default values for the argument.

setDefaultValuesExpression

public void setDefaultValuesExpression(CALExpression expression)
Parameters:
expression - the expression that gives the list of default values

getValueValidationExpression

public CALExpression getValueValidationExpression()
Returns:
used to validate values entered for an argument. If the argument has type a then this CALExpression should define a function of type a -> Maybe String. When the user enters the value of an argument, it is validated by calling the value validation expression on the value. A return value of Nothing indicates acceptance. A return value of Just String indicates the value was not validated successfully, and the String holds a textual explanation as to why.

setValueValidationExpression

public void setValueValidationExpression(CALExpression expression)
Parameters:
expression - the expression to use to validate values entered for this argument

useDefaultValuesOnly

public boolean useDefaultValuesOnly()
Returns:
whether to restrict an argument's value to one from the list of default values.

setDefaultValuesOnly

public void setDefaultValuesOnly(boolean defaultValuesOnly)
Parameters:
defaultValuesOnly - whether to restrict an argument's value to one from the list of default values.

copy

public CALFeatureMetadata copy(CALFeatureName featureName,
                               Locale locale)

Specified by:
copy in class CALFeatureMetadata
Returns:
a new copy of this metadata object with the given featureName and locale.

copyTo

public CALFeatureMetadata copyTo(CALFeatureMetadata metadata)
Description copied from class: CALFeatureMetadata
Copies this metadata object into the given metadata object.

Overrides:
copyTo in class CALFeatureMetadata
Parameters:
metadata - the metadata object to copy to
See Also:
CALFeatureMetadata.copyTo(org.openquark.cal.metadata.CALFeatureMetadata)

loadXML

public void loadXML(Node metadataNode)
             throws org.openquark.util.xml.BadXMLDocumentException
Description copied from class: CALFeatureMetadata
Loads this metadata object from the given node.

Overrides:
loadXML in class CALFeatureMetadata
Parameters:
metadataNode - the node from which to start loading
Throws:
org.openquark.util.xml.BadXMLDocumentException
See Also:
CALFeatureMetadata.loadXML(org.w3c.dom.Node)

saveXML

public void saveXML(Node parentNode)
Description copied from class: CALFeatureMetadata
Saves this metadata object as a child of the given node.

Overrides:
saveXML in class CALFeatureMetadata
Parameters:
parentNode - the node to save the metadata object to
See Also:
CALFeatureMetadata.saveXML(org.w3c.dom.Node)

Business Objects
Quark Platform Documentation
Version 1.7.0_0
Business Objects

Copyright © 2007 Business Objects. All rights reserved.