code: static JMethod getter(FieldOutline fieldOutline) {
          final JDefinedClass theClass = fieldOutline.parent().implClass;
          final String publicName = fieldOutline.getPropertyInfo().getName(true);
          final JMethod getgetter = theClass.getMethod("get" + publicName, NONE);
          if (getgetter != null) {
              return getgetter;
          } else {
              final JMethod isgetter = theClass
                      .getMethod("is" + publicName, NONE);
              if (isgetter != null) {
                  return isgetter;
              } else {
                  return null;
              }
          }
      }
docs: Borrowed this code from jaxb-commons project
  
  @param fieldOutline reference to a field
  @return Getter for the given field or null