@Override public boolean equals(Object obj) { if (resource == null) return false; if (obj instanceof RDFObjectBehaviour) return equals(((RDFObjectBehaviour) obj).getBehaviourDelegate()); return obj instanceof RDFObject && resource.equals(((RDFObject) obj).getResource()); }
@Override public boolean equals(Object obj) { if (resource == null) return false; if (obj instanceof RDFObjectBehaviour) return equals(((RDFObjectBehaviour) obj).getBehaviourDelegate()); return obj instanceof RDFObject && resource.equals(((RDFObject) obj).getResource()); }
/** * Explicitly adds the concept to the entity. * * @return the entity with new composed concept */ public <T> T addDesignation(Object entity, Class<T> concept) throws RepositoryException { if (entity instanceof RDFObjectBehaviour) { RDFObjectBehaviour support = (RDFObjectBehaviour) entity; Object delegate = support.getBehaviourDelegate(); if (delegate != entity) { return addDesignation(delegate, concept); } } Resource resource = findResource(entity); Set<URI> types = new HashSet<URI>(4); getTypes(entity.getClass(), types); addConcept(resource, concept, types); Object bean = of.createObject(resource, types); assert assertConceptRecorded(bean, concept); return (T) bean; }
/** * Converts an object into a literal or resource. */ public Value createValue(Object instance) { if (instance instanceof RDFObjectBehaviour) { RDFObjectBehaviour support = (RDFObjectBehaviour) instance; Object entity = support.getBehaviourDelegate(); if (entity != instance) return createValue(entity); } if (instance instanceof RDFObject) return ((RDFObject) instance).getResource(); if (instance instanceof Class<?>) { URI type = getNameOf((Class<?>) instance); if (type != null) return type; } return lm.createLiteral(instance); }
/** * Converts an object into a literal or resource. */ public Value createValue(Object instance) { if (instance instanceof RDFObjectBehaviour) { RDFObjectBehaviour support = (RDFObjectBehaviour) instance; Object entity = support.getBehaviourDelegate(); if (entity != instance) return createValue(entity); } if (instance instanceof RDFObject) return ((RDFObject) instance).getResource(); if (instance instanceof Class<?>) { URI type = getNameOf((Class<?>) instance); if (type != null) return type; } return lm.createLiteral(instance); }
/** * Explicitly adds the concept to the entity. * * @return the entity with new composed concept */ public <T> T addDesignation(Object entity, Class<T> concept) throws RepositoryException { if (entity instanceof RDFObjectBehaviour) { RDFObjectBehaviour support = (RDFObjectBehaviour) entity; Object delegate = support.getBehaviourDelegate(); if (delegate != entity) { return addDesignation(delegate, concept); } } Resource resource = findResource(entity); Set<URI> types = new HashSet<URI>(4); getTypes(entity.getClass(), types); addConcept(resource, concept, types); RDFObject bean = of.createObject(resource, types); assert assertConceptRecorded(bean, concept); return (T) cache(bean); }
if (instance instanceof RDFObjectBehaviour) { RDFObjectBehaviour support = (RDFObjectBehaviour) instance; Object entity = support.getBehaviourDelegate(); if (entity != instance) return addObject(entity);
if (instance instanceof RDFObjectBehaviour) { RDFObjectBehaviour support = (RDFObjectBehaviour) instance; Object entity = support.getBehaviourDelegate(); if (entity != instance) return addObject(entity);
if (entity instanceof RDFObjectBehaviour) { RDFObjectBehaviour support = (RDFObjectBehaviour) entity; Object delegate = support.getBehaviourDelegate(); if (delegate != entity) { addObject(resource, delegate);
if (entity instanceof RDFObjectBehaviour) { RDFObjectBehaviour support = (RDFObjectBehaviour) entity; Object delegate = support.getBehaviourDelegate(); if (delegate != entity) { addObject(resource, delegate);
if (entity instanceof RDFObjectBehaviour) { RDFObjectBehaviour support = (RDFObjectBehaviour) entity; Object delegate = support.getBehaviourDelegate(); if (delegate != entity) { return addDesignations(delegate, types);
if (entity instanceof RDFObjectBehaviour) { RDFObjectBehaviour support = (RDFObjectBehaviour) entity; Object delegate = support.getBehaviourDelegate(); if (delegate != entity) { return addDesignations(delegate, types);