private void _serialize(PageContext pc, Set test, Object object, StringBuilder sb, boolean serializeQueryByColumns, Set done) throws ConverterException {

	// NULL
	if (object == null || object == NULL) {
	    sb.append(goIn());
	    sb.append("null");
	    return;
	}
	// String
	if (object instanceof String || object instanceof StringBuilder) {
	    sb.append(goIn());
	    sb.append(StringUtil.escapeJS(object.toString(), '"', charsetEncoder));
	    return;
	}
	// TimeZone
	if (object instanceof TimeZone) {
	    sb.append(goIn());
	    sb.append(StringUtil.escapeJS(((TimeZone) object).getID(), '"', charsetEncoder));
	    return;
	}
	// Locale
	if (object instanceof Locale) {
	    sb.append(goIn());
	    sb.append(StringUtil.escapeJS(LocaleFactory.toString((Locale) object), '"', charsetEncoder));
	    return;
	}
	// Character
	if (object instanceof Character) {
	    sb.append(goIn());
	    sb.append(StringUtil.escapeJS(String.valueOf(((Character) object).charValue()), '"', charsetEncoder));
	    return;
	}
	// Number
	if (object instanceof Number) {
	    sb.append(goIn());
	    sb.append(Caster.toString(((Number) object)));
	    return;
	}
	// Boolean
	if (object instanceof Boolean) {
	    sb.append(goIn());
	    sb.append(Caster.toString(((Boolean) object).booleanValue()));
	    return;
	}
	// DateTime
	if (object instanceof DateTime) {
	    _serializeDateTime((DateTime) object, sb);
	    return;
	}
	// Date
	if (object instanceof Date) {
	    _serializeDate((Date) object, sb);
	    return;
	}
	// XML
	if (object instanceof Node) {
	    _serializeXML((Node) object, sb);
	    return;
	}
	// Timespan
	if (object instanceof TimeSpan) {
	    _serializeTimeSpan((TimeSpan) object, sb);
	    return;
	}
	// File
	if (object instanceof File) {
	    _serialize(pc, test, ((File) object).getAbsolutePath(), sb, serializeQueryByColumns, done);
	    return;
	}
	// String Converter
	if (object instanceof ScriptConvertable) {
	    sb.append(((ScriptConvertable) object).serialize());
	    return;
	}
	// byte[]
	if (object instanceof byte[]) {
	    sb.append("\"" + Base64Coder.encode((byte[]) object) + "\"");
	    return;
	}
private void _serialize ( PageContext pc , Set test , Object object , StringBuilder sb , boolean serializeQueryByColumns , Set done ) throws ConverterException { if ( object == null || object == NULL ) { sb . append ( goIn ( ) ) ; sb . append ( "null" ) ; return ; } if ( object instanceof String || object instanceof StringBuilder ) { sb . append ( goIn ( ) ) ; sb . append ( StringUtil . escapeJS ( object . toString ( ) , '"' , charsetEncoder ) ) ; return ; } if ( object instanceof TimeZone ) { sb . append ( goIn ( ) ) ; sb . append ( StringUtil . escapeJS ( ( ( TimeZone ) object ) . getID ( ) , '"' , charsetEncoder ) ) ; return ; } if ( object instanceof Locale ) { sb . append ( goIn ( ) ) ; sb . append ( StringUtil . escapeJS ( LocaleFactory . toString ( ( Locale ) object ) , '"' , charsetEncoder ) ) ; return ; } if ( object instanceof Character ) { sb . append ( goIn ( ) ) ; sb . append ( StringUtil . escapeJS ( String . valueOf ( ( ( Character ) object ) . charValue ( ) ) , '"' , charsetEncoder ) ) ; return ; } if ( object instanceof Number ) { sb . append ( goIn ( ) ) ; sb . append ( Caster . toString ( ( ( Number ) object ) ) ) ; return ; } if ( object instanceof Boolean ) { sb . append ( goIn ( ) ) ; sb . append ( Caster . toString ( ( ( Boolean ) object ) . booleanValue ( ) ) ) ; return ; } if ( object instanceof DateTime ) { _serializeDateTime ( ( DateTime ) object , sb ) ; return ; } if ( object instanceof Date ) { _serializeDate ( ( Date ) object , sb ) ; return ; } if ( object instanceof Node ) { _serializeXML ( ( Node ) object , sb ) ; return ; } if ( object instanceof TimeSpan ) { _serializeTimeSpan ( ( TimeSpan ) object , sb ) ; return ; } if ( object instanceof File ) { _serialize ( pc , test , ( ( File ) object ) . getAbsolutePath ( ) , sb , serializeQueryByColumns , done ) ; return ; } if ( object instanceof ScriptConvertable ) { sb . append ( ( ( ScriptConvertable ) object ) . serialize ( ) ) ; return ; } if ( object instanceof byte [ ] ) { sb . append ( "\"" + Base64Coder . encode ( ( byte [ ] ) object ) + "\"" ) ; return ; }
serialize a Object to his xml Format represenation

@param object Object to serialize
@param sb StringBuilder to write data
@param serializeQueryByColumns
@param done
@throws ConverterException