public boolean isReference() { return isMappedClass(mappedProperty.getTargetType()) || mappedProperty.isURI() || mappedProperty.isInjection(); }
@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); } }
convertedValue = convertMappedObject((ID) value, Object.class, true, mappedProperty.isInjection()); else if (configuration.isMapped(targetClass) || mappedProperty.isInjection()) { convertedValue = convertMappedClass(value, targetClass, propertyPath, mappedProperty);
@Test public void VverrideWithinClass() { Configuration configuration = new DefaultConfiguration(TEST.NS, WithinClass.class); MappedClass mappedClass = configuration.getMappedClass(WithinClass.class); MappedPath path = mappedClass.getMappedPath("reference"); assertEquals(new UID(TEST.NS, "reference"), path.get(0).getUID()); MappedProperty<?> property = path.getMappedProperty(); assertTrue(property.isInjection()); }