<p>Creates a new or retrieves an existing instance of EntityType with the given name.</p>

@param name   the specified name of the EntityType
@param parent the parent element of the enum;
@return The instance of EntityType corresponding th the give name.
494190
public static EntityType create(@NonNull String name, EntityType parent) {
      EntityType toReturn = DynamicEnum.register(new EntityType(name, parent));
      if (toReturn.setParentIfAbsent(parent)) {
         Config.setProperty(toReturn.canonicalName() + ".parent", parent.canonicalName());
      }
      values.add(toReturn);
      return toReturn;
   }
108829
@SuppressWarnings({ "unchecked", "rawtypes" })
    protected Enum getEnumParameter(String name) {
        return context.getConfiguration().getEnum(name, null);
    }
257912
@SuppressWarnings("unchecked")
    public static <T> T getBean(String name) {
        BeanManager bm = getBeanManager();
        Bean<?> bean = bm.getBeans(name).iterator().next();
        CreationalContext<?> ctx = bm.createCreationalContext(bean);
        return (T) bm.getReference(bean, bean.getBeanClass(), ctx);
    }
1019239
public JBBPDslBuilder Custom(final String type, final String name) {
    return this.Custom(type, name, null);
  }
852874
public ResourceDescription getChildDescription(String type, String name) {
        if (hasChildrenDefined()) {
            List<Property> children = get("children").asPropertyList();
            for (Property child : children) {
                if (type.equals(child.getName()) && child.getValue().hasDefined(MODEL_DESCRIPTION)) {
                    List<Property> modelDescriptions = child.getValue().get(MODEL_DESCRIPTION).asPropertyList();
                    for (Property modelDescription : modelDescriptions) {
                        if (name.equals(modelDescription.getName())) {
                            return new ResourceDescription(modelDescription.getValue());
                        }
                    }
                }
            }
        }
        return EMPTY;
    }
517090
private void createCompleteKey(Key parent, long id) {
    String kind = entityMetadata.getKind();
    if (parent == null) {
      key = entityManager.newNativeKeyFactory().setKind(kind).newKey(id);
    } else {
      key = Key.newBuilder(parent, kind, id).build();
    }
  }
279195
public XElement add(String name) {
        XElement result = new XElement(name);
        result.parent = this;
        children.add(result);
        return result;
    }
924520
public static <T extends Enum<T>> T getEnumValue(Class<T> enumType,
            String name) {
        if (StringUtils.isEmpty(name)) {
            return null;
        }
        
        try {
            T v = Enum.valueOf(enumType, name);
            return v;
        } catch (IllegalArgumentException e) {
            return null;
        }
    }
1040704
public ManagedEntity findChild(ManagedEntity parent, String name) throws RuntimeFault, RemoteException {
        if (parent == null) {
            throw new IllegalArgumentException("parent entity must not be null.");
        }
        ManagedObjectReference mor = getVimService().findChild(getMOR(), parent.getMOR(), name);
        return MorUtil.createExactManagedEntity(getServerConnection(), mor);
    }
386633
public static TokenType create(@NonNull String name) {
      TokenType toReturn = DynamicEnum.register(new TokenType(name));
      values.add(toReturn);
      return toReturn;
   }
895750
@Override
   @SuppressWarnings("unchecked")
   public <E, T extends Resource<E>> T getChildOfType(final Class<T> type, final String name) throws ResourceException
   {
      T result;
      Resource<?> child = getChild(name);
      if (type.isAssignableFrom(child.getClass()))
      {
         result = (T) child;
      }
      else if (child.exists())
      {
         throw new ResourceException("Requested resource [" + name + "] was not of type [" + type.getName()
                  + "], but was instead [" + child.getClass().getName() + "]");
      }
      else
      {
         E underlyingResource = (E) child.getUnderlyingResourceObject();
         result = getResourceFactory().create(type, underlyingResource);
      }
      return result;
   }
350952
public function createElement(Node $parent, $name)
    {
        if (array_key_exists($name, $this->elementMap)) {
            $class = $this->elementMap[$name];

            return new $class($parent);
        }

        return null;
    }
57915
protected Type<?> loadType( String name )
    {
        Type<?> type = typeLoader.loadType( name );
        if (type == null) throw new TypeNotFoundException( name , this.getClass());
        return type;
    }
621963
public JBBPDslBuilder Int(final String name) {
    final Item item = new Item(BinType.INT, name, this.byteOrder);
    this.addItem(item);
    return this;
  }
62149
public static <T> NamedParameterNode<T> createNamedParameterNode(final Node parent,
                                                                   final Class<? extends Name<T>> clazz,
                                                                   final Type argClass)
      throws ClassHierarchyException {

    Class<?> argRawClass = ReflectionUtilities.getRawClass(argClass);

    final boolean isSet = argRawClass.equals(Set.class);
    final boolean isList = argRawClass.equals(List.class);

    final Type argClazz;

    if (isSet || isList) {
      argClazz = ReflectionUtilities.getInterfaceTarget(Collection.class, argClass);
    } else {
      argClazz = argClass;
    }

    final String simpleName = ReflectionUtilities.getSimpleName(clazz);
    final String fullName = ReflectionUtilities.getFullName(clazz);
    final String fullArgName = ReflectionUtilities.getFullName(argClazz);
    final String simpleArgName = ReflectionUtilities.getSimpleName(argClazz);


    final NamedParameter namedParameter = clazz.getAnnotation(NamedParameter.class);

    if (namedParameter == null) {
      throw new IllegalStateException("Got name without named parameter post-validation!");
    }
    final boolean hasStringDefault, hasClassDefault, hasStringSetDefault, hasClassSetDefault;

    int defaultCount = 0;
    if (namedParameter.default_value().equals(NamedParameter.REEF_UNINITIALIZED_VALUE)) {
      hasStringDefault = false;
    } else {
      hasStringDefault = true;
      defaultCount++;
    }
    if (namedParameter.default_class() != Void.class) {
      hasClassDefault = true;
      defaultCount++;
    } else {
      hasClassDefault = false;
    }
    if (namedParameter.default_values() != null && namedParameter.default_values().length > 0) {
      hasStringSetDefault = true;
      defaultCount++;
    } else {
      hasStringSetDefault = false;
    }
    if (namedParameter.default_classes() != null && namedParameter.default_classes().length > 0) {
      hasClassSetDefault = true;
      defaultCount++;
    } else {
      hasClassSetDefault = false;
    }
    if (defaultCount > 1) {
      throw new ClassHierarchyException("Named parameter " + fullName +
          " defines more than one of default_value, default_class, default_values and default_classes");
    }

    final String[] defaultInstanceAsStrings;

    if (defaultCount == 0) {
      defaultInstanceAsStrings = new String[]{};
    } else if (hasClassDefault) {
      final Class<?> defaultClass = namedParameter.default_class();
      assertIsSubclassOf(clazz, defaultClass, argClazz);
      defaultInstanceAsStrings = new String[]{ReflectionUtilities.getFullName(defaultClass)};
    } else if (hasStringDefault) {
      // Don't know if the string is a class or literal here, so don't bother validating.
      defaultInstanceAsStrings = new String[]{namedParameter.default_value()};
    } else if (hasClassSetDefault) {
      final Class<?>[] clzs = namedParameter.default_classes();
      defaultInstanceAsStrings = new String[clzs.length];
      for (int i = 0; i < clzs.length; i++) {
        assertIsSubclassOf(clazz, clzs[i], argClazz);
        defaultInstanceAsStrings[i] = ReflectionUtilities.getFullName(clzs[i]);
      }
    } else if (hasStringSetDefault) {
      defaultInstanceAsStrings = namedParameter.default_values();
    } else {
      throw new IllegalStateException("The named parameter " + namedParameter.short_name() + " has a default value,"
              + " but the value cannot be retrieved. The defaultCount is " + defaultCount
              + ", but hasClassDefault, hasStringDefault, hasClassSetDefault, hasStringSetDefault"
              + " conditions are all false");
    }

    final String documentation = namedParameter.doc();

    final String shortName = namedParameter.short_name().isEmpty()
        ? null : namedParameter.short_name();

    return new NamedParameterNodeImpl<>(parent, simpleName, fullName,
        fullArgName, simpleArgName, isSet, isList, documentation, shortName, defaultInstanceAsStrings);
  }
297320
private void createIncompleteKey(Key parent) {
    String kind = entityMetadata.getKind();
    if (parent == null) {
      key = entityManager.newNativeKeyFactory().setKind(kind).newKey();
    } else {
      key = IncompleteKey.newBuilder(parent, kind).build();
    }
  }
131159
protected Element getElement(Object parent, String name) {
		if (name == null) {
			return null;
		}
		String id;
		if (parent == null) {
			id = getRootElement().getId();
		} else {
			id = groupToId.get(parent);
		}
		return Dom.getElementById(Dom.assembleId(id, name));
	}