graphdb/src/main/java/com/orientechnologies/orient/graph/graphml/OGraphSONUtility.java
public static JSONObject jsonFromElement(final Element element, final Set<String> propertyKeys, final GraphSONMode mode)
      throws JSONException {
    final OGraphSONUtility graphson = element instanceof Edge ? new OGraphSONUtility(mode, null, null, propertyKeys)
        : new OGraphSONUtility(mode, null, propertyKeys, null);
    return graphson.jsonFromElement(element);
  }
public static JSONObject jsonFromElement(final Element element, final Set<String> propertyKeys, final GraphSONMode mode)
      throws JSONException {
    final OGraphSONUtility graphson = element instanceof Edge ? new OGraphSONUtility(mode, null, null, propertyKeys)
        : new OGraphSONUtility(mode, null, propertyKeys, null);
    return graphson.jsonFromElement(element);
  }
public static JSONObject jsonFromElement ( final Element element , final Set < String > propertyKeys , final GraphSONMode mode ) throws JSONException { final OGraphSONUtility graphson = element instanceof Edge ? new OGraphSONUtility ( mode , null , null , propertyKeys ) : new OGraphSONUtility ( mode , null , propertyKeys , null ) ; return graphson . jsonFromElement ( element ) ; }
Creates a Jettison JSONObject from a graph element.

@param element
the graph element to convert to JSON.
@param propertyKeys
The property keys at the root of the element to serialize. If null, then all keys are serialized.
@param mode
the type of GraphSON to be generated.
Creates a Jettison JSONObject from a graph element .