NodeId id = getId(); nodeInfo = new NodeInfoImpl(getPath(), id, index, primaryTypeName, mixins.toArray(new Name[mixins.size()]), Iterators.<PropertyId>empty(), getPropertyIds(), includeChildInfos ? getChildInfos() : null); listener.createChildInfos(id, getChildInfos()); parent.addNodeInfo(nodeInfo); return parent;
listener.createPropertyInfo(propertyInfo); return parent.addPropertyInfo(propertyInfo);
private void addNodes(NodeInfoBuilder builder, String name) throws RepositoryException { if (name.length() >= TREE_DEPTH) { builder.build(); nodePaths.add(toJCRPath(builder.getNodeInfo().getPath())); return; } for (int k = 0; k <= NODE_COUNT; k++) { String n = name + k; addNodes(addProperties(builder.createNodeInfo(n), PROPERTY_COUNT), n); } builder.build(); }
listener.createPropertyInfo(propertyInfo); return parent.addPropertyInfo(propertyInfo);
NodeId id = getId(); nodeInfo = new NodeInfoImpl(getPath(), id, index, primaryTypeName, mixins.toArray(new Name[mixins.size()]), Iterators.<PropertyId>empty(), getPropertyIds(), includeChildInfos ? getChildInfos() : null); listener.createChildInfos(id, getChildInfos()); parent.addNodeInfo(nodeInfo); return parent;
@Override protected void initInfosStore(NodeInfoBuilder builder) throws RepositoryException { // build up a hierarchy of items builder .createNodeInfo("node1") .createNodeInfo("node11").build() .createNodeInfo("node12").build() .createNodeInfo("node13").build() .createPropertyInfo("property11", "value11").build() .createPropertyInfo("property12", "value12").build() .build() .createNodeInfo("node2") .createNodeInfo("node21") .createNodeInfo("node211") .createNodeInfo("node2111") .createNodeInfo("node21111") .createNodeInfo("node211111") .createNodeInfo("node2111111").build() .build() .build() .build() .build() .build() .build() .createNodeInfo("node3").build() .build(); }
private Path getPath() throws RepositoryException { if (localName == null && name == null) { throw new IllegalStateException("Name not set"); } if (parent == null && parentPath == null) { return PathFactoryImpl.getInstance().getRootPath(); } else { Path path = parentPath == null ? parent.getPath() : parentPath; if (name == null) { String ns = namespace == null ? Name.NS_DEFAULT_URI : namespace; name = NameFactoryImpl.getInstance().create(ns, localName); } return PathFactoryImpl.getInstance().create(path, name, true); } }
private Path getPath() throws RepositoryException { if (localName == null && name == null) { throw new IllegalStateException("Name not set"); } if (parent == null && parentPath == null) { return PathFactoryImpl.getInstance().getRootPath(); } else { Path path = parentPath == null ? parent.getPath() : parentPath; if (name == null) { String ns = namespace == null ? Name.NS_DEFAULT_URI : namespace; name = NameFactoryImpl.getInstance().create(ns, localName); } return PathFactoryImpl.getInstance().create(path, name, true); } }
/** * Return a {@link NodeInfoBuilder} for a node with a given <code>localName</code>. * @param localName localName of the node * @param listener {@link Listener} to receive notifications about {@link NodeInfo}s, * {@link PropertyInfo}s and {@link ChildInfo}s built. * @return */ public static NodeInfoBuilder nodeInfoBuilder(String localName, Listener listener) { return new NodeInfoBuilder(null, localName, listener); }
/** * Create a new child {@link NodeInfo} on this NodeInfo with a given <code>localName</code>. * @param localName * @return <code>this</code> */ public NodeInfoBuilder createNodeInfo(String localName) { return new NodeInfoBuilder(this, localName, listener); }
/** * Return a {@link NodeInfoBuilder} for a node with a given <code>name</code>. * @param name name of the node * @param listener {@link Listener} to receive notifications about {@link NodeInfo}s, * {@link PropertyInfo}s and {@link ChildInfo}s built. * @return */ public static NodeInfoBuilder nodeInfoBuilder(Name name, Listener listener) { return new NodeInfoBuilder(null, name, listener); }
/** * Return a {@link NodeInfoBuilder} for a node with a given <code>name</code>. * @param name name of the node * @param listener {@link Listener} to receive notifications about {@link NodeInfo}s, * {@link PropertyInfo}s and {@link ChildInfo}s built. * @return */ public static NodeInfoBuilder nodeInfoBuilder(Name name, Listener listener) { return new NodeInfoBuilder(null, name, listener); }
private NodeInfoBuilder addProperties(NodeInfoBuilder builder, int count) throws RepositoryException { for (int k = 0; k < count; k++) { PropertyInfoBuilder pBuilder = builder.createPropertyInfo("property_" + k, "Just some string value " + k); pBuilder.build(); propertyPaths.add(toJCRPath(pBuilder.getPropertyInfo().getPath())); } return builder; }
/** * Create a new child {@link NodeInfo} on this NodeInfo. * @return <code>this</code> */ public NodeInfoBuilder createNodeInfo() { return new NodeInfoBuilder(this, (String) null, listener); }
private NodeId getId() throws RepositoryException { if (uuid == null) { return IdFactoryImpl.getInstance().createNodeId((String) null, getPath()); } else { return IdFactoryImpl.getInstance().createNodeId(uuid); } }
/** * Return a {@link NodeInfoBuilder} for a node with a given <code>localName</code>. * @param localName localName of the node * @param listener {@link Listener} to receive notifications about {@link NodeInfo}s, * {@link PropertyInfo}s and {@link ChildInfo}s built. * @return */ public static NodeInfoBuilder nodeInfoBuilder(String localName, Listener listener) { return new NodeInfoBuilder(null, localName, listener); }
/** * Create a new child {@link NodeInfo} on this NodeInfo. * @return <code>this</code> */ public NodeInfoBuilder createNodeInfo() { return new NodeInfoBuilder(this, (String) null, listener); }
/** * Create a new child {@link NodeInfo} on this NodeInfo with a given <code>localName</code>. * @param localName * @return <code>this</code> */ public NodeInfoBuilder createNodeInfo(String localName) { return new NodeInfoBuilder(this, localName, listener); }
private NodeId getId() throws RepositoryException { if (uuid == null) { return IdFactoryImpl.getInstance().createNodeId((String) null, getPath()); } else { return IdFactoryImpl.getInstance().createNodeId(uuid); } }