// Path: src/main/java/pl/maciejwalkowiak/plist/PlistSerializerImpl.java
// public class PlistSerializerImpl implements PlistSerializer {
// 	private static final Logger logger = LoggerFactory.getLogger(PlistSerializerImpl.class);
// 
// 	private HandlerWrapper handlerWrapper;
// 	private BasicObjectSerializer basicObjectSerializer;
// 	private FieldSerializer fieldSerializer;
// 	private NamingStrategy namingStrategy = new DefaultNamingStrategy();
// 
// 	public PlistSerializerImpl(NamingStrategy namingStrategy) {
// 		this();
// 		this.namingStrategy = namingStrategy;
// 	}
// 
// 	public PlistSerializerImpl() {
// 		this.handlerWrapper = new HandlerWrapper(this);
// 		this.fieldSerializer = new FieldSerializer(handlerWrapper, this);
// 		this.basicObjectSerializer = new BasicObjectSerializer(handlerWrapper);
// 	}
// 
// 	public String toXmlPlist(Object objectToConvert) {
// 		StringBuilder result = new StringBuilder(HEADER);
// 
// 		result.append(serialize(objectToConvert));
// 
// 		result.append(FOOTER);
// 
// 		return result.toString();
// 	}
// 
// 	public String serialize(Object objectToConvert) {
// 		StringBuilder result = new StringBuilder();
// 
// 		logger.debug("converting object = {}", objectToConvert);
// 
// 		if (objectToConvert != null) {
// 			if (handlerWrapper.isSupported(objectToConvert)) {
// 				result.append(basicObjectSerializer.serializeBasicObject(objectToConvert));
// 			} else {
// 				result.append(fieldSerializer.serializeFields(objectToConvert));
// 			}
// 		}
// 
// 		return result.toString();
// 	}
// 
// 	public void setAdditionalHandlers(List<Handler> additionalHandlers) {
// 		handlerWrapper.addAdditionalHandlers(additionalHandlers);
// 	}
// 
// 	public NamingStrategy getNamingStrategy() {
// 		return namingStrategy;
// 	}
// 
// 	HandlerWrapper getHandlerWrapper() {
// 		return handlerWrapper;
// 	}
// }


import pl.maciejwalkowiak.plist.PlistSerializerImpl;
/*
 * Copyright (c) 2012 Maciej Walkowiak
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

package pl.maciejwalkowiak.plist.handler;


/**
 * Used for handlers that need to use {@link pl.maciejwalkowiak.plist.PlistSerializerImpl} internally.
 * {@link CollectionHandler}, {@link MapHandler}
 *
 * @author Maciej Walkowiak
 */
public abstract class AbstractHandler implements Handler {
	protected PlistSerializerImpl plistSerializer;

// Path: src/main/java/pl/maciejwalkowiak/plist/PlistSerializerImpl.java
// public class PlistSerializerImpl implements PlistSerializer {
// 	private static final Logger logger = LoggerFactory.getLogger(PlistSerializerImpl.class);
// 
// 	private HandlerWrapper handlerWrapper;
// 	private BasicObjectSerializer basicObjectSerializer;
// 	private FieldSerializer fieldSerializer;
// 	private NamingStrategy namingStrategy = new DefaultNamingStrategy();
// 
// 	public PlistSerializerImpl(NamingStrategy namingStrategy) {
// 		this();
// 		this.namingStrategy = namingStrategy;
// 	}
// 
// 	public PlistSerializerImpl() {
// 		this.handlerWrapper = new HandlerWrapper(this);
// 		this.fieldSerializer = new FieldSerializer(handlerWrapper, this);
// 		this.basicObjectSerializer = new BasicObjectSerializer(handlerWrapper);
// 	}
// 
// 	public String toXmlPlist(Object objectToConvert) {
// 		StringBuilder result = new StringBuilder(HEADER);
// 
// 		result.append(serialize(objectToConvert));
// 
// 		result.append(FOOTER);
// 
// 		return result.toString();
// 	}
// 
// 	public String serialize(Object objectToConvert) {
// 		StringBuilder result = new StringBuilder();
// 
// 		logger.debug("converting object = {}", objectToConvert);
// 
// 		if (objectToConvert != null) {
// 			if (handlerWrapper.isSupported(objectToConvert)) {
// 				result.append(basicObjectSerializer.serializeBasicObject(objectToConvert));
// 			} else {
// 				result.append(fieldSerializer.serializeFields(objectToConvert));
// 			}
// 		}
// 
// 		return result.toString();
// 	}
// 
// 	public void setAdditionalHandlers(List<Handler> additionalHandlers) {
// 		handlerWrapper.addAdditionalHandlers(additionalHandlers);
// 	}
// 
// 	public NamingStrategy getNamingStrategy() {
// 		return namingStrategy;
// 	}
// 
// 	HandlerWrapper getHandlerWrapper() {
// 		return handlerWrapper;
// 	}
// }


// Path: src/main/java/pl/maciejwalkowiak/plist/handler/AbstractHandler.java
import pl.maciejwalkowiak.plist.PlistSerializerImpl;

/*
 * Copyright (c) 2012 Maciej Walkowiak
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

package pl.maciejwalkowiak.plist.handler;


/**
 * Used for handlers that need to use {@link pl.maciejwalkowiak.plist.PlistSerializerImpl} internally.
 * {@link CollectionHandler}, {@link MapHandler}
 *
 * @author Maciej Walkowiak
 */
public abstract class AbstractHandler implements Handler {
	protected PlistSerializerImpl plistSerializer;

	protected AbstractHandler(PlistSerializerImpl plistSerializer) {