code: public PortletDefinition getPortletDescriptor(PortletDefinitionForm form) {
          final Tuple<String, String> portletDescriptorKeys = this.getPortletDescriptorKeys(form);
          if (portletDescriptorKeys == null) {
              return null;
          }
          final String portletAppId = portletDescriptorKeys.first;
          final String portletName = portletDescriptorKeys.second;
  
          final PortletRegistryService portletRegistryService =
                  portalDriverContainerServices.getPortletRegistryService();
          try {
              return portletRegistryService.getPortlet(portletAppId, portletName);
          } catch (PortletContainerException e) {
              e.printStackTrace();
              return null;
          }
      }
docs: Get a portlet descriptor matching the current portlet definition form. If the current form
  does not represent a portlet, the application or portlet name fields are blank, or the
  portlet description cannot be retrieved, the method will return <code>null</code>.
  
  @param form
  @return