Show / Hide Table of Contents

Class VariableToken

VariableToken class will look for names in the expression string. It follows the same rule as C# variable names which allows alpha numeric and underline characters. The leading character of a variable cannot be numeric. In addition, it allows two name to be joined together using a period. So "name1.name2" is also OK. However "name1.name2.name3" is not allowed.

Note: a variable name cannot be followed by a open parentheses because it will become a function. Please keep that in mind when creating a custom IVariableToken implementation.

Legal Variable Names

  • cat
  • cat
  • cat
  • cat0_
  • field.cat0_
  • field0.cat0_

Illegal Variable Names

  • test.field0.cat0_
  • 0cat
  • cat.1cat
  • 0cat.cat
  • $cat$

Inheritance
System.Object
VariableToken
Implements
IVariableToken
IOperandToken
IToken
Namespace: Albatross.Expression.Tokens
Assembly: Albatross.Expression.dll
Syntax
public class VariableToken : IVariableToken, IOperandToken, IToken

Properties

Calculated

Declaration
public bool Calculated { get; set; }
Property Value
Type Description
System.Boolean

Group

Declaration
public string Group { get; }
Property Value
Type Description
System.String

Name

Declaration
public string Name { get; }
Property Value
Type Description
System.String

Value

Declaration
public object Value { get; set; }
Property Value
Type Description
System.Object

Methods

Clone()

Declaration
public IToken Clone()
Returns
Type Description
IToken

CompareTo(IOperandToken)

Declaration
public int CompareTo(IOperandToken other)
Parameters
Type Name Description
IOperandToken other
Returns
Type Description
System.Int32

EvalText(String)

Declaration
public string EvalText(string format)
Parameters
Type Name Description
System.String format
Returns
Type Description
System.String

EvalValue(Func<String, Object>)

Declaration
public object EvalValue(Func<string, object> context)
Parameters
Type Name Description
System.Func<System.String, System.Object> context
Returns
Type Description
System.Object

Match(String, Int32, out Int32)

Declaration
public bool Match(string expression, int start, out int next)
Parameters
Type Name Description
System.String expression
System.Int32 start
System.Int32 next
Returns
Type Description
System.Boolean

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.Object.ToString()

Implements

IVariableToken
IOperandToken
IToken

Extension Methods

Extensions.ConvertToBoolean(Object)
Extensions.IsVariable(IToken)
Back to top Generated by DocFX