Click here to Skip to main content
15,897,166 members
Articles / Mobile Apps / Android

Drupal with Android Integration: Make Posts and Upload Photos - Part I - Drupal

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
13 Mar 2013CPOL4 min read 30.6K   167   5  
Make posts and upload photos
/*
    Copyright (c) 2005 Redstone Handelsbolag

    This library is free software; you can redistribute it and/or modify it under the terms
    of the GNU Lesser General Public License as published by the Free Software Foundation;
    either version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
    without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    See the GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License along with this
    library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
    Boston, MA  02111-1307  USA
*/

package redstone.xmlrpc;

import java.io.IOException;
import java.io.Writer;

/**
 *  Java objects are serialized into XML-RPC values using instances of classes
 *  implementing the XmlRpcCustomSerializer class. When processing an argument or a return
 *  value for an XML-RPC call, the XmlRpcSerializer will look through its list of
 *  XmlRpcCustomSerializer objects for a serializer that matches the object type of the
 *  value. The getValueClass() returns the Class supported by that serializer.
 *
 *  <p>A number of serializers for common types are already implemented, but you may
 *  wish to add custom serializers for special types of Java objects.</p>
 *
 *  @author Greger Olsson
 */

public interface XmlRpcCustomSerializer
{
    /**
     *  Returns the class of objects this serializer knows how to handle.
     *
     *  @return The class of objects interpretable to this serializer.
     */

    Class getSupportedClass();


    /**
     *  Asks the custom serializer to serialize the supplied value into the supplied
     *  writer. The supplied value will be of the type reported in getSupportedClass()
     *  or of a type extending therefrom.
     *
     *  @param value The object to serialize.
     *
     *  @param output The writer to place the serialized data.
     *  
     *  @param builtInSerializer The built-in serializer used by the client or the server.
     *
     *  @throws XmlRpcException if the value somehow could not be serialized. Many serializers
     *                          rely on the built in serializer which also may throw this
     *                          exception.
     * 
     *  @throws IOException if there was an error serializing the value through the
     *                       writer. The exception is the exception thrown by the
     *                       writer, which in most cases will be a StringWriter, in which
     *                       case this exception will never occurr. XmlRpcSerializer and
     *                       custom serializers may, however, be used outside of the
     *                       XML-RPC library to encode information in XML-RPC structs, in
     *                       which case the writer potentially could be writing the
     *                       information over a socket stream for instance.
     */

    void serialize(
        Object value,
        Writer output,
        XmlRpcSerializer builtInSerializer )
        throws XmlRpcException, IOException;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
CEO BitGriff LLC
Russian Federation Russian Federation
My name is Andrey Moskvichev.

I'm a software developer with more than 14 years of programming experience.

I specialize in networking, Unix systems (Linux, FreeBSD), mobile programming, computer graphics, software architecture, reverse engineering, data processing systems, AI, computer vision.

I'm interested in all new cutting edge technologies.

Comments and Discussions