Initializes the type given the string value of the type.<p>

@param type a string representation of the type

@return the actual type object
1803
private static I_Loader initLoader(String type) {

        if (TYPE_PROPERTIES.equals(type)) {
            return new CmsVfsBundleLoaderProperties();
        } else if (TYPE_XML.equals(type)) {
            return new CmsVfsBundleLoaderXml();
        } else {
            return new CmsVfsBundleLoaderXml();
        }
    }
1073042
public static <S> ClassTypeInformation<S> from(Class<S> type) {

        LettuceAssert.notNull(type, "Type must not be null!");

        Reference<ClassTypeInformation<?>> cachedReference = CACHE.get(type);
        TypeInformation<?> cachedTypeInfo = cachedReference == null ? null : cachedReference.get();

        if (cachedTypeInfo != null) {
            return (ClassTypeInformation<S>) cachedTypeInfo;
        }

        ClassTypeInformation<S> result = new ClassTypeInformation<S>(type);
        CACHE.put(type, new WeakReference<ClassTypeInformation<?>>(result));
        return result;
    }
161519
public void setType(Type type) {
        Type actual = Type.preserveType(this.getType(), type);

        mConversions.clear();
        mExceptionPossible = false;
        if (actual != null) {
            // Prefer cast for initial type for correct operation of
            // setInitialType if a conversion needs to be inserted at the
            // beginning.
            mConversions.add(new Conversion(null, actual, true));
        }
    }
179589
public static String print(Type type) {
        return type.match(new Type.MatchBlock<String>(){
            @Override
            public String _case(Ref x) {
                return print(x.type);
            }

            @Override
            public String _case(Primitive x) {
                return print(x.type);
            }
            
        });
    }
1031020
public static <T> T newInstance(Class<T> type) {
        try {
            return type.newInstance();
        } catch (InstantiationException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }
1368372
private static String createTypeId(Type type) {
        if (type instanceof Class<?>) {
            return Reflections.<Class<?>> cast(type).getName();
        }
        if (type instanceof ParameterizedType) {
            ParameterizedType parameterizedType = (ParameterizedType) type;
            StringBuilder builder = new StringBuilder();
            builder.append(createTypeId(parameterizedType.getRawType()));
            builder.append("<");
            for (int i = 0; i < parameterizedType.getActualTypeArguments().length; i++) {
                builder.append(createTypeId(parameterizedType.getActualTypeArguments()[i]));
                if (i != parameterizedType.getActualTypeArguments().length - 1) {
                    builder.append(",");
                }
            }
            builder.append(">");
            return builder.toString();
        }
        if (type instanceof TypeVariable<?>) {
            return Reflections.<TypeVariable<?>> cast(type).getName();
        }
        if (type instanceof GenericArrayType) {
            return createTypeId(Reflections.<GenericArrayType> cast(type).getGenericComponentType());
        }
        throw new java.lang.IllegalArgumentException("Unknown type " + type);
    }
1368565
public Tree setType(Class<?> type) {
		if (value == null || value.getClass() == type) {
			return this;
		}
		value = DataConverterRegistry.convert(type, value);
		if (parent != null && key != null) {
			if (key instanceof String) {
				parent.putObjectInternal((String) key, value, false);
			} else {
				parent.remove((int) key);
				parent.insertObjectInternal((int) key, value);
			}
		}
		return this;
	}
687257
public JWTHeader setType(String type) {
        this.type = type;
        this.put(HeaderConstants.TYPE, type);
        return this;
    }
846715
@Api
	public void setMapType(MapType type) {
		this.type = type;
		if (googleMap != null) {
			setMapType(googleMap, type.toString());
		}
	}
242162
public static Object valueOf(Class<?> type, String value) {
		try {
			if (type.equals(java.lang.String.class)) {
				return value;
			}

			Method m = class2Value.get(type);
			if (m != null) {
				return m.invoke(null, value);
			}

			if (type.equals(java.lang.Character.TYPE)
					|| type.equals(java.lang.Character.class)) {
				return new Character(value.charAt(0));
			}

			Constructor<?> c = type.getConstructor(java.lang.String.class);
			return c.newInstance(value);
		} catch (NoSuchMethodException | InstantiationException | IllegalAccessException e) {
			// LogSupport.ignore(log,e);
		} catch (InvocationTargetException e) {
			if (e.getTargetException() instanceof Error) {
				throw (Error) (e.getTargetException());
			}
		}
		return null;
	}
1043753
public void addType(I_CmsXmlSchemaType type) throws CmsXmlException {

        // check if the type to add actually exists in the type manager
        CmsXmlContentTypeManager typeManager = OpenCms.getXmlContentTypeManager();
        if (type.isSimpleType() && (typeManager.getContentType(type.getTypeName()) == null)) {
            throw new CmsXmlException(Messages.get().container(Messages.ERR_UNREGISTERED_TYPE_1, type.getTypeName()));
        }

        // add the type to the internal type sequence and lookup table
        m_typeSequence.add(type);
        m_types.put(type.getName(), type);

        // store reference to the content definition in the type
        type.setContentDefinition(this);
    }
463720
public void setType(String type) {
    if(StringUtils.isBlank(type)) {
      setType(TYPE.UNSET);
    }
    else {
      if(TYPE.NEGATIVE.toString().equalsIgnoreCase(type.trim())) {
        setType(TYPE.NEGATIVE);
      }
      if(TYPE.NEUTRAL.toString().equalsIgnoreCase(type.trim())) {
        setType(TYPE.NEUTRAL);
      }
      if(TYPE.POSITIVE.toString().equalsIgnoreCase(type.trim())) {
        setType(TYPE.POSITIVE);
      }
      if(TYPE.UNSET.toString().equalsIgnoreCase(type.trim())) {
        setType(TYPE.UNSET);
      }
    }
  }
636657
private void setType(String type) {
        requireArgument(type != null && !type.trim().isEmpty(), "Type cannot be null or empty.");
        _type = type;
    }
595448
public void setType(java.util.Collection<StringFilter> type) {
        if (type == null) {
            this.type = null;
            return;
        }

        this.type = new java.util.ArrayList<StringFilter>(type);
    }
739869
public static Object getPrimitiveDefaultValue(final Class<?> type) {
        ArgUtils.notNull(type, "type");

        if(!type.isPrimitive()) {
            return null;
        }

        if(type.equals(boolean.class)) {
            return false;

        } else if(type.equals(char.class)) {
            return '\u0000';

        } else if(type.equals(byte.class)) {
            return (byte)0;

        } else if(type.equals(short.class)) {
            return (short)0;

        } else if(type.equals(int.class)) {
            return 0;

        } else if(type.equals(long.class)) {
            return 0l;

        } else if(type.equals(float.class)) {
            return 0.0f;

        } else if(type.equals(double.class)) {
            return 0.0d;

        }

        return null;
    }
526899
public void setType(String type) throws ApplicationException {
	type = type.toLowerCase().trim();
	if (type.equals("string")) this.type = RegistryEntry.TYPE_STRING;
	else if (type.equals("dword")) this.type = RegistryEntry.TYPE_DWORD;
	else if (type.equals("key")) this.type = RegistryEntry.TYPE_KEY;
	else if (type.equals("any")) this.type = RegistryEntry.TYPE_ANY;
	else throw new ApplicationException("attribute type of the tag registry has an invalid value [" + type + "], valid values are [string, dword]");
    }
539712
@SuppressWarnings("unchecked")
    public static Object defaultValue(Type type) {
        Validate.argumentIsNotNull(type);

        return DEFAULTS.get(type);
    }