xMatchBeanTypeFromRuntime method

String xMatchBeanTypeFromRuntime()

Implementation

String xMatchBeanTypeFromRuntime() {
  var str = this.mxText;
  final regGeneric = r'\w+<\w+>';
  if (RegExp(regGeneric).allMatches(str).isNotEmpty) {
    final String clsType = RegExp(r'<\w+>')
        .allMatches(str)
        .map((e) => str.substring(e.start + 1, e.end - 1))
        .first;
    return clsType;
  }
  if (RegExp(r'\w+').allMatches(str).isNotEmpty) {
    return str;
  }
  return '';
}