@Test public void testAbstractTypesForMainClass() throws IOException, LyoModelException { final Model model = RDFHelper.loadResourceModel("abstract-types.ttl"); final Pet pet = JenaModelHelper.unmarshal(model.getResource("urn:rex"), Pet.class); assertEquals(Dog.class, pet.getClass()); }
@SuppressWarnings({"unchecked", "deprecation"}) public static <T> T unmarshal(final Resource resource, Class<T> clazz) throws LyoModelException { try { return (T)JenaModelHelper.fromJenaResource(resource, clazz); } catch (DatatypeConfigurationException | IllegalAccessException | InvocationTargetException | InstantiationException | OslcCoreApplicationException | NoSuchMethodException | URISyntaxException e) { throw new LyoModelException(e); } }
JenaModelHelper { @SuppressWarnings({"unchecked", "deprecation"}) public static <T> T unmarshal(final Resource resource, Class<T> clazz) throws LyoModelException { try { return (T)JenaModelHelper.fromJenaResource(resource, clazz); } catch (DatatypeConfigurationException | IllegalAccessException | InvocationTargetException | InstantiationException | OslcCoreApplicationException | NoSuchMethodException | URISyntaxException e) { throw new LyoModelException(e); } } }
JenaModelHelper { @SuppressWarnings({"unchecked", "deprecation"}) public static <T> T unmarshal(final Resource resource, Class<T> clazz) throws LyoModelException { try { return (T)JenaModelHelper.fromJenaResource(resource, clazz); } catch (DatatypeConfigurationException | IllegalAccessException | InvocationTargetException | InstantiationException | OslcCoreApplicationException | NoSuchMethodException | URISyntaxException e) { throw new LyoModelException(e); } } private  JenaModelHelper(); }
JenaModelHelper { @SuppressWarnings({"unchecked", "deprecation"}) public static <T> T unmarshal(final Resource resource, Class<T> clazz) throws LyoModelException { try { return (T)JenaModelHelper.fromJenaResource(resource, clazz); } catch (DatatypeConfigurationException | IllegalAccessException | InvocationTargetException | InstantiationException | OslcCoreApplicationException | NoSuchMethodException | URISyntaxException e) { throw new LyoModelException(e); } } private  JenaModelHelper(); static Model createJenaModel(final Object[] objects); static T unmarshalSingle(final Model model, Class<T> clazz); @SuppressWarnings({"unchecked", "deprecation"}) static T unmarshal(final Resource resource, Class<T> clazz); @Deprecated static Object fromJenaResource(final Resource resource, Class<?> beanClass); @SuppressWarnings({"unchecked", "deprecation"}) static T[] unmarshal(final Model model, Class<T> clazz); @Deprecated static Object[] fromJenaModel(final Model model, final Class<?> beanClass); static R followLink(final Model m, final Link l,
                                                     final Class<R> rClass); static void skolemize(final Model m); static void skolemize(final Model m, Function<BlankNodeId, String> skolemUriFunction); }
JenaModelHelper { @SuppressWarnings({"unchecked", "deprecation"}) public static <T> T unmarshal(final Resource resource, Class<T> clazz) throws LyoModelException { try { return (T)JenaModelHelper.fromJenaResource(resource, clazz); } catch (DatatypeConfigurationException | IllegalAccessException | InvocationTargetException | InstantiationException | OslcCoreApplicationException | NoSuchMethodException | URISyntaxException e) { throw new LyoModelException(e); } } private  JenaModelHelper(); static Model createJenaModel(final Object[] objects); static T unmarshalSingle(final Model model, Class<T> clazz); @SuppressWarnings({"unchecked", "deprecation"}) static T unmarshal(final Resource resource, Class<T> clazz); @Deprecated static Object fromJenaResource(final Resource resource, Class<?> beanClass); @SuppressWarnings({"unchecked", "deprecation"}) static T[] unmarshal(final Model model, Class<T> clazz); @Deprecated static Object[] fromJenaModel(final Model model, final Class<?> beanClass); static R followLink(final Model m, final Link l,
                                                     final Class<R> rClass); static void skolemize(final Model m); static void skolemize(final Model m, Function<BlankNodeId, String> skolemUriFunction);  }