default <T> T getReference(NodeAddress nodeId, Class<T> iClass, Object id) { return getReference(null, nodeId, iClass, id); }
default <T> T getReference(Class<T> iClass, Object id) { return getReference(null, null, iClass, id); }
@SuppressWarnings({ "rawtypes", "unchecked" }) @Override public Object deserialize(final JsonParser jsonParser, final DeserializationContext ctxt) throws IOException { final String text = jsonParser.getText(); final int idx = text.indexOf('/'); if (idx != 0) { final UUID uuid = UUID.fromString(text.substring(0, idx)); return factory.getReference(new NodeAddressImpl(uuid), (Class) iClass, text.substring(idx + 1)); } else { return factory.getReference(null, (Class) iClass, text.substring(idx + 1)); } }
@SuppressWarnings({ "rawtypes", "unchecked" }) @Override public Object deserialize(final JsonParser jsonParser, final DeserializationContext ctxt) throws IOException { final String text = jsonParser.getText(); final int idx = text.indexOf('/'); if (idx != 0) { final UUID uuid = UUID.fromString(text.substring(0, idx)); return factory.getReference(new NodeAddressImpl(uuid), (Class) iClass, text.substring(idx + 1)); } else { return factory.getReference(null, (Class) iClass, text.substring(idx + 1)); } }
@SuppressWarnings({ "unchecked", "rawtypes" }) @Override public Object deserialize(final JsonParser jsonParser, final DeserializationContext ctxt) throws IOException { final String text = jsonParser.getText(); if (text != null && text.startsWith("!!")) { if (text.startsWith("!!!")) { // three "!!!" is the escape when the id starts with "!!" return factory.getReference(null, (Class) iClass, text.substring(1)); } int idx = text.indexOf(' '); String className = text.substring(2, idx); String key = text.substring(idx + 1); try { final Class aClass = Class.forName(className); return factory.getReference(null, aClass, key); } catch (ClassNotFoundException e) { throw new UncheckedException("Can't find class: " + e); } } return factory.getReference(null, (Class) iClass, text); }
@SuppressWarnings({ "unchecked", "rawtypes" }) @Override public Object deserialize(final JsonParser jsonParser, final DeserializationContext ctxt) throws IOException { final String text = jsonParser.getText(); if (text != null && text.startsWith("!!")) { if (text.startsWith("!!!")) { // three "!!!" is the escape when the id starts with "!!" return factory.getReference(null, (Class) iClass, text.substring(1)); } int idx = text.indexOf(' '); String className = text.substring(2, idx); String key = text.substring(idx + 1); try { final Class aClass = Class.forName(className); return factory.getReference(null, aClass, key); } catch (ClassNotFoundException e) { throw new UncheckedException("Can't find class: " + e); } } return factory.getReference(null, (Class) iClass, text); }
@Override public <T> T getReference(final BasicRuntime runtime, final NodeAddress address, final Class<T> iClass, final Object id) { if (address != null) { return stage.getReference(address, iClass, id); } else { return DefaultDescriptorFactory.get().getReference(this, address, iClass, id); } }