Sha256: a5433b80237a4b0992140f4b43b5b7291ccba08e843243ddf67df19e50ee16e6

Contents?: true

Size: 1.5 KB

Versions: 164

Compression:

Stored size: 1.5 KB

Contents

package sh.calaba.org.codehaus.jackson.map.module;

import java.util.HashMap;

import sh.calaba.org.codehaus.jackson.map.BeanDescription;
import sh.calaba.org.codehaus.jackson.map.DeserializationConfig;
import sh.calaba.org.codehaus.jackson.map.deser.ValueInstantiator;
import sh.calaba.org.codehaus.jackson.map.deser.ValueInstantiators;
import sh.calaba.org.codehaus.jackson.map.type.ClassKey;

public class SimpleValueInstantiators
    extends ValueInstantiators.Base
{
    /**
     * Mappings from raw (type-erased, i.e. non-generic) types
     * to matching {@link ValueInstantiator} instances.
     */
    protected HashMap<ClassKey,ValueInstantiator> _classMappings;

    /*
    /**********************************************************
    /* Life-cycle, construction and configuring
    /**********************************************************
     */

    public SimpleValueInstantiators()
    {
        _classMappings = new HashMap<ClassKey,ValueInstantiator>();        
    }
    
    public SimpleValueInstantiators addValueInstantiator(Class<?> forType,
            ValueInstantiator inst)
    {
        _classMappings.put(new ClassKey(forType), inst);
        return this;
    }
    
    @Override
    public ValueInstantiator findValueInstantiator(DeserializationConfig config,
            BeanDescription beanDesc, ValueInstantiator defaultInstantiator)
    {
        ValueInstantiator inst = _classMappings.get(new ClassKey(beanDesc.getBeanClass()));
        return (inst == null) ? defaultInstantiator : inst;
    }
}

Version data entries

164 entries across 164 versions & 2 rubygems

Version Path
calabash-android-0.4.0.pre4 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleValueInstantiators.java
calabash-android-0.4.0.pre3 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleValueInstantiators.java
testautoa-0.4.0 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleValueInstantiators.java
calabash-android-0.4.0.pre2 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleValueInstantiators.java
calabash-android-0.4.0.pre1 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleValueInstantiators.java
calabash-android-0.3.8 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleValueInstantiators.java
calabash-android-0.3.7 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleValueInstantiators.java
calabash-android-0.3.6 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleValueInstantiators.java
calabash-android-0.3.5 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleValueInstantiators.java
calabash-android-0.3.4 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleValueInstantiators.java
calabash-android-0.3.3 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleValueInstantiators.java
calabash-android-0.3.3.pre5 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleValueInstantiators.java
calabash-android-0.3.3.pre3 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleValueInstantiators.java
calabash-android-0.3.3.pre2 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleValueInstantiators.java
calabash-android-0.3.3.pre1 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleValueInstantiators.java
calabash-android-0.3.2 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleValueInstantiators.java
calabash-android-0.3.2.pre5 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleValueInstantiators.java
calabash-android-0.3.2.pre4 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleValueInstantiators.java
calabash-android-0.3.2.pre3 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleValueInstantiators.java
calabash-android-0.3.2.pre2 test-server/instrumentation-backend/src/sh/calaba/org/codehaus/jackson/map/module/SimpleValueInstantiators.java