Package org.apache.jackrabbit.mk.json

Examples of org.apache.jackrabbit.mk.json.JsopTokenizer.matches()


                buff.append(changes);
            }
            // the first revision isn't new, all others are
            isNew = true;
            t.read('}');
        } while (t.matches(','));
        journalRevision = head;
        return buff.toString();
    }

}
View Full Code Here


    @Test
    public void testListFromJsopReader() throws IOException {
        for (String json : mvValueMap.keySet()) {
            List<CoreValue> values = mvValueMap.get(json);
            JsopReader reader = new JsopTokenizer(json);
            if (reader.matches('[')) {
                assertEquals(values, CoreValueMapper.listFromJsopReader(reader, valueFactory));
            }
        }
    }
View Full Code Here

                String key = t.readString();
                t.read(':');
                t.read();
                String value = t.getToken();
                map.put(key, value);
            } while (t.matches(','));
            String rev = map.get("id");
            if (!rev.equals(readRevision)) {
                String jsop = map.get("changes");
                JsopTokenizer tokenizer = new JsopTokenizer(jsop);
                updateIndex("", tokenizer, lastRevision);
View Full Code Here

        }
    }

    private void addOrRemoveRaw(String nodePath, String value, boolean add) {
        JsopTokenizer t = new JsopTokenizer(value);
        if (t.matches(JsopReader.STRING) || t.matches(JsopReader.NUMBER)) {
            String v = t.getToken();
            addOrRemove(nodePath, v, add);
        }
    }
View Full Code Here

        }
    }

    private void addOrRemoveRaw(String nodePath, String value, boolean add) {
        JsopTokenizer t = new JsopTokenizer(value);
        if (t.matches(JsopReader.STRING) || t.matches(JsopReader.NUMBER)) {
            String v = t.getToken();
            addOrRemove(nodePath, v, add);
        }
    }
View Full Code Here

    }

    public static NodeImpl fromString(NodeMap map, String s) {
        JsopTokenizer t = new JsopTokenizer(s);
        NodeImpl node = new NodeImpl(map, 0);
        if (!t.matches('{')) {
            node.id = map.parseId(t.readRawValue());
            t.read('=');
            t.read('{');
        }
        boolean descendantCountSet = false;
View Full Code Here

            node.id = map.parseId(t.readRawValue());
            t.read('=');
            t.read('{');
        }
        boolean descendantCountSet = false;
        if (!t.matches('}')) {
            do {
                String key = t.readString();
                t.read(':');
                String value = t.readRawValue();
                if (key.length() > 0 && key.charAt(0) == ':') {
View Full Code Here

                        node.descendantInlineCount += 1 + id.getNode(map).descendantInlineCount;
                    }
                } else {
                    node.setProperty(key, value);
                }
            } while (t.matches(','));
            t.read('}');
        }
        return node;
    }
View Full Code Here

                String key = t.readString();
                t.read(':');
                t.read();
                String value = t.getToken();
                map.put(key, value);
            } while (t.matches(','));
            String rev = map.get("rev");
            if (rev != null) {
                readRevision = rev;
            }
            for (String k : map.keySet()) {
View Full Code Here

            return new String[0];
        }
        ArrayList<String> dataList = new ArrayList<String>();
        JsopTokenizer t = new JsopTokenizer(json);
        t.read('[');
        if (!t.matches(']')) {
            do {
                dataList.add(t.readString());
            } while (t.matches(','));
            t.read(']');
        }
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.