01: /*
02: * Copyright (C) 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 28. May 2005 by Mauro Talevi
11: */
12: package com.thoughtworks.xstream.io.xml;
13:
14: import com.thoughtworks.xstream.io.HierarchicalStreamDriver;
15:
16: /**
17: * Base class for HierarchicalStreamDrivers to use xml-based HierarchicalStreamReader
18: * and HierarchicalStreamWriter.
19: *
20: * @author Mauro Talevi
21: * @since 1.2
22: */
23: public abstract class AbstractXmlDriver implements
24: HierarchicalStreamDriver {
25:
26: private XmlFriendlyReplacer replacer;
27:
28: /**
29: * Creates a AbstractXmlFriendlyDriver with default XmlFriendlyReplacer
30: */
31: public AbstractXmlDriver() {
32: this (new XmlFriendlyReplacer());
33: }
34:
35: /**
36: * Creates a AbstractXmlFriendlyDriver with custom XmlFriendlyReplacer
37: * @param replacer the XmlFriendlyReplacer
38: */
39: public AbstractXmlDriver(XmlFriendlyReplacer replacer) {
40: this .replacer = replacer;
41: }
42:
43: protected XmlFriendlyReplacer xmlFriendlyReplacer() {
44: return replacer;
45: }
46:
47: }
|