com.google.gson.JsonDeserializationContext

Here are the examples of the java api com.google.gson.JsonDeserializationContext taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

684 Examples 7

19 Source : ItemFormType.java
with MIT License
from TheLMiffy1111

@Override
public IItemFormSettings deserializeSettings(JsonElement jsonElement, JsonDeserializationContext context) {
    return ItemFormSettingsDeserializer.INSTANCE.deserialize(jsonElement, context);
}

19 Source : FluidFormType.java
with MIT License
from TheLMiffy1111

@Override
public IFluidFormSettings deserializeSettings(JsonElement jsonElement, JsonDeserializationContext context) {
    return FluidFormSettingsDeserializer.INSTANCE.deserialize(jsonElement, context);
}

19 Source : ItemFormSettingsDeserializer.java
with MIT License
from TheLMiffy1111

public IItemFormSettings deserialize(JsonElement jsonElement, JsonDeserializationContext context) {
    return deserialize(jsonElement, IItemFormSettings.clreplaced, context);
}

19 Source : GasFormType.java
with MIT License
from TheLMiffy1111

@Override
public IGasFormSettings deserializeSettings(JsonElement jsonElement, JsonDeserializationContext context) {
    return GasFormSettingsDeserializer.INSTANCE.deserialize(jsonElement, context);
}

19 Source : GasFormSettingsDeserializer.java
with MIT License
from TheLMiffy1111

public IGasFormSettings deserialize(JsonElement jsonElement, JsonDeserializationContext context) {
    return deserialize(jsonElement, IGasFormSettings.clreplaced, context);
}

19 Source : BlockFormType.java
with MIT License
from TheLMiffy1111

@Override
public IBlockFormSettings deserializeSettings(JsonElement jsonElement, JsonDeserializationContext context) {
    return BlockFormSettingsDeserializer.INSTANCE.deserialize(jsonElement, context);
}

19 Source : GsonObjectDeserializer.java
with MIT License
from qmetry

@Override
public Object deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
    return read(json);
}

19 Source : GsonDeserializerObjectWrapper.java
with MIT License
from qmetry

@Override
public ObjectWrapper deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
    this.context = context;
    return new ObjectWrapper(read(json, type));
}

19 Source : QuerySerializer.java
with Apache License 2.0
from mitre

@Override
public Query deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException {
    JsonObject root = jsonElement.getAsJsonObject();
    String queryType = JsonUtil.getSingleChildName(root);
    return buildQuery(queryType, root.getAsJsonObject(queryType));
}

19 Source : JsonUtils.java
with GNU General Public License v3.0
from josephworks

public static <T> T deserializeClreplaced(@Nullable JsonElement json, String memberName, JsonDeserializationContext context, Clreplaced<? extends T> adapter) {
    if (json != null) {
        return (T) context.deserialize(json, adapter);
    } else {
        throw new JsonSyntaxException("Missing " + memberName);
    }
}

19 Source : ScarpetJsonDeserializer.java
with MIT License
from gnembon

@Override
public Value deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
    return parseElement(json);
}

19 Source : CdrSerialiser.java
with MIT License
from blu-corner

/**
 * Deserialises the provided JSON object into a Cdr object. This uses {@link #getCdrItem(Object)} to traverse the JSON
 * tree and convert elements to the relevant CdrItem
 *
 * @param json the parse tree.
 * @param typeOfT type of the expected return value.
 * @param context Context for serialization, preplaceded to by Gson internally
 * @return Cdr object parsed from the JSON element
 * @throws JsonParseException when the JSON is not valid and GSON can't handle it
 */
@Override
public Cdr deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) {
    Cdr data = new Cdr(typeOfT.getTypeName());
    if (json.isJsonArray()) {
        deserializeArray(json, data, context);
    } else {
        deserializeObject(json, data, context);
    }
    return data;
}

19 Source : AbstractAdapter.java
with Mozilla Public License 2.0
from blairisme

private void deserializeProperty(Field field, JsonElement json, JsonDeserializationContext context, Object target) {
    if (field != null) {
        Object value = deserializeField(json, context, field);
        writeField(field, target, value);
    }
}

19 Source : AbstractAdapter.java
with Mozilla Public License 2.0
from blairisme

private Set<Object> deserializeSet(JsonArray elements, JsonDeserializationContext context, Field field) {
    List<Object> list = deserializeList(elements, context, field);
    return new HashSet<>(list);
}

18 Source : EnterRandomDimensionFirstTimeCriterion.java
with MIT License
from vampire-studios

public EnterRandomDimensionFirstTimeCriterion.Conditions conditionsFromJson(JsonObject jsonObject, JsonDeserializationContext jsonDeserializationContext) {
    return new EnterRandomDimensionFirstTimeCriterion.Conditions();
}

18 Source : LongpollUpdateAdapter.java
with GNU General Public License v3.0
from umerov1999

private AddMessageUpdate deserializeAddMessageUpdate(JsonArray array, JsonDeserializationContext context) {
    AddMessageUpdate update = new AddMessageUpdate();
    int flags = optInt(array, 2);
    update.message_id = optInt(array, 1);
    update.peer_id = optInt(array, 3);
    update.timestamp = optLong(array, 4);
    update.text = VKStringUtils.unescape(optString(array, 5));
    update.outbox = hasFlag(flags, VKApiMessage.FLAG_OUTBOX);
    update.unread = hasFlag(flags, VKApiMessage.FLAG_UNREAD);
    update.important = hasFlag(flags, VKApiMessage.FLAG_IMPORTANT);
    update.deleted = hasFlag(flags, VKApiMessage.FLAG_DELETED);
    JsonObject extra = (JsonObject) opt(array, 6);
    if (nonNull(extra)) {
        update.from = optInt(extra, "from");
        update.sourceText = optString(extra, "source_text");
        update.sourceAct = optString(extra, "source_act");
        update.sourceMid = optInt(extra, "source_mid");
        update.payload = optString(extra, "payload");
        if (extra.has("keyboard")) {
            update.keyboard = context.deserialize(extra.get("keyboard"), VkApiConversation.CurrentKeyboard.clreplaced);
        }
    }
    JsonObject attachments = (JsonObject) opt(array, 7);
    if (nonNull(attachments)) {
        update.hasMedia = attachments.has("attach1_type");
        String fwd = optString(attachments, "fwd");
        String reply = optString(attachments, "reply");
        if (nonEmpty(fwd)) {
            update.fwds = parseLineWithSeparators(fwd, ",");
        }
        if (nonEmpty(reply)) {
            update.reply = reply;
        }
    }
    // ok
    update.random_id = optString(array, 8);
    update.edit_time = optLong(array, 10);
    if (update.from == 0 && !Peer.isGroupChat(update.peer_id) && !update.outbox) {
        update.from = update.peer_id;
    }
    return update.message_id != 0 ? update : null;
}

18 Source : LongpollUpdateAdapter.java
with GNU General Public License v3.0
from umerov1999

@Override
public AbsLongpollEvent deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
    JsonArray array = json.getAsJsonArray();
    int action = array.get(0).getAsInt();
    return deserialize(action, array, context);
}

18 Source : JsonHelper.java
with MIT License
from TheLMiffy1111

@Override
public <T> T deserializeType(JsonObject json, String memberName, JsonDeserializationContext context, Type typeOfT) {
    if (json.has(memberName)) {
        return deserializeType(json.get(memberName), memberName, context, typeOfT);
    } else {
        throw new JsonSyntaxException("Missing " + memberName);
    }
}

18 Source : JsonHelper.java
with MIT License
from TheLMiffy1111

@Override
public <T> T deserializeType(JsonElement json, String memberName, JsonDeserializationContext context, Type typeOfT) {
    if (json != null) {
        return context.deserialize(json, typeOfT);
    } else {
        throw new JsonSyntaxException("Missing " + memberName);
    }
}

18 Source : JsonHelper.java
with MIT License
from TheLMiffy1111

@Override
public <T> T deserializeType(JsonObject json, String memberName, T fallback, JsonDeserializationContext context, Type typeOfT) {
    return (T) (json.has(memberName) ? deserializeType(json.get(memberName), memberName, context, typeOfT) : fallback);
}

18 Source : FluidFormSettingsDeserializer.java
with MIT License
from TheLMiffy1111

public IFluidFormSettings deserialize(JsonElement jsonElement, JsonDeserializationContext context) {
    return deserialize(jsonElement, IFluidFormSettings.clreplaced, context);
}

18 Source : BlockFormSettingsDeserializer.java
with MIT License
from TheLMiffy1111

public IBlockFormSettings deserialize(JsonElement jsonElement, JsonDeserializationContext context) {
    return deserialize(jsonElement, IBlockFormSettings.clreplaced, context);
}

18 Source : JsonUtils.java
with GNU General Public License v3.0
from sudofox

public static <T> T deserializeClreplaced(@Nullable JsonElement json, String memberName, JsonDeserializationContext context, Clreplaced<? extends T> adapter) {
    if (json != null) {
        return context.deserialize(json, adapter);
    } else {
        throw new JsonSyntaxException("Missing " + memberName);
    }
}

18 Source : JsonUtils.java
with GNU General Public License v3.0
from sudofox

public static <T> T deserializeClreplaced(JsonObject json, String memberName, JsonDeserializationContext context, Clreplaced<? extends T> adapter) {
    if (json.has(memberName)) {
        return deserializeClreplaced(json.get(memberName), memberName, context, adapter);
    } else {
        throw new JsonSyntaxException("Missing " + memberName);
    }
}

18 Source : JsonUtils.java
with GNU General Public License v3.0
from sudofox

public static <T> T deserializeClreplaced(JsonObject json, String memberName, T fallback, JsonDeserializationContext context, Clreplaced<? extends T> adapter) {
    return (T) (json.has(memberName) ? deserializeClreplaced(json.get(memberName), memberName, context, adapter) : fallback);
}

18 Source : SerializationHelpers.java
with GNU General Public License v2.0
from saalfeldlab

public static <T> T deserializeFromClreplacedInfo(final JsonObject map, final JsonDeserializationContext context) throws ClreplacedNotFoundException {
    return deserializeFromClreplacedInfo(map, context, TYPE_KEY, DATA_KEY);
}

18 Source : N5IdServiceAdapter.java
with GNU General Public License v2.0
from saalfeldlab

@Override
public N5IdService deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext context) throws JsonParseException {
    try {
        final N5Meta meta = SerializationHelpers.deserializeFromClreplacedInfo(jsonElement.getAsJsonObject().get(N5_META_KEY).getAsJsonObject(), context);
        return (N5IdService) N5Helpers.idService(meta.writer(), meta.dataset());
    } catch (ClreplacedNotFoundException | IOException | N5Helpers.MaxIDNotSpecified e) {
        throw new JsonParseException(e);
    }
}

18 Source : N5FragmentSegmentAssignmentPersisterSerializer.java
with GNU General Public License v2.0
from saalfeldlab

@Override
public N5FragmentSegmentreplacedignmentPersister deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext context) throws JsonParseException {
    try {
        final N5Meta meta = SerializationHelpers.deserializeFromClreplacedInfo(jsonElement.getAsJsonObject().get(N5_META_KEY).getAsJsonObject(), context);
        return new N5FragmentSegmentreplacedignmentPersister(meta.writer(), meta.dataset());
    } catch (ClreplacedNotFoundException | IOException e) {
        throw new JsonParseException(e);
    }
}

18 Source : N5FragmentSegmentAssignmentInitialLutSerializer.java
with GNU General Public License v2.0
from saalfeldlab

@Override
public N5FragmentSegmentreplacedignmentInitialLut deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext context) throws JsonParseException {
    try {
        final N5Meta meta = SerializationHelpers.deserializeFromClreplacedInfo(jsonElement.getAsJsonObject().get(N5_META_KEY).getAsJsonObject(), context);
        return new N5FragmentSegmentreplacedignmentInitialLut(meta);
    } catch (ClreplacedNotFoundException e) {
        throw new JsonParseException(e);
    }
}

18 Source : FragmentSegmentAssignmentOnlyLocalSerializer.java
with GNU General Public License v2.0
from saalfeldlab

private static Supplier<TLongLongMap> tryDeserializeInitialLutSupplier(final JsonObject map, final JsonDeserializationContext context) {
    try {
        return SerializationHelpers.deserializeFromClreplacedInfo(map, context);
    } catch (ClreplacedNotFoundException e) {
        throw new JsonParseException("Unable to deserialize initial lut supplier", e);
    }
}

18 Source : GsonDeserializerObjectWrapper.java
with MIT License
from qmetry

/**
 * @author chirag.jayswal
 */
public clreplaced GsonDeserializerObjectWrapper implements JsonDeserializer<ObjectWrapper> {

    JsonDeserializationContext context;

    private Type type;

    public GsonDeserializerObjectWrapper(Type type) {
        this.type = type;
    }

    public void setType(Type type) {
        this.type = type;
    }

    @Override
    public ObjectWrapper deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
        this.context = context;
        return new ObjectWrapper(read(json, type));
    }

    private Object read(JsonElement in, Type typeOfT) {
        if (in.isJsonArray()) {
            JsonArray arr = in.getAsJsonArray();
            boolean isArray = isArray(typeOfT);
            Collection<Object> list = isArray ? new ArrayList<Object>() : context.deserialize(new JsonArray(0), typeOfT);
            for (JsonElement anArr : arr) {
                ((Collection<Object>) list).add(read(anArr, getTypeArguments(typeOfT, 0)));
            }
            if (isArray) {
                return toArray((List<Object>) list);
            }
            try {
                return ClreplacedUtil.getClreplaced(typeOfT).cast(list);
            } catch (Exception e) {
                return context.deserialize(in, typeOfT);
            }
        } else if (in.isJsonObject() && (isreplacedignableFrom(typeOfT, Map.clreplaced) || ClreplacedUtil.getClreplaced(typeOfT).equals(Object.clreplaced))) {
            // new LinkedTreeMap<Object, Object>();
            Map<Object, Object> map = context.deserialize(new JsonObject(), typeOfT);
            JsonObject obj = in.getAsJsonObject();
            Set<Map.Entry<String, JsonElement>> enreplacedySet = obj.entrySet();
            for (Map.Entry<String, JsonElement> entry : enreplacedySet) {
                map.put(entry.getKey(), read(entry.getValue(), getTypeArguments(typeOfT, 1)));
            }
            return map;
        } else if (in.isJsonPrimitive() && ClreplacedUtil.getClreplaced(typeOfT).equals(Object.clreplaced)) {
            JsonPrimitive prim = in.getAsJsonPrimitive();
            if (prim.isBoolean()) {
                return prim.getAsBoolean();
            } else if (prim.isString()) {
                return prim.getreplacedtring();
            } else if (prim.isNumber()) {
                if (prim.getreplacedtring().contains("."))
                    return prim.getAsDouble();
                else {
                    return prim.getAsLong();
                }
            }
        }
        return context.deserialize(in, typeOfT);
    }

    private Type getTypeArguments(Type typeOfT, int index) {
        try {
            return ((ParameterizedType) typeOfT).getActualTypeArguments()[index];
        } catch (Exception e) {
            try {
                Clreplaced<?> ctype = ClreplacedUtil.getClreplaced(typeOfT).getComponentType();
                if (null != ctype) {
                    return ctype;
                }
            } catch (Exception e1) {
                e1.printStackTrace();
            }
        }
        return Object.clreplaced;
    }

    @SuppressWarnings("unchecked")
    private <T> T[] toArray(List<T> list) {
        // check for size and null before
        Clreplaced<?> clazz = list.get(0).getClreplaced();
        T[] array = (T[]) java.lang.reflect.Array.newInstance(clazz, list.size());
        return list.toArray(array);
    }

    private boolean isArray(Type typeOfT) {
        return ClreplacedUtil.getClreplaced(typeOfT).isArray();
    }
}

18 Source : ServiceGenerator.java
with Apache License 2.0
from pvarry

@Override
public java.util.Date deserialize(JsonElement element, Type arg1, JsonDeserializationContext arg2) throws JsonParseException {
    String date = element.getreplacedtring();
    Date returnDate = null;
    try {
        returnDate = ISO8601Utils.parse(date, new ParsePosition(0));
    } catch (ParseException | IllegalArgumentException e) {
        Log.e(TAG, "Failed to parse dateString: (" + date + "),  due to:", e);
    }
    return returnDate;
}

18 Source : LongpollUpdateAdapter.java
with GNU General Public License v3.0
from PhoenixDevTeam

@Override
public AbsLongpollEvent deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
    JsonArray array = json.getAsJsonArray();
    int action = array.get(0).getAsInt();
    return deserialize(action, array);
}

18 Source : OreConfigSerializer.java
with GNU General Public License v3.0
from oitsjustjose

public IDeposit deserialize(JsonObject jsonConfig, Type type, JsonDeserializationContext ctx) {
    if (jsonConfig == null) {
        return null;
    }
    try {
        if (jsonConfig.has("blocks") && jsonConfig.has("samples")) {
            if (jsonConfig.has("biomes")) {
                return deserializeDepositMultiOreBiomeRestricted(jsonConfig);
            }
            return deserializeDepositMultiOre(jsonConfig);
        } else if (jsonConfig.has("biomes")) {
            return deserializeDepositBiomeRestricted(jsonConfig);
        } else if (jsonConfig.has("block") && jsonConfig.has("sample")) {
            return deserializeDeposit(jsonConfig);
        }
        Geolosys.getInstance().LOGGER.error("Given JSON file has a mix of 'block(s)' and 'sample(s)'");
        return null;
    } catch (Exception e) {
        Geolosys.getInstance().LOGGER.error("Failed to parse JSON file: {}", e);
        return null;
    }
}

18 Source : MeshNetworkDeserializer.java
with BSD 3-Clause "New" or "Revised" License
from NordicSemiconductor

/**
 * Returns a list of application keys after de-serializing the json array containing the application keys
 *
 * @param context  deserializer context
 * @param json     json array containing the app keys
 * @param meshUuid network provisionerUuid
 * @return List of app keys
 */
private List<ApplicationKey> deserializeAppKeys(@NonNull final JsonDeserializationContext context, @NonNull final JsonArray json, @NonNull final String meshUuid) {
    final Type applicationKeyList = new TypeToken<List<ApplicationKey>>() {
    }.getType();
    final List<ApplicationKey> applicationKeys = context.deserialize(json, applicationKeyList);
    for (ApplicationKey key : applicationKeys) {
        key.setMeshUuid(meshUuid);
    }
    return applicationKeys;
}

18 Source : MeshNetworkDeserializer.java
with BSD 3-Clause "New" or "Revised" License
from NordicSemiconductor

/**
 * Returns a JsonElement of network keys after de-serializing the json array containing the network keys
 *
 * @param context  deserializer context
 * @param json     json array containing the netkeys
 * @param meshUuid network provisionerUuid
 * @return List of network keys
 */
private List<NetworkKey> deserializeNetKeys(@NonNull final JsonDeserializationContext context, @NonNull final JsonArray json, @NonNull final String meshUuid) {
    final Type networkKey = new TypeToken<List<NetworkKey>>() {
    }.getType();
    final List<NetworkKey> networkKeys = context.deserialize(json, networkKey);
    for (NetworkKey key : networkKeys) {
        key.setMeshUuid(meshUuid);
    }
    return networkKeys;
}

18 Source : MeshNetworkDeserializer.java
with BSD 3-Clause "New" or "Revised" License
from NordicSemiconductor

/**
 * Returns a list of nodes deserializing the json array containing the provisioned mesh nodes
 *
 * @param context  deserializer context
 * @param json     json array containing the nodes
 * @param meshUuid network provisionerUuid
 * @return List of nodes
 */
private List<ProvisionedMeshNode> deserializeNodes(@NonNull final JsonDeserializationContext context, @NonNull final JsonArray json, final String meshUuid) {
    final Type nodeList = new TypeToken<List<ProvisionedMeshNode>>() {
    }.getType();
    final List<ProvisionedMeshNode> nodes = context.deserialize(json, nodeList);
    for (ProvisionedMeshNode node : nodes) {
        node.setMeshUuid(meshUuid);
    }
    return nodes;
}

18 Source : ICTDeserializer.java
with MIT License
from MysticMods

private ItemTransformVec3f getTransform(JsonDeserializationContext p_181683_1_, JsonObject p_181683_2_, String p_181683_3_) {
    return p_181683_2_.has(p_181683_3_) ? (ItemTransformVec3f) p_181683_1_.deserialize(p_181683_2_.get(p_181683_3_), ItemTransformVec3f.clreplaced) : ItemTransformVec3f.DEFAULT;
}

18 Source : BPDeserializer.java
with MIT License
from MysticMods

private Map<EnumFacing, BlockPartFace> parseFacesCheck(JsonDeserializationContext deserializationContext, JsonObject object) {
    Map<EnumFacing, BlockPartFace> map = this.parseFaces(deserializationContext, object);
    if (map.isEmpty()) {
        throw new JsonParseException("Expected between 1 and 6 unique faces, got 0");
    } else {
        return map;
    }
}

18 Source : MethodInsnNodeSerializer.java
with GNU General Public License v3.0
from LLVM-but-worse

@Override
public MethodInsnNode deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
    JsonObject jsonObject = (JsonObject) json;
    int opcode = jsonObject.get("opcode").getAsInt();
    String owner = jsonObject.get("owner").getreplacedtring();
    String name = jsonObject.get("name").getreplacedtring();
    String desc = jsonObject.get("desc").getreplacedtring();
    return new MethodInsnNode(opcode, owner, name, desc, opcode == Opcodes.INVOKEINTERFACE);
}

18 Source : FrameNodeSerializer.java
with GNU General Public License v3.0
from LLVM-but-worse

@Override
public FrameNode deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
    JsonObject jsonObject = (JsonObject) json;
    int opcode;
    int type;
    List<?> local = null, stack = null;
    opcode = jsonObject.get("opcode").getAsInt();
    type = jsonObject.get("type").getAsInt();
    local = context.deserialize(jsonObject.get("local"), List.clreplaced);
    stack = context.deserialize(jsonObject.get("stack"), List.clreplaced);
    FrameNode node = new FrameNode(opcode, local.size(), local.toArray(), stack.size(), stack.toArray());
    node.type = type;
    return node;
}

18 Source : FieldInsnNodeSerializer.java
with GNU General Public License v3.0
from LLVM-but-worse

@Override
public FieldInsnNode deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
    int opcode;
    String owner = null, name = null, desc = null;
    JsonObject object = (JsonObject) json;
    opcode = object.get("opcode").getAsInt();
    owner = object.get("owner").getreplacedtring();
    name = object.get("name").getreplacedtring();
    desc = object.get("desc").getreplacedtring();
    if (owner == null || name == null || desc == null)
        throw new JsonParseException("Could not parse FieldInsnNode");
    return new FieldInsnNode(opcode, owner, name, desc);
}

18 Source : JsonUtils.java
with GNU General Public License v3.0
from josephworks

public static <T> T deserializeClreplaced(JsonObject json, String memberName, JsonDeserializationContext context, Clreplaced<? extends T> adapter) {
    if (json.has(memberName)) {
        return (T) deserializeClreplaced(json.get(memberName), memberName, context, adapter);
    } else {
        throw new JsonSyntaxException("Missing " + memberName);
    }
}

18 Source : TickTrigger.java
with GNU General Public License v3.0
from josephworks

public Instance deserializeInstance(JsonObject json, JsonDeserializationContext context) {
    return new Instance();
}

18 Source : PositionTrigger.java
with GNU General Public License v3.0
from josephworks

public Instance deserializeInstance(JsonObject json, JsonDeserializationContext context) {
    LocationPredicate locationpredicate = LocationPredicate.deserialize(json);
    return new Instance(this.id, locationpredicate);
}

18 Source : KilledTrigger.java
with GNU General Public License v3.0
from josephworks

public Instance deserializeInstance(JsonObject json, JsonDeserializationContext context) {
    return new Instance(this.id, EnreplacedyPredicate.deserialize(json.get("enreplacedy")), DamageSourcePredicate.deserialize(json.get("killing_blow")));
}

18 Source : LootEntry_SerializerMixin.java
with GNU General Public License v3.0
from IzzelAliz

public final T a(JsonObject object, JsonDeserializationContext context) {
    return this.deserialize(object, context);
}

18 Source : ModelOverrideDeserializerMixin.java
with MIT License
from emilyalexandra

@Inject(at = @At("RETURN"), method = "deserialize", cancellable = true)
public void deserialize(JsonElement element, Type type, JsonDeserializationContext context, CallbackInfoReturnable<ModelOverride> info) throws JsonParseException {
    ((ModelOverrideWrapper) info.getReturnValue()).setCustomPredicates(customPredicates);
}

18 Source : DoubleAsIntDeserializer.java
with Apache License 2.0
from cisco-system-traffic-generator

@Override
@SuppressWarnings("unchecked")
public Map<String, Object> deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) {
    return (Map<String, Object>) read(json);
}

18 Source : WarcraftStateSerializer.java
with Mozilla Public License 2.0
from blairisme

private void deserializeLevel(JsonObject json, JsonDeserializationContext context, WarcraftState state) {
    GameObjectContainer deserializedLevel = deserializeLevel(json.get(LEVEL), context);
    state.setWorld(deserializedLevel);
}

See More Examples