public static JSONObject jsonFromElement(final AtlasElement element, final Set<String> propertyKeys,
                                             final AtlasGraphSONMode mode)
        throws JSONException {

        final AtlasGraphSONUtility graphson = element instanceof AtlasEdge
                ? new AtlasGraphSONUtility(mode, null, propertyKeys)
                : new AtlasGraphSONUtility(mode, propertyKeys, null);
        return graphson.jsonFromElement(element);
    }
public static JSONObject jsonFromElement ( final AtlasElement element , final Set < String > propertyKeys , final AtlasGraphSONMode mode ) throws JSONException { final AtlasGraphSONUtility graphson = element instanceof AtlasEdge ? new AtlasGraphSONUtility ( mode , null , propertyKeys ) : new AtlasGraphSONUtility ( mode , 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 getPropertyKeys() at the root of the element to
serialize. If null, then all getPropertyKeys() are serialized.
@param mode
the type of GraphSON to be generated.