private void writeCollectionElement ( Object o ) throws IOException { if ( o == null ) { out . write ( "null" ) ; } else if ( o instanceof Boolean || o instanceof Double ) { writePrimitive ( o , false ) ; } else if ( o instanceof Long ) { writePrimitive ( o , writeLongsAsStrings ) ; } else if ( o instanceof String ) { // Never do an @ref to a String (they are treated as logical primitives and intern'ed on read) writeJsonUtf8String ( ( String ) o , out ) ; } else if ( neverShowType && MetaUtils . isPrimitive ( o . getClass ( ) ) ) { // If neverShowType, then force primitives (and primitive wrappers) // to be output with toString() - prevents {"value":6} for example writePrimitive ( o , false ) ; } else { writeImpl ( o , true ) ; } }
Write an element that is contained in some type of Collection or Map .