code: private void readTaskCustomPropertyDefinitions(Tasks gpTasks)
     {
        for (Taskproperty definition : gpTasks.getTaskproperties().getTaskproperty())
        {
           //
           // Ignore everything but custom values
           //
           if (!"custom".equals(definition.getType()))
           {
              continue;
           }
  
           //
           // Find the next available field of the correct type.
           //
           String type = definition.getValuetype();
           FieldType fieldType = TASK_PROPERTY_TYPES.get(type).getField();
  
           //
           // If we have run out of fields of the right type, try using a text field.
           //
           if (fieldType == null)
           {
              fieldType = TASK_PROPERTY_TYPES.get("text").getField();
           }
  
           //
           // If we actually have a field available, set the alias to match
           // the name used in GanttProject.
           //
           if (fieldType != null)
           {
              CustomField field = m_projectFile.getCustomFields().getCustomField(fieldType);
              field.setAlias(definition.getName());
              String defaultValue = definition.getDefaultvalue();
              if (defaultValue != null && defaultValue.isEmpty())
              {
                 defaultValue = null;
              }
              m_taskPropertyDefinitions.put(definition.getId(), new Pair<FieldType, String>(fieldType, defaultValue));
           }
        }
     }
docs: Read custom property definitions for tasks.
  
  @param gpTasks GanttProject tasks