01: /*
02: * Copyright (C) 2004, 2005, 2006 Joe Walnes.
03: * Copyright (C) 2006, 2007 XStream Committers.
04: * All rights reserved.
05: *
06: * The software in this package is published under the terms of the BSD
07: * style license a copy of which has been included with this distribution in
08: * the LICENSE.txt file.
09: *
10: * Created on 15. March 2004 by Joe Walnes
11: */
12: package com.thoughtworks.xstream.core;
13:
14: import com.thoughtworks.xstream.alias.ClassMapper;
15: import com.thoughtworks.xstream.converters.ConverterLookup;
16: import com.thoughtworks.xstream.io.HierarchicalStreamReader;
17: import com.thoughtworks.xstream.mapper.Mapper;
18:
19: public class ReferenceByIdUnmarshaller extends
20: AbstractReferenceUnmarshaller {
21:
22: public ReferenceByIdUnmarshaller(Object root,
23: HierarchicalStreamReader reader,
24: ConverterLookup converterLookup, Mapper mapper) {
25: super (root, reader, converterLookup, mapper);
26: }
27:
28: /**
29: * @deprecated As of 1.2, use {@link #ReferenceByIdUnmarshaller(Object, HierarchicalStreamReader, ConverterLookup, Mapper)}
30: */
31: public ReferenceByIdUnmarshaller(Object root,
32: HierarchicalStreamReader reader,
33: ConverterLookup converterLookup, ClassMapper classMapper) {
34: this (root, reader, converterLookup, (Mapper) classMapper);
35: }
36:
37: protected Object getReferenceKey(String reference) {
38: return reference;
39: }
40:
41: protected Object getCurrentReferenceKey() {
42: return reader.getAttribute(getMapper().aliasForAttribute("id"));
43: }
44: }
|