Create a value descriptor of given type and name and initializes it.

@param type
The class type.
@param name
The name
@param <T>
The type.
@return The initialized descriptor.
500290
private <T extends ValueDescriptor<?>> T createValue(Class<T> type, String name) {
        if (name != null) {
            this.arrayValueDescriptor = null;
        }
        String valueName;
        if (arrayValueDescriptor != null) {
            valueName = "[" + getArrayValue().size() + "]";
        } else {
            valueName = name;
        }
        T valueDescriptor = visitorHelper.getValueDescriptor(type);
        valueDescriptor.setName(valueName);
        return valueDescriptor;
    }
1084495
private TypeDescriptor makeTypeDescriptor(final TypeMirror type) {
    if (type.getKind() != TypeKind.DECLARED) {
      return new TypeDescriptor(type.toString(), ImmutableList.<TypeDescriptor>of());
    }
    final DeclaredType dt = (DeclaredType) type;

    final String plainType = processingEnv.getTypeUtils().erasure(type).toString();
    final List<TypeDescriptor> typeArgumentsList = Lists.newArrayList();
    final List<? extends TypeMirror> typeArguments = dt.getTypeArguments();
    for (final TypeMirror arg : typeArguments) {
      typeArgumentsList.add(makeTypeDescriptor(arg));
    }
    return new TypeDescriptor(plainType, typeArgumentsList);
  }
423740
public static <T> T createInstance(Class<T> type, Object... parameters) {

    // get types for parameters
    Class<?>[] parameterTypes = new Class<?>[parameters.length];
    for (int i = 0; i < parameters.length; i++) {
      Object parameter = parameters[i];
      parameterTypes[i] = parameter.getClass();
    }

    try {
      // create instance
      Constructor<T> constructor = type.getConstructor(parameterTypes);
      return constructor.newInstance(parameters);

    } catch (Exception e) {
      throw new ModelException("Exception while creating an instance of type "+type, e);
    }
  }
697812
@SuppressWarnings({"unchecked"})
    public @Nonnull <T extends Describable<T>,D extends Descriptor<T>> DescriptorExtensionList<T,D> getDescriptorList(Class<T> type) {
        return descriptorLists.computeIfAbsent(type, key -> DescriptorExtensionList.createDescriptorList(this, key));
    }
495145
public static SmartBinder from(Class<?> retType, String name, Class<?> type) {
        return from(Signature.returning(retType).appendArg(name, type));
    }
700365
public ITypeParameterBuilder addTypeParameter(String name) {
		ITypeParameterBuilder builder = this.iTypeParameterBuilderProvider.get();
		final SarlAction object = getSarlAction();
		builder.eInit(object, name, getTypeResolutionContext());
		object.getTypeParameters().add(builder.getJvmTypeParameter());
		return builder;
	}
1076839
public static NamedAttributeType<Object> newNamedUnknownType(final String name, final Type type) {
	return new NamedAttributeType<>(name, new AttributeType<Object>(type) {});
    }
815634
public AnnotationValueBuilder<T> member(String name, @Nullable Class<?>... types) {
        if (types != null) {
            AnnotationClassValue[] classValues = new AnnotationClassValue[types.length];
            for (int i = 0; i < types.length; i++) {
                Class<?> type = types[i];
                classValues[i] = new AnnotationClassValue<>(type);
            }
            values.put(name, classValues);
        }
        return this;
    }
136538
int resolveNameAndTypeIndex(String name, String descriptor)
    {
        int size = 0;
        int index = 0;
        constantReadLock.lock();
        try
        {
            size = getConstantPoolSize();
            index = getNameAndTypeIndex(name, descriptor);
        }
        finally
        {
            constantReadLock.unlock();
        }
        if (index != -1)
        {
            return index;
        }
        else
        {
            int nameIndex = resolveNameIndex(name);
            int typeIndex = resolveNameIndex(descriptor);
            return addConstantInfo(new NameAndType(nameIndex, typeIndex), size);
        }
    }
890318
public static Parameter createParameter(Type type, String name) {
        return new Parameter(type, new VariableDeclaratorId(name));
    }
664074
public NameAndTypeConstant getNameAndType(String name, String type)
  {
    for (int i = 0; i < _entries.size(); i++) {
      ConstantPoolEntry entry = _entries.get(i);

      if (! (entry instanceof NameAndTypeConstant))
        continue;

      NameAndTypeConstant methodEntry = (NameAndTypeConstant) entry;

      if (methodEntry.getName().equals(name) &&
          methodEntry.getType().equals(type))
        return methodEntry;
    }

    return null;
  }
719828
public void addParameter(String name, ParameterType type) {
        parameters.put(name, new Parameter(name, type));
    }
227021
protected Method getGetter(Class type, String name)
    {
        return introspector(type).getGetter( toJavaIdentifierForm(name));
    }
452392
@Override
  public <T> T get(String name, Class<T> type) {
    return this.properties.get(name, type);
  }
756192
public static Object instantiate(String type, ClassLoader classLoader) {
        try {
            return ClassUtils.forName(type, classLoader)
                .flatMap(InstantiationUtils::tryInstantiate)
                .orElseThrow(() -> new InstantiationException("No class found for name: " + type));
        } catch (Throwable e) {
            throw new InstantiationException("Could not instantiate type [" + type + "]: " + e.getMessage(), e);
        }
    }
1137867
public LocalVariable createLocalParameter(String name, TypeDesc type) {
        LocalVariable var = new LocalVariableImpl
            (mLocalVariables.size(), name, type, mNextFixedVariableNumber);
        mLocalVariables.add(var);
        mNextFixedVariableNumber += type.isDoubleWord() ? 2 : 1;
        return var;
    }
1179358
public ITypeParameterBuilder addTypeParameter(String name) {
		ITypeParameterBuilder builder = this.iTypeParameterBuilderProvider.get();
		final SarlClass object = getSarlClass();
		builder.eInit(object, name, getTypeResolutionContext());
		object.getTypeParameters().add(builder.getJvmTypeParameter());
		return builder;
	}