private Object convertIDReference(NODE value, MappedPath propertyPath) { if (value instanceof ID) { return value; } else { throw new BindException(propertyPath, value); } }
@SuppressWarnings("unchecked") private Object convertEnum(NODE value, Class<?> targetClass) { if (value instanceof UID) { return Enum.valueOf((Class<? extends Enum>) targetClass, ((UID) value).ln()); } else if (value instanceof LIT) { return Enum.valueOf((Class<? extends Enum>) targetClass, value.getValue()); } else { throw new BindException("Cannot bind BNode into enum"); } }
@SuppressWarnings("unchecked") private Object convertClassReference(NODE value, MappedPath propertyPath, MappedProperty mappedProperty) { if (value instanceof UID) { return convertClassReference((UID) value, mappedProperty.getComponentType()); } else { throw new BindException(propertyPath, "bnode or literal", value); } }
@SuppressWarnings("unchecked") private Object convertMappedClass(NODE value, Class<?> targetClass, MappedPath propertyPath, MappedProperty mappedProperty) { if (value instanceof ID) { return convertMappedObject((ID) value, targetClass, isPolymorphic(mappedProperty), mappedProperty.isInjection()); } else { throw new BindException(propertyPath, value); } }
id = identifier; } else { throw new BindException("Cannot assign id of " + mappedClass + " into " + type);