Package org.codehaus.jettison.json

Examples of org.codehaus.jettison.json.JSONObject.keys()


    protected List<String> getNonRexsterRequestKeys() throws JSONException {
        final List<String> keys = new ArrayList<String>();
        final JSONObject request = this.getNonRexsterRequest();
        if (request.length() > 0) {
            final Iterator itty = request.keys();
            while (itty.hasNext()) {
                keys.add((String) itty.next());
            }
        }
        return keys;
View Full Code Here


            JSONObject graphJson = graphResponse.getEntity(JSONObject.class);

            final JSONObject featuresJson = graphJson.optJSONObject("features");
            final Map<String, Boolean> features = new HashMap<String, Boolean>();
            Iterator<String> keys = featuresJson.keys();
            while (keys.hasNext()) {
                final String key = keys.next();
                features.put(key, featuresJson.optBoolean(key));
            }
           
View Full Code Here

            com.tinkerpop.blueprints.util.ElementHelper.removeProperties(new ArrayList<Element>() {{
                add(vertex);
            }});

            final JSONObject theRequestObject = this.getRequestObject();
            final Iterator keys = theRequestObject.keys();
            while (keys.hasNext()) {
                final String key = keys.next().toString();
                if (!key.startsWith(Tokens.UNDERSCORE)) {
                    vertex.setProperty(key, ElementHelper.getTypedPropertyValue(theRequestObject.get(key), parseTypes));
                }
View Full Code Here

    private static void placeParametersOnBinding(final JSONObject requestObject, final Bindings bindings, final boolean parseTypes) {
        if (requestObject != null) {
            JSONObject paramMap = requestObject.optJSONObject(PARAMS);
            if (paramMap != null) {
                final Iterator keyIterator = paramMap.keys();
                while (keyIterator.hasNext()) {
                    final String key = (String) keyIterator.next();
                    bindings.put(key, ElementHelper.getTypedPropertyValue(paramMap.opt(key), parseTypes));
                }
            }
View Full Code Here

                typedPropertyValue = null;
            } else if (propertyValue instanceof JSONObject) {
                JSONObject innerJson = (JSONObject) propertyValue;
                HashMap<String, Object> properties = new HashMap<String, Object>();

                Iterator itty = innerJson.keys();
                while (itty.hasNext()) {
                    String key = (String) itty.next();
                    properties.put(key, getTypedPropertyValue(innerJson.opt(key), parseTypes));
                }
View Full Code Here

            final JSONObject theRequestObject = this.getRequestObject();
            final GraphSONMode mode = showTypes ? GraphSONMode.EXTENDED : GraphSONMode.NORMAL;
            final Set<String> returnKeys = RequestObjectHelper.getReturnKeys(theRequestObject);

            final Iterator keys = theRequestObject.keys();
            while (keys.hasNext()) {
                final String key = keys.next().toString();
                if (!key.startsWith(Tokens.UNDERSCORE)) {
                    edge.setProperty(key, ElementHelper.getTypedPropertyValue(theRequestObject.get(key), parseTypes));
                }
View Full Code Here

                k = k.substring(1);
                if (k.equals("xmlns")) {
                    // if its a string its a default namespace
                    if (o instanceof JSONObject) {
                        JSONObject jo = (JSONObject) o;
                        for (Iterator pitr = jo.keys(); pitr.hasNext(); ) {
                            String prefix = (String) pitr.next();
                            String uri = jo.getString(prefix);

                            if (prefix.equals("$")) {
                                prefix = "";
View Full Code Here

                k = k.substring( 1 );
                if ( k.equals( "xmlns" ) ) {
                    // if its a string its a default namespace
                    if ( o instanceof JSONObject ) {
                        JSONObject jo = (JSONObject) o;
                        for (Iterator pitr = jo.keys(); pitr.hasNext();) {
                            // set namespace if one is specified on this attribute.
                            String prefix = (String) pitr.next();
                            String uri = jo.getString( prefix );

                            //                            if ( prefix.equals( "$" ) ) {
View Full Code Here

        try {
            if (!object.has("children")) {
                throw new RuntimeException("Invalid JSON object: " + object);
            }
            JSONObject children = object.getJSONObject("children");
            for (Iterator<String> itr = children.keys(); itr.hasNext(); ) {
                String key = itr.next();
                JSONObject child = children.getJSONObject(key);
                if (child != null) {
                    // and that means that each child is a JSONObject ...
                    NodeType nodeType = new NodeType(child, this);
View Full Code Here

        // Process the children (the property definition and child node definition objects) ...
        if (json.has("children")) {
            try {
                JSONObject children = json.getJSONObject("children");
                for (Iterator<String> itr = children.keys(); itr.hasNext(); ) {
                    String key = itr.next();
                    JSONObject child = children.getJSONObject(key);
                    if (child != null) {
                        // Get the primary type of this child object ...
                        String type = getPrimaryType(key, child);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.