Examples of TypeFactory


Examples of com.caucho.config.type.TypeFactory

   * Sets the type of the connector using known types.
   */
  public void setURI(String url)
    throws Exception
  {
    TypeFactory factory = TypeFactory.create();
   
    Class type = factory.getDriverClassByUrl(ResourceAdapter.class, url);

    setClass(type.getName());

    ContainerProgram program = factory.getUrlProgram(url);

    if (program == null) {
    }
    else if (_init == null)
      _init = program;
View Full Code Here

Examples of com.facebook.presto.hive.shaded.org.codehaus.jackson.map.type.TypeFactory

                mapper._deserializerProvider = mapper._deserializerProvider.withAbstractTypeResolver(resolver);
            }

            //@Override
            public void addTypeModifier(TypeModifier modifier) {
                TypeFactory f = mapper._typeFactory;
                f = f.withModifier(modifier);
                mapper.setTypeFactory(f);
            }

            //@Override
            public void addValueInstantiators(ValueInstantiators instantiators) {
View Full Code Here

Examples of com.facebook.presto.jdbc.internal.jackson.databind.type.TypeFactory

        }
       
        // [JACKSON-283]: AtomicReference is a rather special type...
        if (AtomicReference.class.isAssignableFrom(cls)) {
            // Must find parameterization
            TypeFactory tf = config.getTypeFactory();
            JavaType[] params = tf.findTypeParameters(type, AtomicReference.class);
            JavaType referencedType;
            if (params == null || params.length < 1) { // untyped (raw)
                referencedType = TypeFactory.unknownType();
            } else {
                referencedType = params[0];
View Full Code Here

Examples of com.facebook.presto.jdbc.internal.jackson.databind.type.TypeFactory

    // @Override
    public JsonSerializer<?> createContextual(SerializerProvider provider, BeanProperty property)
        throws JsonMappingException
    {
        // First: figure out what is the fully generic delegate type:
        TypeFactory tf = provider.getTypeFactory();
        JavaType implType = tf.constructType(_converter.getClass());
        JavaType[] params = tf.findTypeParameters(implType, Converter.class);
        if (params == null || params.length != 2) {
            throw new JsonMappingException("Could not determine Converter parameterization for "
                    +implType);
        }
        // and then we can find serializer to delegate to, construct a new instance:
View Full Code Here

Examples of com.facebook.presto.jdbc.internal.jackson.databind.type.TypeFactory

    public JsonDeserializer<?> createContextual(DeserializationContext ctxt, BeanProperty property)
        throws JsonMappingException
    {
        // First: figure out what is the fully generic delegate type:
        TypeFactory tf = ctxt.getTypeFactory();
        JavaType implType = tf.constructType(_converter.getClass());
        JavaType[] params = tf.findTypeParameters(implType, Converter.class);
        if (params == null || params.length != 2) {
            throw new JsonMappingException("Could not determine Converter parameterization for "
                    +implType);
        }
        // and then we can find serializer to delegate to, construct a new instance:
View Full Code Here

Examples of com.fasterxml.jackson.databind.type.TypeFactory

    List<String> packages = Lists.newArrayList();
    packages.add("org.platformlayer.xaas.web.jaxrs");
    packages.add("org.platformlayer.xaas.web.resources");
    // packages.add("org.codehaus.jackson.jaxrs");

    TypeFactory typeFactory = TypeFactory.defaultInstance();
    ObjectMapper objectMapper = JsonHelper.buildObjectMapper(typeFactory, false);

    // TypeResolverBuilder<?> typer = new PlatformLayerTypeResolverBuilder();
    // TypeIdResolver typeIdResolver = new PlatformLayerTypeIdResolver(null, typeFactory);
    // this.requestInjection(typeIdResolver);
View Full Code Here

Examples of com.fasterxml.jackson.databind.type.TypeFactory

       
        Class<?> cls = type.getRawClass();
        // [JACKSON-283]: AtomicReference is a rather special type...
        if (AtomicReference.class.isAssignableFrom(cls)) {
            // Must find parameterization
            TypeFactory tf = ctxt.getTypeFactory();
            JavaType[] params = tf.findTypeParameters(type, AtomicReference.class);
            JavaType referencedType;
            if (params == null || params.length < 1) { // untyped (raw)
                referencedType = TypeFactory.unknownType();
            } else {
                referencedType = params[0];
View Full Code Here

Examples of com.fasterxml.jackson.databind.type.TypeFactory

    public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)
        throws JsonMappingException
    {
        JsonArrayFormatVisitor arrayVisitor = (visitor == null) ? null : visitor.expectArrayFormat(typeHint);
        if (arrayVisitor != null) {
            TypeFactory tf = visitor.getProvider().getTypeFactory();
            JavaType contentType = tf.moreSpecificType(_elementType, typeHint.getContentType());
            if (contentType == null) {
                throw new JsonMappingException("Could not resolve type");
            }
            JsonSerializer<?> valueSer = _elementSerializer;
            if (valueSer == null) {
View Full Code Here

Examples of com.fasterxml.jackson.databind.type.TypeFactory

  public String detectType(Object object) {
    return constructType(object).toCanonical();
  }
 
  protected JavaType constructType(Object object) {
    TypeFactory typeFactory = TypeFactory.defaultInstance();
   
    if (object instanceof List && !((List<?>) object).isEmpty()) {
      List<?> list = (List<?>) object;
      Object firstElement = list.get(0);
      return typeFactory.constructCollectionType(list.getClass(), constructType(firstElement));

    } else {
      return typeFactory.constructType(object.getClass());
    }
  }
View Full Code Here

Examples of com.fasterxml.jackson.databind.type.TypeFactory

       
        Class<?> cls = type.getRawClass();
        // [JACKSON-283]: AtomicReference is a rather special type...
        if (AtomicReference.class.isAssignableFrom(cls)) {
            // Must find parameterization
            TypeFactory tf = ctxt.getTypeFactory();
            JavaType[] params = tf.findTypeParameters(type, AtomicReference.class);
            JavaType referencedType;
            if (params == null || params.length < 1) { // untyped (raw)
                referencedType = TypeFactory.unknownType();
            } else {
                referencedType = params[0];
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.