@Override public EventFilter createFilter(NodeState before, NodeState after) { if (after.exists()) { predicate = new TypePredicate(after, nodeTypes); } else { predicate = new TypePredicate(before, nodeTypes); } return this; }
@Override public boolean includeReorder(String destName, String name, NodeState reordered) { return includeThis && predicate.apply(reordered); }
public boolean apply(String primary, Set<String> mixins) { init(); if (primaryTypes != null && primaryTypes.contains(primary)) { return true; } if (mixinTypes != null && any(mixins, in(mixinTypes))) { return true; } return false; }
public IdentifierTracker(NodeState root) { this.referenceable = new TypePredicate(root, MIX_REFERENCEABLE); this.parent = null; this.name = null; String uuid = root.getString(JCR_UUID); if (uuid != null && referenceable.apply(root)) { this.identifier = uuid; } else { this.identifier = "/"; } }
this.loader = new BundleLoader(source); this.workspaceName = workspaceName; this.isReferenceable = new TypePredicate(root, MIX_REFERENCEABLE); this.isOrderable = TypePredicate.isOrderable(root); this.isVersionable = new TypePredicate(root, MIX_VERSIONABLE); this.isVersionHistory = new TypePredicate(root, NT_VERSIONHISTORY); this.isFrozenNode = new TypePredicate(root, NT_FROZENNODE); this.uriToPrefix = uriToPrefix; this.mountPoints = mountPoints;
private void init() { if (!initialized) { // lazy initialization of the sets of matching type names NodeState types = checkNotNull(root) .getChildNode(JCR_SYSTEM) .getChildNode(JCR_NODE_TYPES); for (String name : checkNotNull(names)) { addNodeType(types, name); } initialized = true; } }
private void addNodeType(NodeState types, String name) { NodeState type = types.getChildNode(name); for (String primary : type.getNames(REP_PRIMARY_SUBTYPES)) { primaryTypes = add(primaryTypes, primary); } if (type.getBoolean(JCR_ISMIXIN)) { mixinTypes = add(mixinTypes, name); // Only mixin types can have mixin descendants, so we // only fill the mixinTypes set in this branch of code. for (String mixin : type.getNames(REP_MIXIN_SUBTYPES)) { mixinTypes = add(mixinTypes, mixin); } } else { // No need to check whether the type actually exists, as if // it doesn't there should in any case be no matching content. primaryTypes = add(primaryTypes, name); } }
public IdentifierTracker(NodeState root) { this.referenceable = new TypePredicate(root, MIX_REFERENCEABLE); this.parent = null; this.name = null; String uuid = root.getString(JCR_UUID); if (uuid != null && referenceable.apply(root)) { this.identifier = uuid; } else { this.identifier = "/"; } }
this.loader = new BundleLoader(source); this.workspaceName = workspaceName; this.isReferenceable = new TypePredicate(root, MIX_REFERENCEABLE); this.isOrderable = TypePredicate.isOrderable(root); this.isVersionable = new TypePredicate(root, MIX_VERSIONABLE); this.isVersionHistory = new TypePredicate(root, NT_VERSIONHISTORY); this.isFrozenNode = new TypePredicate(root, NT_FROZENNODE); this.uriToPrefix = uriToPrefix; this.mountPoints = mountPoints;
private void init() { if (!initialized) { // lazy initialization of the sets of matching type names NodeState types = checkNotNull(root) .getChildNode(JCR_SYSTEM) .getChildNode(JCR_NODE_TYPES); for (String name : checkNotNull(names)) { addNodeType(types, name); } initialized = true; } }
private void addNodeType(NodeState types, String name) { NodeState type = types.getChildNode(name); for (String primary : type.getNames(REP_PRIMARY_SUBTYPES)) { primaryTypes = add(primaryTypes, primary); } if (type.getBoolean(JCR_ISMIXIN)) { mixinTypes = add(mixinTypes, name); // Only mixin types can have mixin descendants, so we // only fill the mixinTypes set in this branch of code. for (String mixin : type.getNames(REP_MIXIN_SUBTYPES)) { mixinTypes = add(mixinTypes, mixin); } } else { // No need to check whether the type actually exists, as if // it doesn't there should in any case be no matching content. primaryTypes = add(primaryTypes, name); } }
@Override public EventFilter createFilter(NodeState before, NodeState after) { if (after.exists()) { predicate = new TypePredicate(after, nodeTypes); } else { predicate = new TypePredicate(before, nodeTypes); } return this; }
@Override public boolean includeMove(String sourcePath, String name, NodeState moved) { return includeThis && predicate.apply(moved); }
public IdentifierTracker(NodeState root) { this.referenceable = new TypePredicate(root, MIX_REFERENCEABLE); this.parent = null; this.name = null; String uuid = root.getString(JCR_UUID); if (uuid != null && referenceable.apply(root)) { this.identifier = uuid; } else { this.identifier = "/"; } }
public boolean apply(String primary, Set<String> mixins) { init(); if (primaryTypes != null && primaryTypes.contains(primary)) { return true; } if (mixinTypes != null && any(mixins, in(mixinTypes))) { return true; } return false; }
private void init() { if (!initialized) { // lazy initialization of the sets of matching type names NodeState types = checkNotNull(root) .getChildNode(JCR_SYSTEM) .getChildNode(JCR_NODE_TYPES); for (String name : checkNotNull(names)) { addNodeType(types, name); } initialized = true; } }
private void addNodeType(NodeState types, String name) { NodeState type = types.getChildNode(name); for (String primary : type.getNames(REP_PRIMARY_SUBTYPES)) { primaryTypes = add(primaryTypes, primary); } if (type.getBoolean(JCR_ISMIXIN)) { mixinTypes = add(mixinTypes, name); // Only mixin types can have mixin descendants, so we // only fill the mixinTypes set in this branch of code. for (String mixin : type.getNames(REP_MIXIN_SUBTYPES)) { mixinTypes = add(mixinTypes, mixin); } } else { // No need to check whether the type actually exists, as if // it doesn't there should in any case be no matching content. primaryTypes = add(primaryTypes, name); } }
@Override public EventFilter createFilter(NodeState before, NodeState after) { if (after.exists()) { predicate = new TypePredicate(after, nodeTypes); } else { predicate = new TypePredicate(before, nodeTypes); } return this; }
@Override public boolean includeAdd(String name, NodeState after) { return includeThis && predicate.apply(after); }
@Test public void singleNodeTypeMiss() { NodeState node = createNodeOfType(NT_BASE); TypePredicate p = new TypePredicate(node, new String[] {NT_FILE}); assertFalse(p.apply(node)); }