Package org.apache.jackrabbit.mk.json

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


        return Iterables.transform(node.getPropertyNames(), new Function<String, PropertyState>() {
            @Override
            public PropertyState apply(String name) {
                String value = node.getProperty(name);
                JsopReader reader = new JsopTokenizer(value);
                if (reader.matches('[')) {
                    return readArrayProperty(name, reader);
                } else {
                    return readProperty(name, reader);
                }
            }
View Full Code Here


                        id = new String(reader.read(JsopReader.STRING));
                        if (id.equals(hash)) {
                            // save some memory
                            id = hash;
                        }
                    } else if (reader.matches('{')) {
                        reader.read('}');
                        childNames.add(name);
                    } else if (reader.matches('[')) {
                        properties.put(name, readArrayProperty(name, reader));
                    } else {
View Full Code Here

                            id = hash;
                        }
                    } else if (reader.matches('{')) {
                        reader.read('}');
                        childNames.add(name);
                    } else if (reader.matches('[')) {
                        properties.put(name, readArrayProperty(name, reader));
                    } else {
                        properties.put(name, readProperty(name, reader));
                    }
                } while (reader.matches(','));
View Full Code Here

                    } else if (reader.matches('[')) {
                        properties.put(name, readArrayProperty(name, reader));
                    } else {
                        properties.put(name, readProperty(name, reader));
                    }
                } while (reader.matches(','));
                reader.read('}');
                reader.read(JsopReader.END);
                // optimize for empty childNodes
                if (childNames.isEmpty()) {
                    childNames = Collections.emptySet();
View Full Code Here

                JsopReader reader = new JsopTokenizer(json);
                reader.read('{');
                do {
                    String name = StringCache.get(reader.readString());
                    reader.read(':');
                    if (reader.matches('{')) {
                        reader.read('}');
                        entries.add(new KernelChildNodeEntry(name));
                    } else if (reader.matches('[')) {
                        while (reader.read() != ']') {
                            // skip
View Full Code Here

                    String name = StringCache.get(reader.readString());
                    reader.read(':');
                    if (reader.matches('{')) {
                        reader.read('}');
                        entries.add(new KernelChildNodeEntry(name));
                    } else if (reader.matches('[')) {
                        while (reader.read() != ']') {
                            // skip
                        }
                    } else {
                        reader.read();
View Full Code Here

                            // skip
                        }
                    } else {
                        reader.read();
                    }
                } while (reader.matches(','));
                reader.read('}');
                reader.read(JsopReader.END);
                return entries.iterator();
            }
        };
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

        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

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.