public class TypeParser
extends java.lang.Object
Constructor and Description |
---|
TypeParser(NamespaceModel namespace)
Constructs a new type parser with a given namespace.
|
TypeParser(NamespaceModel namespace,
boolean visibilityStrict)
Constructs a new type parser with a given namespace.
|
TypeParser(NamespaceModel namespace,
boolean visibilityStrict,
java.util.Collection<java.lang.String> freeTypes)
Constructs a new type parser with a given namespace and a collection of free types.
|
TypeParser(NamespaceModel namespace,
boolean visibilityStrict,
java.util.Collection<java.lang.String> freeTypes,
FreeTypeMapping freeTypeMapping)
Constructs a new type parser with a given namespace, a collection of free types
and a given free type mapping.
|
TypeParser(NamespaceModel namespace,
java.util.Collection<java.lang.String> freeTypes)
Constructs a new type parser with a given namespace and a collection of free types.
|
Modifier and Type | Method and Description |
---|---|
protected ValidationException |
createValidationException(java.lang.String errorMessage,
org.antlr.runtime.tree.Tree tree)
Creates a validation exception with a given message.
|
protected Type |
findNamedType(QID qid)
Finds a type by a given name.
|
Type |
parseType(AntlrType antlrType)
Parses a type from an AntlrType object.
|
Type |
parseType(java.lang.String string)
Parses a type from a string.
|
Type |
parseType(org.antlr.runtime.tree.Tree tree)
Parses a type from an ANTLR tree.
|
java.util.List<Type> |
parseTypeList(java.lang.String string)
Parses a type list from a string.
|
java.util.Map<java.lang.String,Type> |
parseTypeParameters(AntlrTypeParameters typeParameters)
Parses a free type list from an AntlrTypeParameters object.
|
java.util.Map<java.lang.String,Type> |
parseTypeParameters(java.lang.String string)
Parses a type parameter declaration from a string.
|
TypeParametersAst |
parseTypeParametersAst(java.lang.String fullText,
AntlrTypeParameters typeParameters)
Parses a free type list from an AntlrTypeParameters object.
|
public TypeParser(NamespaceModel namespace)
namespace
- public TypeParser(NamespaceModel namespace, boolean visibilityStrict)
namespace
- visibilityStrict
- if true
, only public types are visible from imported modulespublic TypeParser(NamespaceModel namespace, java.util.Collection<java.lang.String> freeTypes)
namespace
- freeTypes
- public TypeParser(NamespaceModel namespace, boolean visibilityStrict, java.util.Collection<java.lang.String> freeTypes)
namespace
- visibilityStrict
- if true
, only public types are visible from imported modulesfreeTypes
- public TypeParser(NamespaceModel namespace, boolean visibilityStrict, java.util.Collection<java.lang.String> freeTypes, FreeTypeMapping freeTypeMapping)
namespace
- visibilityStrict
- if true
, only public types are visible from imported modulesfreeTypes
- freeTypeMapping
- public Type parseType(java.lang.String string) throws ValidationException
string
- ValidationException
- if the string
is not a valid typepublic Type parseType(org.antlr.runtime.tree.Tree tree) throws ValidationException
tree
- ValidationException
java.lang.NullPointerException
- if the tree
is nulljava.lang.IllegalArgumentException
- if the tree
is not a valid type treepublic Type parseType(AntlrType antlrType) throws ValidationException
antlrType
- ValidationException
public java.util.List<Type> parseTypeList(java.lang.String string) throws ValidationException
string
- ValidationException
- if the string
is not a valid list of typespublic java.util.Map<java.lang.String,Type> parseTypeParameters(java.lang.String string) throws ValidationException
null
.string
- ValidationException
- if the string
is not a valid type parameter declarationpublic java.util.Map<java.lang.String,Type> parseTypeParameters(AntlrTypeParameters typeParameters) throws ValidationException
null
.typeParameters
- ValidationException
- if the string
is not a valid type parameter declarationpublic TypeParametersAst parseTypeParametersAst(java.lang.String fullText, AntlrTypeParameters typeParameters) throws ValidationException
fullText
- a full sourcetypeParameters
- ValidationException
- if the string
is not a valid type parameter declarationprotected Type findNamedType(QID qid) throws ValidationException, AmbiguousTypeException
qid
- null
ValidationException
AmbiguousTypeException
protected ValidationException createValidationException(java.lang.String errorMessage, org.antlr.runtime.tree.Tree tree)
errorMessage
- tree
- Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.