XMLSerializable.java :  » App » paninoonto » it » paninoonto » xml » Android Open Source

Android Open Source » App » paninoonto 
paninoonto » it » paninoonto » xml » XMLSerializable.java
package it.paninoonto.xml;

import org.json.JSONObject;

/**
 * An interface tagging a class which can be serialized/deserialized to/from an
 * XML
 * document.
 * 
 * @author Mirko Luchi
 * 
 */
public interface XMLSerializable {

    /**
     * Write the content of this class to a {@link JSONObject}.
     * @return The XML object.
     */
    public String toXML() throws Exception;

    /**
     * Write the content of the given {@link JSONObject} to this class.
     * @param xml The XML root element.
     */
    public void fromXML(String xml) throws Exception;

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.