public Object[] getParameters() { return delegate.getParameters(); }
public Object[] getParameters() { return delegate.getParameters(); }
public Object intercept(ObjectMessage message) throws Exception { Class<?> type = message.getMethod().getReturnType(); if (Void.TYPE.equals(type)) { if (Set.class.equals(message.getMethod().getParameterTypes()[0])) { property.setAll((Set<?>) message.getParameters()[0]); } else { property.setSingle(message.getParameters()[0]); } return message.proceed(); } else if (Set.class.equals(type)) { return property.getAll(); } else if (type.isPrimitive()) { Object result = property.getSingle(); if (result == null) return message.proceed(); return result; } else { try { Object result = type.cast(property.getSingle()); if (result == null) return message.proceed(); return result; } catch (ClassCastException e) { throw new ClassCastException(property.getSingle() + " cannot be cast to " + type.getName()); } } } }
if (Void.TYPE.equals(type)) { if (Set.class.equals(message.getMethod().getParameterTypes()[0])) { property.setAll((Set<?>) message.getParameters()[0]); } else { property.setSingle(message.getParameters()[0]);
public Object intercept(ObjectMessage message) throws Exception { Object target = message.getTarget(); ObjectConnection con = ((RDFObject) target).getObjectConnection(); Resource self = ((RDFObject) target).getResource(); SparqlBuilder with = evaluator.prepare(con).with("this", self); Object[] args = message.getParameters(); getParameters(message.getMethod()).populate(args, with, con); if (isUpdate()) { with.asUpdate(); if (target instanceof Refreshable) { ((Refreshable) target).refresh(); } return message.proceed(); } else { Object result = cast(with, returnClass, componentClass); if (result == null) return message.proceed(); if (returnClass.isPrimitive() && result.equals(nil(returnClass))) return message.proceed(); return result; } }
public Object intercept(ObjectMessage message) throws Exception { Object target = message.getTarget(); ObjectConnection con = ((RDFObject) target).getObjectConnection(); Resource self = ((RDFObject) target).getResource(); SparqlBuilder with = evaluator.prepare(con).with("this", self); Object[] args = message.getParameters(); getParameters(message.getMethod()).populate(args, with, con); if (isUpdate()) { with.asUpdate(); if (target instanceof Refreshable) { ((Refreshable) target).refresh(); } return message.proceed(); } else { Object result = cast(with, returnClass, componentClass); if (result == null) return message.proceed(); if (returnClass.isPrimitive() && result.equals(nil(returnClass))) return message.proceed(); return result; } }