Seldom used, this allows to access the reference itself, while AsMap, AsList and AsValue access the referenced Object.

C# |
public virtual Reference AsReference()

Returns itself or throws an Exception if it can't

Normally there is no need to access References, they just work their Targets are supposed to work.


Sofu.Sofu.Map stuff = new Sofu.Sofu.Map(); stuff.SetAttribute("vally",new Sofu.Sofu.Reference("valref",new Sofu.Sofu.Value("Hello World"))); Console.Out.WriteLine(stuff.Object("vally").AsReference().ToString()); //Will write "selfref" Console.Out.WriteLine(stuff.Object("vally").AsValue().ToString()); //Will write "Hello World"

Exception | Condition |
---|---|
SofuNotReferenceException | Gets thrown if the Object is not a Reference |