Package org.apache.jackrabbit.oak.core

Examples of org.apache.jackrabbit.oak.core.ReadOnlyTree


            protected Tree getTypes() {
                return types;
            }

            private Tree getTypes(NodeState after) {
                Tree tree = new ReadOnlyTree(after);
                for (String name : PathUtils.elements(NODE_TYPES_PATH)) {
                    if (tree == null) {
                        break;
                    }
                    else {
                        tree = tree.getChild(name);
                    }
                }
                return tree;
            }
        };

        return new TypeValidator(ntm, new ReadOnlyTree(after));
    }
View Full Code Here


public class PrivilegeValidatorProvider implements ValidatorProvider {

    @Nonnull
    @Override
    public Validator getRootValidator(NodeState before, NodeState after) {
        return new SubtreeValidator(new PrivilegeValidator(new ReadOnlyTree(before)), JCR_SYSTEM, REP_PRIVILEGES);
    }
View Full Code Here

    //--------------------------------------------------< ValidatorProvider >---
    @Nonnull
    @Override
    public Validator getRootValidator(NodeState before, NodeState after) {

        NodeUtil rootBefore = new NodeUtil(new ReadOnlyTree(before));
        NodeUtil rootAfter = new NodeUtil(new ReadOnlyTree(after));

        return new UserValidator(rootBefore, rootAfter, this);
    }
View Full Code Here

public class NamespaceValidatorProvider implements ValidatorProvider {

    @Override
    public Validator getRootValidator(NodeState before, NodeState after) {
        Validator validator = new NamespaceValidator(
                Namespaces.getNamespaceMap(new ReadOnlyTree(before)));
        return new SubtreeValidator(validator, JCR_SYSTEM, REP_NAMESPACES);
    }
View Full Code Here

    private boolean isVersionable() {
        if (isVersionable == null) {
            // this is not 100% correct, because t.getPath() will
            // not return the correct path for nodeAfter, but is
            // sufficient to check if it is versionable
            Tree t = new ReadOnlyTree(node.getNodeState());
            isVersionable = vMgr.isVersionable(t);
        }
        return isVersionable;
    }
View Full Code Here

        }

        NodeTypeManager manager = new ReadOnlyNodeTypeManager() {
            @Override @CheckForNull
            protected Tree getTypes() {
                return new ReadOnlyTree(types);
            }
        };

        BooleanQuery bq = new BooleanQuery();
        NodeType type = manager.getNodeType(name);
View Full Code Here

            this.root = root;
        }

        @Override
        protected Tree getTypes() {
            Tree t = new ReadOnlyTree(root);
            for (String name : PathUtils.elements(NodeTypeConstants.NODE_TYPES_PATH)) {
                t = t.getChild(name);
                if (t == null) {
                    break;
                }
            }
            return t;
View Full Code Here

    }

    public boolean include(int eventType, String path, NodeState associatedParentNode) {
        return include(eventType)
                && include(path)
                && includeByType(new ReadOnlyTree(associatedParentNode));
    }
View Full Code Here

     * @param root root node state
     * @return read-only node type manager
     */
    @Nonnull
    public static ReadOnlyNodeTypeManager getInstance(NodeState root) {
        Tree tree = new ReadOnlyTree(root).getLocation()
                .getChild(NODE_TYPES_PATH.substring(1)).getTree();

        final Tree types = tree == null
            ? new ReadOnlyTree(MemoryNodeState.EMPTY_NODE// No node types in content, use an empty node
            : tree;

        return new ReadOnlyNodeTypeManager() {
            @Override
            protected Tree getTypes() {
View Full Code Here

    @Override
    public Validator getRootValidator(NodeState before, final NodeState after) {
        ReadOnlyNodeTypeManager ntm =
                ReadOnlyNodeTypeManager.getInstance(after);
        final ReadOnlyTree root = new ReadOnlyTree(after);
        NamePathMapper mapper = new NamePathMapperImpl(new GlobalNameMapper() {
            @Override
            protected Map<String, String> getNamespaceMap() {
                return Namespaces.getNamespaceMap(root);
            }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.core.ReadOnlyTree

Copyright © 2018 www.massapicom. 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.