/** * Constructor only used by core Jackson databind functionality; * should never be called by application code. *<p> * As with other direct construction that by-passes {@link TypeFactory}, * no introspection occurs with respect to super-types; caller must be * aware of consequences if using this method. */ protected SimpleType(Class<?> cls) { this(cls, TypeBindings.emptyBindings(), null, null); }
public PlaceholderForType(int ordinal) { super(Object.class, TypeBindings.emptyBindings(), TypeFactory.unknownType(), null, 1, // super-class, super-interfaces, hashCode null, null, false); // value/type handler, as-static _ordinal = ordinal; }
@Deprecated // since 2.7 public static ReferenceType construct(Class<?> cls, JavaType refType) { return new ReferenceType(cls, TypeBindings.emptyBindings(), // !!! TODO: missing supertypes null, null, null, refType, null, null, false); }
/** * Constructor (only) used for creating primordial simple types (during bootstrapping) * and array type placeholders where no fields or methods are needed. * * @since 2.9 */ AnnotatedClass(Class<?> rawType) { _type = null; _class = rawType; _superTypes = Collections.emptyList(); _primaryMixIn = null; _classAnnotations = AnnotationCollector.emptyAnnotations(); _bindings = TypeBindings.emptyBindings(); _annotationIntrospector = null; _mixInResolver = null; _typeFactory = null; }
throw new IllegalArgumentException("Cannot construct SimpleType for an array (class: "+cls.getName()+")"); TypeBindings b = TypeBindings.emptyBindings(); return new SimpleType(cls, b, _buildSuperClass(cls.getSuperclass(), b), null, null, null, false);
@Deprecated // since 2.7 public static MapType construct(Class<?> rawType, JavaType keyT, JavaType valueT) { // First: may need to fabricate TypeBindings (needed for refining into // concrete collection types, as per [databind#1102]) TypeVariable<?>[] vars = rawType.getTypeParameters(); TypeBindings bindings; if ((vars == null) || (vars.length != 2)) { bindings = TypeBindings.emptyBindings(); } else { bindings = TypeBindings.create(rawType, keyT, valueT); } // !!! TODO: Wrong, does have supertypes return new MapType(rawType, bindings, _bogusSuperClass(rawType), null, keyT, valueT, null, null, false); }
@Deprecated // since 2.7; remove from 2.8 public static MapLikeType construct(Class<?> rawType, JavaType keyT, JavaType valueT) { // First: may need to fabricate TypeBindings (needed for refining into // concrete collection types, as per [databind#1102]) TypeVariable<?>[] vars = rawType.getTypeParameters(); TypeBindings bindings; if ((vars == null) || (vars.length != 2)) { bindings = TypeBindings.emptyBindings(); } else { bindings = TypeBindings.create(rawType, keyT, valueT); } return new MapLikeType(rawType, bindings, _bogusSuperClass(rawType), null, keyT, valueT, null, null, false); }
/** * @deprecated Since 2.7, remove from 2.9 */ @Deprecated // since 2.7 public static CollectionType construct(Class<?> rawType, JavaType elemT) { // First: may need to fabricate TypeBindings (needed for refining into // concrete collection types, as per [databind#1102]) TypeVariable<?>[] vars = rawType.getTypeParameters(); TypeBindings bindings; if ((vars == null) || (vars.length != 1)) { bindings = TypeBindings.emptyBindings(); } else { bindings = TypeBindings.create(rawType, elemT); } return new CollectionType(rawType, bindings, // !!! TODO: Wrong, does have supertypes, but: _bogusSuperClass(rawType), null, elemT, null, null, false); }
/** * @deprecated Since 2.7, use {@link #upgradeFrom} for constructing instances, given * pre-resolved {@link SimpleType}. */ @Deprecated // since 2.7 public static CollectionLikeType construct(Class<?> rawType, JavaType elemT) { // First: may need to fabricate TypeBindings (needed for refining into // concrete collection types, as per [databind#1102]) TypeVariable<?>[] vars = rawType.getTypeParameters(); TypeBindings bindings; if ((vars == null) || (vars.length != 1)) { bindings = TypeBindings.emptyBindings(); } else { bindings = TypeBindings.create(rawType, elemT); } return new CollectionLikeType(rawType, bindings, _bogusSuperClass(rawType), null, elemT, null, null, false); }
AnnotatedClassResolver(MapperConfig<?> config, Class<?> cls, MixInResolver r) { _config = config; _type = null; _class = cls; _mixInResolver = r; _bindings = TypeBindings.emptyBindings(); if (config == null) { _intr = null; _primaryMixin = null; } else { _intr = config.isAnnotationProcessingEnabled() ? config.getAnnotationIntrospector() : null; _primaryMixin = _config.findMixInClassFor(_class); } }
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)) { List<JavaType> parameterTypes = parseTypes(tokens); TypeBindings b = TypeBindings.create(base, parameterTypes); return _factory._fromClass(null, base, b); } // can be comma that separates types, or closing '>' tokens.pushBack(token); } return _factory._fromClass(null, base, TypeBindings.emptyBindings()); }
public CtTypeJavaType(CtType type) { super(CtTypeJavaType.class, TypeBindings.emptyBindings(), null, null, type == null ? 0 : type.getGenericSignature().hashCode(), null, null, false); this.type = type; }
/** * Constructor only used by core Jackson databind functionality; * should never be called by application code. *<p> * As with other direct construction that by-passes {@link TypeFactory}, * no introspection occurs with respect to super-types; caller must be * aware of consequences if using this method. */ protected SimpleType(Class<?> cls) { this(cls, TypeBindings.emptyBindings(), null, null); }
/** * Constructor only used by core Jackson databind functionality; * should never be called by application code. *<p> * As with other direct construction that by-passes {@link TypeFactory}, * no introspection occurs with respect to super-types; caller must be * aware of consequences if using this method. */ protected SimpleType(Class<?> cls) { this(cls, TypeBindings.emptyBindings(), null, null); }
@Deprecated // since 2.7 public static ReferenceType construct(Class<?> cls, JavaType refType) { return new ReferenceType(cls, TypeBindings.emptyBindings(), // !!! TODO: missing supertypes null, null, null, refType, null, null, false); }
public PlaceholderForType(int ordinal) { super(Object.class, TypeBindings.emptyBindings(), TypeFactory.unknownType(), null, 1, // super-class, super-interfaces, hashCode null, null, false); // value/type handler, as-static _ordinal = ordinal; }
@Deprecated // since 2.7 public static ReferenceType construct(Class<?> cls, JavaType refType) { return new ReferenceType(cls, TypeBindings.emptyBindings(), // !!! TODO: missing supertypes null, null, null, refType, null, null, false); }
public CtTypeJavaType(CtType type) { super(CtTypeJavaType.class, TypeBindings.emptyBindings(), null, null, type == null ? 0 : type.getGenericSignature().hashCode(), null, null, false); this.type = type; }
public static AnnotatedClass constructWithoutSuperTypes(Class<?> cls, MapperConfig<?> config, MixInResolver mir) { if (config == null) { return new AnnotatedClass(null, cls, TypeBindings.emptyBindings(), Collections.<JavaType>emptyList(), null, null, null); } AnnotationIntrospector intr = config.isAnnotationProcessingEnabled() ? config.getAnnotationIntrospector() : null; return new AnnotatedClass(null, cls, TypeBindings.emptyBindings(), Collections.<JavaType>emptyList(), intr, mir, config.getTypeFactory()); }
@Deprecated // since 2.7 public static MapType construct(Class<?> rawType, JavaType keyT, JavaType valueT) { // First: may need to fabricate TypeBindings (needed for refining into // concrete collection types, as per [databind#1102]) TypeVariable<?>[] vars = rawType.getTypeParameters(); TypeBindings bindings; if ((vars == null) || (vars.length != 2)) { bindings = TypeBindings.emptyBindings(); } else { bindings = TypeBindings.create(rawType, keyT, valueT); } // !!! TODO: Wrong, does have supertypes return new MapType(rawType, bindings, _bogusSuperClass(rawType), null, keyT, valueT, null, null, false); }