public Object lookupReference(Object item) { Id id = (Id)references.lookupId(item); return id.getItem(); }
} else { final Path currentPath = pathTracker.getPath(); Id existingReference = (Id)references.lookupId(item); if (existingReference != null && existingReference.getPath() != currentPath) { String attributeName = getMapper().aliasForSystemAttribute("reference");
@Override public R lookupReference(final Object item) { final Id<R> id = references.lookupId(item); return id.getItem(); }
public Object lookupReference(Object item) { Id id = (Id)references.lookupId(item); return id.getItem(); }
public Object lookupReference(Object item) { Id id = (Id)references.lookupId(item); return id.getItem(); }
public Object lookupReference(Object item) { Id id = (Id)references.lookupId(item); return id.getItem(); }
public Object lookupReference(Object item) { Id id = (Id)references.lookupId(item); return id.getItem(); }
public Object lookupReference(Object item) { Id id = (Id)references.lookupId(item); return id.getItem(); }
@Override public void convertAnother(Object item) { Class<?> targetClass = item.getClass(); while (Enhancer.isEnhanced(targetClass) == true) { targetClass = targetClass.getSuperclass(); } Converter converter = converterLookup.lookupConverterForType(targetClass); Object realItem = HibernateProxyHelper.get(item); if (classMapper.isImmutableValueType(realItem.getClass())) { // strings, ints, dates, etc... don't bother using references. converter.marshal(item, writer, this); } else { Object idOfExistingReference = references.lookupId(realItem); if (idOfExistingReference != null) { writer.addAttribute("reference", idOfExistingReference.toString()); return; } String newId = idGenerator.next(realItem); writer.addAttribute("id", newId); references.associateId(realItem, newId); if (log.isDebugEnabled()) { log.debug("marshalling object " + realItem.getClass() + " to stream"); } converter.marshal(realItem, writer, this); } }
public void convert(Object item, Converter converter) { if (getMapper().isImmutableValueType(item.getClass())) { // strings, ints, dates, etc... don't bother using references. converter.marshal(item, writer, this); } else { Path currentPath = pathTracker.getPath(); Object existingReferenceKey = references.lookupId(item); if (existingReferenceKey != null) { String attributeName = getMapper().aliasForSystemAttribute("reference"); if (attributeName != null) { writer.addAttribute(attributeName, createReference(currentPath, existingReferenceKey)); } } else if (implicitElements.lookupId(item) != null) { throw new ReferencedImplicitElementException(item, currentPath); } else { Object newReferenceKey = createReferenceKey(currentPath, item); if (lastPath == null || !currentPath.isAncestor(lastPath)) { fireValidReference(newReferenceKey); lastPath = currentPath; references.associateId(item, newReferenceKey); } else { implicitElements.associateId(item, newReferenceKey); } converter.marshal(item, writer, this); } } }
public void convert(Object item, Converter converter) { if (getMapper().isImmutableValueType(item.getClass())) { // strings, ints, dates, etc... don't bother using references. converter.marshal(item, writer, this); } else { Path currentPath = pathTracker.getPath(); Object existingReferenceKey = references.lookupId(item); if (existingReferenceKey != null) { String attributeName = getMapper().aliasForSystemAttribute("reference"); if (attributeName != null) { writer.addAttribute(attributeName, createReference(currentPath, existingReferenceKey)); } } else if (implicitElements.lookupId(item) != null) { throw new ReferencedImplicitElementException(item, currentPath); } else { Object newReferenceKey = createReferenceKey(currentPath, item); if (lastPath == null || !currentPath.isAncestor(lastPath)) { fireValidReference(newReferenceKey); lastPath = currentPath; references.associateId(item, newReferenceKey); } else { implicitElements.associateId(item, newReferenceKey); } converter.marshal(item, writer, this); } } }
} else { final Path currentPath = pathTracker.getPath(); Id existingReference = (Id)references.lookupId(item); if (existingReference != null && existingReference.getPath() != currentPath) { String attributeName = getMapper().aliasForSystemAttribute("reference");
} else { final Path currentPath = pathTracker.getPath(); final Id<R> existingReference = references.lookupId(item); if (existingReference != null && existingReference.getPath() != currentPath) { final String attributeName = getMapper().aliasForSystemAttribute("reference");
} else { final Path currentPath = pathTracker.getPath(); Id existingReference = (Id)references.lookupId(item); if (existingReference != null && existingReference.getPath() != currentPath) { String attributeName = getMapper().aliasForSystemAttribute("reference");
} else { final Path currentPath = pathTracker.getPath(); Id existingReference = (Id)references.lookupId(item); if (existingReference != null && existingReference.getPath() != currentPath) { String attributeName = getMapper().aliasForSystemAttribute("reference");
} else { final Path currentPath = pathTracker.getPath(); Id existingReference = (Id)references.lookupId(item); if (existingReference != null && existingReference.getPath() != currentPath) { String attributeName = getMapper().aliasForSystemAttribute("reference");
} else { final Path currentPath = pathTracker.getPath(); Id existingReference = (Id)references.lookupId(item); if (existingReference != null && existingReference.getPath() != currentPath) { String attributeName = getMapper().aliasForSystemAttribute("reference");