? createReferenceKey(currentPath, item) : existingReference.getItem(); if (lastPath == null || !currentPath.isAncestor(lastPath)) { fireValidReference(newReferenceKey); lastPath = currentPath;
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); } } }
? createReferenceKey(currentPath, item) : existingReference.getItem(); if (lastPath == null || !currentPath.isAncestor(lastPath)) { fireValidReference(newReferenceKey); lastPath = currentPath;
? createReferenceKey(currentPath, item) : existingReference.getItem(); if (lastPath == null || !currentPath.isAncestor(lastPath)) { fireValidReference(newReferenceKey); lastPath = currentPath;
? createReferenceKey(currentPath, item) : existingReference.getItem(); if (lastPath == null || !currentPath.isAncestor(lastPath)) { fireValidReference(newReferenceKey); lastPath = currentPath;
? createReferenceKey(currentPath, item) : existingReference.getItem(); if (lastPath == null || !currentPath.isAncestor(lastPath)) { fireValidReference(newReferenceKey); lastPath = currentPath;
? createReferenceKey(currentPath, item) : existingReference.getItem(); if (lastPath == null || !currentPath.isAncestor(lastPath)) { fireValidReference(newReferenceKey); lastPath = currentPath;
? createReferenceKey(currentPath, item) : existingReference.getItem(); if (lastPath == null || !currentPath.isAncestor(lastPath)) { fireValidReference(newReferenceKey); lastPath = currentPath;