Package org.hl7.cql.model
Class GenericClassSignatureParser
java.lang.Object
org.hl7.cql.model.GenericClassSignatureParser
The GenericClassSignatureParser is a convenience class for the parsing of generic signature
and the creation of the corresponding CQL DataTypes, namely, GenericClassType and GenericClassProfileType.
The former is used to capture the declaration of a GenericClass such as List<T>. The latter is used to capture a new type
such as 'IntegerList' formed by binding types to generic parameters such as List<Integer>.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CharSequencestatic final Stringstatic final CharSequence -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected DataTypehandleBoundType(String boundGenericSignature) Method resolves bound type if it exists or else creates it and adds it to the resolved type index.protected TypeParameterhandleParameterDeclaration(String parameterString) Method handles a generic parameter declaration such as T, or T extends MyType.booleanReturns true if the generic signature assigned to this object is well-formed.booleanisValidGenericSignature(String genericSignature) Returns true if the generic signature passed as an argument is well-formed.Parses a generic type declaration such as Map<K,V>.protected DataTyperesolveTypeName(String parameterType) Identifies the data type for the named type.voidsetBaseType(String baseType) voidsetBoundGenericTypeName(String boundGenericTypeName) voidsetGenericSignature(String genericSignature)
-
Field Details
-
OPEN_BRACKET
-
CLOSE_BRACKET
-
EXTENDS
- See Also:
-
-
Constructor Details
-
GenericClassSignatureParser
-
GenericClassSignatureParser
-
-
Method Details
-
getGenericSignature
-
setGenericSignature
-
getBaseType
-
setBaseType
-
getBoundGenericTypeName
-
setBoundGenericTypeName
-
parseGenericSignature
Parses a generic type declaration such as Map<K,V>.- Returns:
- Generic class constructed from this definition.
-
handleParameterDeclaration
Method handles a generic parameter declaration such as T, or T extends MyType.- Parameters:
parameterString-- Returns:
- Type parameter for this parameter for this string declaration.
-
resolveTypeName
Identifies the data type for the named type. If the argument is null, the return type will be null.- Parameters:
parameterType-- Returns:
- The parameter's type
-
handleBoundType
Method resolves bound type if it exists or else creates it and adds it to the resolved type index.- Parameters:
boundGenericSignature-- Returns:
- The bound type created or resolved
-
isValidGenericSignature
public boolean isValidGenericSignature()Returns true if the generic signature assigned to this object is well-formed.- Returns:
- True if the generic signature is valid
-
isValidGenericSignature
Returns true if the generic signature passed as an argument is well-formed.- Parameters:
genericSignature-- Returns:
- True if the generic signature is valid
-