Skip to content

Object Selection Engine

Ryan Davis edited this page Jan 30, 2015 · 1 revision

Tannus Object-Selection Engine

The Object-Selection Engine is a system by which programmers can create Strings which describe Objects, using a Regular-Expression-like grammar. This page details how to use this system, and the features of said grammar.


Features

The following is a list of object-description directives and their purpose:

  • {type-name} or "{type.name.with.package.path}" - Performs simple type-checking.

    Example String would validate "Hello, World!", and Number would validate 200

  • #{id} - Checks the id field of the object you're attempting to validate.

    Example #Dope would validate { 'id' : 'Dope' }

  • [{field}] - Checks that the object you're attempting to validate has the field referred to by {field}

    Example [length] would validate { 'length' : 0 }, and would also validate [1, 2, 3]

  • [{field} {op} {value}] - Checks that the result of operation {op} on {field} and {value} is true

    Example [name == "Ryan"] would validate { 'name' : "Ryan" } [length >= 3] would validate both [1, 2, 3, 4] and { 'length' : 3 }