[This is preliminary documentation and is subject to change.]
| C# | Visual Basic | Visual C++ |
public class DefaultValueBuilder : IValueBuilder
Public Class DefaultValueBuilder _ Implements IValueBuilder
public ref class DefaultValueBuilder : IValueBuilder
| All Members | Constructors | Methods | Properties | ||
| Icon | Member | Description |
|---|---|---|
| DefaultValueBuilderDefaultValueBuilderNew(IDictionary) | Constructor | |
| AddAlias(String, String) | Registers an alias to a static .Net method. | |
| DefaultClass | Specifies the default class for .Net method calls that do not reference
a fully-qualified class name. Edustructures.SifWorks.DefaultValueBuilder
is used as the default unless this method is called to change it.
| |
| Evaluate(String) | Evaluate an expression that the implementation of this interface
understands to return a String value.
| |
| EvaluateCode(String) | Calls all .Net methods referenced in the source string to replace the
method reference with the string representation of the method's return
value
| |
| Map | Returns the variables Map | |
| Pad(IValueBuilder, String, String, String) | "@pad( Source, PadChar, Width )"
Pads the Source string with the specified PadChar character so that the
source string is at least Width characters in length. If the Source
string is already equal to or greater than Width, no action is taken.
| |
| ReplaceTokens(String, IDictionary) | Replaces all $(variable) tokens in the source string with
the corresponding entry in the supplied Map
| |
| ToLowerCase(IValueBuilder, String) | "@toLowerCase( Source )"
Converts the source string to lowercase
| |
| toMixedCase(IValueBuilder, String) | "@toMixedCase( Source )"
Converts the source string to mixed case
| |
| ToUpperCase(IValueBuilder, String) | "@toUpperCase( Source )"
Converts the source string to uppercase
|
The IValueBuilder interface is used by the SifDtd, SifDataObject, and Mappings classes when evaluating XPath-like query strings. It enables developers to customize the way the Adk evaluates value expressions in these query strings to produce a value for a SIF element or attribute. The DefaultIValueBuilder implementation supports $(variable) token replacement as well as @com.class.method style calls to static .Net methods.
Token Replacement
When a $(variable) token is found in an expression, it is replaced with a value from the Map passed to evaluate. For example, if the Map constains the entry "color=blue", calling the evaluate method with the expression "The color is $(color)" would produce the string "The color is blue".
.Net Method Calls
When a @method( arg1, arg2, ... ) call is found in an expression, the static .Net method is called and its return value inserted into the value string. Token replacement is performed before calling the method. If method is not fully-qualified, it is assumed to be a method declared by this DefaultIValueBuilder class. The default class can be changed by calling the setDefaultClass method. When writing your own static method, the first parameter must be of type IValueBuilder; zero or more String parameters may follow. The function must return a String: String method( IValueBuilder vb, String p1, String p2, ... ).
The color is @Edustructures.SifWorks.DefaultValueBuilder.ToUpperCase( $(color) )| Object | |
| DefaultValueBuilder | |