/** * Factory method that can be used if only type information * available is of type {@link Class}. This means that there * will not be generic type information due to type erasure, * but at least it will be possible to recognize array * types and non-typed container types. * And for other types (primitives/wrappers, beans), this * is all that is needed. * * @deprecated Use {@link #type(Type)} instead */ @Deprecated public static JavaType fromClass(Class<?> clz) { return instance._fromClass(clz, null); }
/** * Factory method for constructing {@link JavaType} that * represents a parameterized type. For example, to represent * type <code>List<Set<Integer>></code>, you could * call *<pre> * TypeFactory.parametricType(List.class, Integer.class); *</pre> *<p> * NOTE: type modifiers are NOT called on constructed type itself; but are called * for contained types. * * @since 1.5 */ public JavaType constructParametricType(Class<?> parametrized, Class<?>... parameterClasses) { int len = parameterClasses.length; JavaType[] pt = new JavaType[len]; for (int i = 0; i < len; ++i) { pt[i] = _fromClass(parameterClasses[i], null); } return constructParametricType(parametrized, pt); }
JavaType subtype = _fromClass(subclass, new TypeBindings(this, baseType.getRawClass()));
context = new TypeBindings(this, cls); resultType = _fromClass(cls, context);
protected JavaType parseType(MyTokenizer tokens) throws IllegalArgumentException { if (!tokens.hasMoreTokens()) { throw _problem(tokens, "Unexpected end-of-string"); } Class<?> base = findClass(tokens.nextToken(), tokens); // either end (ok, non generic type), or generics if (tokens.hasMoreTokens()) { String token = tokens.nextToken(); if ("<".equals(token)) { return _factory._fromParameterizedClass(base, parseTypes(tokens)); } // can be comma that separates types, or closing '>' tokens.pushBack(token); } return _factory._fromClass(base, null); }
/** * Factory method that can be used if only type information * available is of type {@link Class}. This means that there * will not be generic type information due to type erasure, * but at least it will be possible to recognize array * types and non-typed container types. * And for other types (primitives/wrappers, beans), this * is all that is needed. * * @deprecated Use {@link #type(Type)} instead */ @Deprecated public static JavaType fromClass(Class<?> clz) { return instance._fromClass(clz, null); }
/** * Factory method for constructing {@link JavaType} that * represents a parameterized type. For example, to represent * type <code>List<Set<Integer>></code>, you could * call *<pre> * TypeFactory.parametricType(List.class, Integer.class); *</pre> *<p> * NOTE: type modifiers are NOT called on constructed type itself; but are called * for contained types. * * @since 1.5 */ public JavaType constructParametricType(Class<?> parametrized, Class<?>... parameterClasses) { int len = parameterClasses.length; JavaType[] pt = new JavaType[len]; for (int i = 0; i < len; ++i) { pt[i] = _fromClass(parameterClasses[i], null); } return constructParametricType(parametrized, pt); }
JavaType subtype = _fromClass(subclass, new TypeBindings(this, baseType.getRawClass()));
context = new TypeBindings(this, cls); resultType = _fromClass(cls, context);
protected JavaType parseType(MyTokenizer tokens) throws IllegalArgumentException { if (!tokens.hasMoreTokens()) { throw _problem(tokens, "Unexpected end-of-string"); } Class<?> base = findClass(tokens.nextToken(), tokens); // either end (ok, non generic type), or generics if (tokens.hasMoreTokens()) { String token = tokens.nextToken(); if ("<".equals(token)) { return _factory._fromParameterizedClass(base, parseTypes(tokens)); } // can be comma that separates types, or closing '>' tokens.pushBack(token); } return _factory._fromClass(base, null); }
protected JavaType _unknownType() { return _fromClass(Object.class, null); } }
/** * Factory method that can be used if only type information * available is of type {@link Class}. This means that there * will not be generic type information due to type erasure, * but at least it will be possible to recognize array * types and non-typed container types. * And for other types (primitives/wrappers, beans), this * is all that is needed. * * @deprecated Use {@link #type(Type)} instead */ public static JavaType fromClass(Class<?> clz) { return instance._fromClass(clz, null); }
/** * Factory method that can be used if only type information * available is of type {@link Class}. This means that there * will not be generic type information due to type erasure, * but at least it will be possible to recognize array * types and non-typed container types. * And for other types (primitives/wrappers, beans), this * is all that is needed. * * @deprecated Use {@link #type(Type)} instead */ @Deprecated public static JavaType fromClass(Class<?> clz) { return instance._fromClass(clz, null); }
/** * Factory method that can be used if only type information * available is of type {@link Class}. This means that there * will not be generic type information due to type erasure, * but at least it will be possible to recognize array * types and non-typed container types. * And for other types (primitives/wrappers, beans), this * is all that is needed. * * @deprecated Use {@link #type(Type)} instead */ @Deprecated public static JavaType fromClass(Class<?> clz) { return instance._fromClass(clz, null); }
/** * Factory method that can be used if only type information * available is of type {@link Class}. This means that there * will not be generic type information due to type erasure, * but at least it will be possible to recognize array * types and non-typed container types. * And for other types (primitives/wrappers, beans), this * is all that is needed. * * @deprecated Use {@link #type(Type)} instead */ @Deprecated public static JavaType fromClass(Class<?> clz) { return instance._fromClass(clz, null); }
/** * Factory method for constructing {@link JavaType} that * represents a parameterized type. For example, to represent * type <code>List<Set<Integer>></code>, you could * call *<pre> * TypeFactory.parametricType(List.class, Integer.class); *</pre> *<p> * NOTE: type modifiers are NOT called on constructed type itself; but are called * for contained types. * * @since 1.5 */ public JavaType constructParametricType(Class<?> parametrized, Class<?>... parameterClasses) { int len = parameterClasses.length; JavaType[] pt = new JavaType[len]; for (int i = 0; i < len; ++i) { pt[i] = _fromClass(parameterClasses[i], null); } return constructParametricType(parametrized, pt); }
/** * Factory method for constructing {@link JavaType} that * represents a parameterized type. For example, to represent * type <code>List<Set<Integer>></code>, you could * call *<pre> * TypeFactory.parametricType(List.class, Integer.class); *</pre> *<p> * NOTE: type modifiers are NOT called on constructed type itself; but are called * for contained types. * * @since 1.5 */ public JavaType constructParametricType(Class<?> parametrized, Class<?>... parameterClasses) { int len = parameterClasses.length; JavaType[] pt = new JavaType[len]; for (int i = 0; i < len; ++i) { pt[i] = _fromClass(parameterClasses[i], null); } return constructParametricType(parametrized, pt); }
protected JavaType parseType(MyTokenizer tokens) throws IllegalArgumentException { if (!tokens.hasMoreTokens()) { throw _problem(tokens, "Unexpected end-of-string"); } Class<?> base = findClass(tokens.nextToken(), tokens); // either end (ok, non generic type), or generics if (tokens.hasMoreTokens()) { String token = tokens.nextToken(); if ("<".equals(token)) { return _factory._fromParameterizedClass(base, parseTypes(tokens)); } // can be comma that separates types, or closing '>' tokens.pushBack(token); } return _factory._fromClass(base, null); }
protected JavaType parseType(MyTokenizer tokens) throws IllegalArgumentException { if (!tokens.hasMoreTokens()) { throw _problem(tokens, "Unexpected end-of-string"); } Class<?> base = findClass(tokens.nextToken(), tokens); // either end (ok, non generic type), or generics if (tokens.hasMoreTokens()) { String token = tokens.nextToken(); if ("<".equals(token)) { return _factory._fromParameterizedClass(base, parseTypes(tokens)); } // can be comma that separates types, or closing '>' tokens.pushBack(token); } return _factory._fromClass(base, null); }
protected JavaType parseType(MyTokenizer tokens) throws IllegalArgumentException { if (!tokens.hasMoreTokens()) { throw _problem(tokens, "Unexpected end-of-string"); } Class<?> base = findClass(tokens.nextToken(), tokens); // either end (ok, non generic type), or generics if (tokens.hasMoreTokens()) { String token = tokens.nextToken(); if ("<".equals(token)) { return _factory._fromParameterizedClass(base, parseTypes(tokens)); } // can be comma that separates types, or closing '>' tokens.pushBack(token); } return _factory._fromClass(base, null); }