code: public static boolean hasProperty(ClassNode classNode, String propertyName) {
          if (classNode == null || !StringUtils.hasText(propertyName)) {
              return false;
          }
  
          final MethodNode method = classNode.getMethod(GrailsNameUtils.getGetterName(propertyName), Parameter.EMPTY_ARRAY);
          if (method != null) return true;
  
          // check read-only field with setter
          if( classNode.getField(propertyName) != null && !classNode.getMethods(GrailsNameUtils.getSetterName(propertyName)).isEmpty()) {
              return true;
          }
  
          for (PropertyNode pn : classNode.getProperties()) {
              if (pn.getName().equals(propertyName) && !pn.isPrivate()) {
                  return true;
              }
          }
  
          return false;
      }
docs: Returns whether a classNode has the specified property or not
  
  @param classNode    The ClassNode
  @param propertyName The name of the property
  @return true if the property exists in the ClassNode