public void transform(Object object) {
        JSONContext context = getContext();
        Path path = context.getPath();
        ChainedSet visits = context.getVisits();
        try {
            if (!visits.contains(object)) {
                context.setVisits(new ChainedSet(visits));
                context.getVisits().add(object);
                // traverse object
                BeanAnalyzer analyzer = BeanAnalyzer.analyze( resolveClass(object) );
                TypeContext typeContext = context.writeOpenObject();
                for( BeanProperty prop : analyzer.getProperties() ) {
                    String name = prop.getName();
                    path.enqueue(name);
                    if( context.isIncluded(prop) ) {
                        Object value = prop.getValue( object );
                        if (!context.getVisits().contains(value)) {

                            TransformerWrapper transformer = (TransformerWrapper)context.getTransformer(value);

                            if(!transformer.isInline()) {
                                if (!typeContext.isFirst()) context.writeComma();
                                typeContext.setFirst(false);
                                context.writeName(name);
                            }
                            typeContext.setPropertyName(name);

                            transformer.transform(value);
                        }
                    }
                    path.pop();
                }
                context.writeCloseObject();
                context.setVisits((ChainedSet) context.getVisits().getParent());

            }
        } catch (JSONException e) {
            throw e;
        } catch (Exception e) {
            throw new JSONException("Error trying to deepSerialize", e);
        }
    }