class

Ref

@Js
const class Ref : Obj

Ref is used to model an entity identifier and optional display string.

constructors fromStr

Make with simple id

makeWithDis

Construct with Ref id string and optional display string

make

Construct with id string and optional display string

fields nullRef

Null ref is "@null"

defVal

Default is nullRef

methods isIdChar

Is the given character a valid id char

toId

Take an arbitrary string and convert into a safe Ref identifier

toStr

String format is id which does not include the leading @

gen

Generate a unique Ref

isId

Return if the string is a valid Ref identifier

toCode

Return "@id"

equals

Equality is based on id only (not dis)

isNull

Null ref has id value of "null"?

id

Identifier which does not include the leading @

isSpec

Is this a spec ref with double colons

hash

Hash id

dis

Return display value of target if available, otherwise id

defVal const static Ref : defVal

Default is nullRef

dis Str dis()

Return display value of target if available, otherwise id

equals virtual Bool equals(Obj? that)

Equality is based on id only (not dis).

fromStr static new fromStr(Str id, Bool checked)

Make with simple id

gen static Ref gen()

Generate a unique Ref.

hash virtual Int hash()

Hash id

id Str id()

Identifier which does not include the leading @

isId static Bool isId(Str n)

Return if the string is a valid Ref identifier. See isIdChar

isIdChar static Bool isIdChar(Int char)

Is the given character a valid id char:

  • A - Z
  • a - z
  • 0 - 9
  • _ : - . ~

isNull Bool isNull()

Null ref has id value of "null"?

isSpec Bool isSpec()

Is this a spec ref with double colons

make static new make(Str id, Str? dis)

Construct with id string and optional display string.

makeWithDis static new makeWithDis(Ref ref, Str? dis)

Construct with Ref id string and optional display string.

nullRef const static Ref : nullRef

Null ref is "@null"

toCode Str toCode()

Return "@id"

toId static Str toId(Str n)

Take an arbitrary string and convert into a safe Ref identifier.

toStr virtual Str toStr()

String format is id which does not include the leading @. Use toCode to include leading @.

Haxall 4.0.5 ∙ 24-Feb-2026 14:33 EST