Package org.apache.jackrabbit.mk.json

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


        String result = mk.getNodes("/", mk.getHeadRevision(), 0, 0, -1, null);
        List<String> names = new ArrayList<String>();
        List<String> properties = new ArrayList<String>();
        JsopReader t = new JsopTokenizer(result);
        t.read('{');
        if (!t.matches('}')) {
            do {
                String key = t.readString();
                t.read(':');
                if (t.matches('{')) {
                    names.add(key);
View Full Code Here


        t.read('{');
        if (!t.matches('}')) {
            do {
                String key = t.readString();
                t.read(':');
                if (t.matches('{')) {
                    names.add(key);
                    NodeImpl.parse(new NodeMap(), t, 0);
                } else {
                    if (!key.equals(":childNodeCount")) {
                        properties.add(key);
View Full Code Here

                    } else if (!key.equals(":hash")) {
                        properties.add(key);
                    }
                    t.readRawValue();
                }
            } while (t.matches(','));
            t.read('}');
        }
        if (!names.isEmpty()) {
            JsopBuilder buff = new JsopBuilder();
            for (String name : names) {
View Full Code Here

    //----------------------------< internal >----------------------------------

    private PropertyState parsed() {
        if (parsed == null) {
            JsopReader reader = new JsopTokenizer(value);
            if (reader.matches('[')) {
                parsed = readArrayProperty(name, reader);
            } else {
                parsed = readProperty(name, reader);
            }
        }
View Full Code Here

                    commit.removeNodeDiff(path);
                    break;
                case '^':
                    t.read(':');
                    String value;
                    if (t.matches(JsopReader.NULL)) {
                        value = null;
                    } else {
                        value = t.readRawValue().trim();
                    }
                    String p = PathUtils.getParentPath(path);
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, kernel));
            }
        }
    }
View Full Code Here

                if (":childNodeCount".equals(name)) {
                    childNodeCount =
                            Long.valueOf(reader.read(JsopReader.NUMBER));
                } else if (":hash".equals(name)) {
                    hash = reader.read(JsopReader.STRING);
                } else if (reader.matches('{')) {
                    reader.read('}');
                    String childPath = path + '/' + name;
                    if ("/".equals(path)) {
                        childPath = '/' + name;
                    }
View Full Code Here

                    String childPath = path + '/' + name;
                    if ("/".equals(path)) {
                        childPath = '/' + name;
                    }
                    childPaths.put(name, childPath);
                } else if (reader.matches('[')) {
                    List<CoreValue> values = listFromJsopReader(reader, kernel);
                    properties.put(name, new MultiPropertyState(name, values));
                } else {
                    CoreValue cv = fromJsopReader(reader, kernel);
                    properties.put(name, new SinglePropertyState(name, cv));
View Full Code Here

                    properties.put(name, new MultiPropertyState(name, values));
                } else {
                    CoreValue cv = fromJsopReader(reader, kernel);
                    properties.put(name, new SinglePropertyState(name, cv));
                }
            } while (reader.matches(','));
            reader.read('}');
            reader.read(JsopReader.END);
            // optimize for empty childNodes
            if (childPaths.isEmpty()) {
                childPaths = Collections.emptyMap();
View Full Code Here

                JsopReader reader = new JsopTokenizer(json);
                reader.read('{');
                do {
                    String name = reader.readString();
                    reader.read(':');
                    if (reader.matches('{')) {
                        reader.read('}');
                        String childPath = getChildPath(name);
                        entries.add(new KernelChildNodeEntry(name, childPath));
                    } else if (reader.matches('[')) {
                        while (reader.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.