- Revision
- 491
- Author
- mauro
- Date
- 2007-12-15 10:07:59 -0600 (Sat, 15 Dec 2007)
Log Message
WAFFLE-50: Changed spelling of Serialiser.
Modified Paths
Added Paths
- trunk/waffle-core/src/main/java/org/codehaus/waffle/serialisation/Serializer.java
- trunk/waffle-core/src/main/java/org/codehaus/waffle/serialisation/XStreamSerializer.java
Removed Paths
Diff
Deleted: trunk/waffle-core/src/main/java/org/codehaus/waffle/serialisation/Serialiser.java (490 => 491)
--- trunk/waffle-core/src/main/java/org/codehaus/waffle/serialisation/Serialiser.java 2007-12-15 15:55:09 UTC (rev 490) +++ trunk/waffle-core/src/main/java/org/codehaus/waffle/serialisation/Serialiser.java 2007-12-15 16:07:59 UTC (rev 491) @@ -1,39 +0,0 @@ -/***************************************************************************** - * Copyright (C) 2005,2006 Michael Ward * - * All rights reserved. * - * ------------------------------------------------------------------------- * - * The software in this package is published under the terms of the BSD * - * style license a copy of which has been included with this distribution in * - * the LICENSE.txt file. * - * * - * Original code by: Mauro Talevi * - *****************************************************************************/ -package org.codehaus.waffle.serialisation; - -import java.io.Reader; -import java.io.Writer; - -/** - * Serialiser is responsible for serialiasing objects. - * - * @author Mauro Talevi - */ -public interface Serialiser { - - /** - * Marshalls object to a writer - * - * @param object the Object to marshall - * @param writer the writer to which the object is marshalled - */ - void marshall(Object object, Writer writer); - - /** - * Unmarshalls object from reader input - * - * @param reader the input resource - * @return An unmarshalled Object - */ - Object unmarshall(Reader reader); - -}
Copied: trunk/waffle-core/src/main/java/org/codehaus/waffle/serialisation/Serializer.java (from rev 487, trunk/waffle-core/src/main/java/org/codehaus/waffle/serialisation/Serialiser.java) (0 => 491)
--- trunk/waffle-core/src/main/java/org/codehaus/waffle/serialisation/Serializer.java (rev 0) +++ trunk/waffle-core/src/main/java/org/codehaus/waffle/serialisation/Serializer.java 2007-12-15 16:07:59 UTC (rev 491) @@ -0,0 +1,39 @@ +/***************************************************************************** + * Copyright (C) 2005,2006 Michael Ward * + * All rights reserved. * + * ------------------------------------------------------------------------- * + * The software in this package is published under the terms of the BSD * + * style license a copy of which has been included with this distribution in * + * the LICENSE.txt file. * + * * + * Original code by: Mauro Talevi * + *****************************************************************************/ +package org.codehaus.waffle.serialisation; + +import java.io.Reader; +import java.io.Writer; + +/** + * Serializer is responsible for marshalling and unmarshalling objects. + * + * @author Mauro Talevi + */ +public interface Serializer { + + /** + * Marshalls object to a writer + * + * @param object the Object to marshall + * @param writer the writer to which the object is marshalled + */ + void marshall(Object object, Writer writer); + + /** + * Unmarshalls object from reader input + * + * @param reader the input resource + * @return An unmarshalled Object + */ + Object unmarshall(Reader reader); + +}
Deleted: trunk/waffle-core/src/main/java/org/codehaus/waffle/serialisation/XStreamSerialiser.java (490 => 491)
--- trunk/waffle-core/src/main/java/org/codehaus/waffle/serialisation/XStreamSerialiser.java 2007-12-15 15:55:09 UTC (rev 490) +++ trunk/waffle-core/src/main/java/org/codehaus/waffle/serialisation/XStreamSerialiser.java 2007-12-15 16:07:59 UTC (rev 491) @@ -1,51 +0,0 @@ -/***************************************************************************** - * Copyright (C) 2005,2006 Michael Ward * - * All rights reserved. * - * ------------------------------------------------------------------------- * - * The software in this package is published under the terms of the BSD * - * style license a copy of which has been included with this distribution in * - * the LICENSE.txt file. * - * * - * Original code by: Mauro Talevi * - *****************************************************************************/ -package org.codehaus.waffle.serialisation; - -import java.io.Reader; -import java.io.Writer; - -import com.thoughtworks.xstream.XStream; -import com.thoughtworks.xstream.io.xml.DomDriver; - -/** - * XStream-based serialiser. Delegates to XStream the marshalling. - * - * @author Mauro Talevi - */ -public class XStreamSerialiser implements Serialiser { - - private XStream xstream; - - /** - * Creates a XStreamSerialiser with default XStream instance with minimal dependencies - */ - public XStreamSerialiser(){ - this(new XStream(new DomDriver())); - } - - /** - * Creates a XStreamSerialiser with a given XStream instance - * @param xstream the XStream instance - */ - public XStreamSerialiser(XStream xstream) { - this.xstream = xstream; - } - - public void marshall(Object object, Writer writer) { - xstream.toXML(object, writer); - } - - public Object unmarshall(Reader reader) { - return xstream.fromXML(reader); - } - -}
Copied: trunk/waffle-core/src/main/java/org/codehaus/waffle/serialisation/XStreamSerializer.java (from rev 487, trunk/waffle-core/src/main/java/org/codehaus/waffle/serialisation/XStreamSerialiser.java) (0 => 491)
--- trunk/waffle-core/src/main/java/org/codehaus/waffle/serialisation/XStreamSerializer.java (rev 0) +++ trunk/waffle-core/src/main/java/org/codehaus/waffle/serialisation/XStreamSerializer.java 2007-12-15 16:07:59 UTC (rev 491) @@ -0,0 +1,51 @@ +/***************************************************************************** + * Copyright (C) 2005,2006 Michael Ward * + * All rights reserved. * + * ------------------------------------------------------------------------- * + * The software in this package is published under the terms of the BSD * + * style license a copy of which has been included with this distribution in * + * the LICENSE.txt file. * + * * + * Original code by: Mauro Talevi * + *****************************************************************************/ +package org.codehaus.waffle.serialisation; + +import java.io.Reader; +import java.io.Writer; + +import com.thoughtworks.xstream.XStream; +import com.thoughtworks.xstream.io.xml.DomDriver; + +/** + * XStream-based serializer. Delegates to XStream the marshalling. + * + * @author Mauro Talevi + */ +public class XStreamSerializer implements Serializer { + + private XStream xstream; + + /** + * Creates a XStreamSerializer with default XStream instance with minimal dependencies + */ + public XStreamSerializer(){ + this(new XStream(new DomDriver())); + } + + /** + * Creates a XStreamSerializer with a given XStream instance + * @param xstream the XStream instance + */ + public XStreamSerializer(XStream xstream) { + this.xstream = xstream; + } + + public void marshall(Object object, Writer writer) { + xstream.toXML(object, writer); + } + + public Object unmarshall(Reader reader) { + return xstream.fromXML(reader); + } + +}
Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/view/XMLView.java (490 => 491)
--- trunk/waffle-core/src/main/java/org/codehaus/waffle/view/XMLView.java 2007-12-15 15:55:09 UTC (rev 490) +++ trunk/waffle-core/src/main/java/org/codehaus/waffle/view/XMLView.java 2007-12-15 16:07:59 UTC (rev 491) @@ -9,8 +9,8 @@ import javax.servlet.http.HttpServletResponse; import org.codehaus.waffle.Constants; -import org.codehaus.waffle.serialisation.Serialiser; -import org.codehaus.waffle.serialisation.XStreamSerialiser; +import org.codehaus.waffle.serialisation.Serializer; +import org.codehaus.waffle.serialisation.XStreamSerializer; import com.thoughtworks.xstream.XStream; import com.thoughtworks.xstream.converters.collections.CollectionConverter; @@ -36,14 +36,14 @@ } private String serialise(Object attribute) { - Serialiser serialiser = createSerialiser(); + Serializer serialiser = createSerialiser(); Writer writer = new StringWriter(); serialiser.marshall(attribute, writer); return writer.toString(); } //TODO: should the serialiser(s) be registered in ComponentRegistry? - private Serialiser createSerialiser() { + private Serializer createSerialiser() { // TODO: should we stream.setMode(XStream.NO_REFERENCES); ? XStream xstream = new XStream(new DomDriver()) { protected MapperWrapper wrapMapper(MapperWrapper next) { @@ -68,7 +68,7 @@ return Collection.class.isAssignableFrom(clazz); } }, -18); - return new XStreamSerialiser(xstream); + return new XStreamSerializer(xstream); } }
To unsubscribe from this list please visit:
