private static void serializeObject ( final Object obj , final ContentHandler handler ) throws SAXException { if ( obj instanceof Map ) { serializeMap ( ( Map ) obj , handler ) ; } else if ( obj instanceof List ) { serializeList ( ( List ) obj , handler ) ; } else if ( obj instanceof Number ) { if ( obj instanceof Double || obj instanceof Float ) { serializeReal ( ( Number ) obj , handler ) ; } else { serializeInteger ( ( Number ) obj , handler ) ; } } else if ( obj instanceof Boolean ) { serializeBoolean ( ( Boolean ) obj , handler ) ; } else { serializeString ( String . valueOf ( obj ) , handler ) ; } }
Serialize an object using the best available element .