Functions for parsing fully qualified type expression-like and reference expression-like Strings into Ceylon metamodels.

By: Tom Bentley
License: http://www.apache.org/licenses/LICENSE-2.0
Packages
com.github.tombentley.typeparser
Functions
parseModelshared Model|Type<Anything>|ParseError parseModel(String t)

Parses a “fully-qualified reference expression” returning its Type or Model.

Fully-qualified reference expressions are not defined by the Ceylon language specification, because in Ceylon source code reference expressions always use imported type names, not fully-qualified ones, but the syntax is pretty much as you'd expect.

When given an expression referencing an object, such as ceylon.language::true this function will return the Type in preference to the Value model.

Some examples:

ceylon.language::String
ceylon.language::true     // type Type, not the Value
ceylon.collection::MutableSet<ceylon.json::Object>
ceylon.language::String|ceylon.language::Integer
See also parseType()
parseTypeshared Type<Anything>|ParseError parseType(String t)

Parses a “fully-qualified type expression” returning its Type model.

Fully-qualified type expression are not defined by the Ceylon language specification, because in Ceylon source code type expressions always use imported type names, not fully-qualified ones, but the syntax is pretty much as you'd expect.

For example:

ceylon.language::String
ceylon.language::true     // type Type, not the Value
ceylon.collection::MutableSet<ceylon.json::Object>
See also parseModel()
Exceptions
ParseErrorshared ParseError

Indicates an error during parsing.