Class GenericClassSignatureParser

java.lang.Object
org.hl7.cql.model.GenericClassSignatureParser

public class GenericClassSignatureParser extends Object
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 Details

  • Constructor Details

    • GenericClassSignatureParser

      public GenericClassSignatureParser(String genericSignature, String baseType, String boundGenericTypeName, Map<String,DataType> resolvedTypes)
    • GenericClassSignatureParser

      public GenericClassSignatureParser(String genericSignature, Map<String,DataType> resolvedTypes)
  • Method Details

    • getGenericSignature

      public String getGenericSignature()
    • setGenericSignature

      public void setGenericSignature(String genericSignature)
    • getBaseType

      public String getBaseType()
    • setBaseType

      public void setBaseType(String baseType)
    • getBoundGenericTypeName

      public String getBoundGenericTypeName()
    • setBoundGenericTypeName

      public void setBoundGenericTypeName(String boundGenericTypeName)
    • parseGenericSignature

      public ClassType parseGenericSignature()
      Parses a generic type declaration such as Map<K,V>.
      Returns:
      Generic class constructed from this definition.
    • handleParameterDeclaration

      protected TypeParameter handleParameterDeclaration(String parameterString)
      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

      protected DataType resolveTypeName(String parameterType)
      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

      protected DataType handleBoundType(String boundGenericSignature)
      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

      public boolean isValidGenericSignature(String genericSignature)
      Returns true if the generic signature passed as an argument is well-formed.
      Parameters:
      genericSignature -
      Returns:
      True if the generic signature is valid