Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.platform.contentview.json
Class DocumentModelToJSON

java.lang.Object
  extended by org.nuxeo.ecm.platform.contentview.json.DocumentModelToJSON
All Implemented Interfaces:
PropertyVisitor

public class DocumentModelToJSON
extends Object
implements PropertyVisitor

Transforms a document model properties into a json object.

Only non-null properties are exported.

Since:
5.4.2

Constructor Summary
DocumentModelToJSON()
           
 
Method Summary
 boolean acceptPhantoms()
           
 net.sf.json.JSONObject getResult()
           
 net.sf.json.JSONObject run(DocumentModel doc)
           
 Object visit(DocumentPart property, Object arg)
           
 Object visit(ListProperty property, Object arg)
           
 Object visit(MapProperty property, Object arg)
           
 Object visit(ScalarProperty property, Object arg)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentModelToJSON

public DocumentModelToJSON()
Method Detail

getResult

public net.sf.json.JSONObject getResult()

run

public net.sf.json.JSONObject run(DocumentModel doc)
                           throws ClientException
Throws:
ClientException

acceptPhantoms

public boolean acceptPhantoms()
Specified by:
acceptPhantoms in interface PropertyVisitor

visit

public Object visit(DocumentPart property,
                    Object arg)
             throws PropertyException
Specified by:
visit in interface PropertyVisitor
Throws:
PropertyException

visit

public Object visit(MapProperty property,
                    Object arg)
             throws PropertyException
Specified by:
visit in interface PropertyVisitor
Throws:
PropertyException

visit

public Object visit(ListProperty property,
                    Object arg)
             throws PropertyException
Specified by:
visit in interface PropertyVisitor
Throws:
PropertyException

visit

public Object visit(ScalarProperty property,
                    Object arg)
             throws PropertyException
Specified by:
visit in interface PropertyVisitor
Throws:
PropertyException

Nuxeo Enterprise Platform 5.4

Copyright © 2011 Nuxeo SAS. All Rights Reserved.