/**
  * Find parent entry.
  *
  * @param entries the entries
  * @param key the key
  * @return the step injection meta entry
  */
 protected StepInjectionMetaEntry findParentEntry(
     List<StepInjectionMetaEntry> entries, String key) {
   for (StepInjectionMetaEntry look : entries) {
     if (look.getKey().equals(key)) return look;
     StepInjectionMetaEntry check = findParentEntry(look.getDetails(), key);
     if (check != null) return check;
   }
   return null;
 }
  /** Describe the metadata attributes that can be injected into this step metadata object. */
  public List<StepInjectionMetaEntry> getStepInjectionMetadataEntries(Class<?> PKG) {
    List<StepInjectionMetaEntry> entries = new ArrayList<StepInjectionMetaEntry>();

    for (KettleAttributeInterface attr : attributes) {
      if (attr.getParent() == null) {
        entries.add(createEntry(attr, PKG));
      } else {
        StepInjectionMetaEntry entry = createEntry(attr, PKG);
        StepInjectionMetaEntry parentEntry = findParentEntry(entries, attr.getParent().getKey());
        if (parentEntry == null) {
          throw new RuntimeException(
              "An error was detected in the step attributes' definition: the parent was not found for attribute "
                  + attr);
        }
        parentEntry.getDetails().add(entry);
      }
    }

    return entries;
  }