public Property addProperty(String key, Value value) throws RepositoryException { Node parent = getOrCreateParent(key); if (parent.hasProperty(key)) { throw new ItemExistsException(key); } Property p = parent.setProperty(key, value); treeManager.split(this, parent, p); if (autoSave) { p.getSession().save(); } return p; }
public boolean hasItem(String key) throws RepositoryException { return getParent(key).hasProperty(key); }
public boolean hasItem(String key) throws RepositoryException { return getParent(key).hasProperty(key); }
public Iterator<Property> iterator() { return TreeTraverser.propertyIterator(getNodeSequence().iterator(), errorHandler, inclusionPolicy); }
public Property getItem(String key) throws RepositoryException { return getParent(key).getProperty(key); }
public Iterator<Property> iterator() { return TreeTraverser.propertyIterator(getNodeSequence().iterator(), errorHandler, inclusionPolicy); }
@Override public Node getParent(String key) throws RepositoryException { return getPredecessor(key); }
public void removeProperty(String key) throws RepositoryException { Node parent = getParent(key); Property p = parent.getProperty(key); p.remove(); treeManager.join(this, parent, p); if (autoSave) { parent.getSession().save(); } }
/** * Create a new {@link PropertySequence} instance. * * @param treeManager The {@link TreeManager} for managing the mapping * between the sequence view and the JCR hierarchy. * @return */ public static PropertySequence createPropertySequence(TreeManager treeManager) { return new PropertySequenceImpl(treeManager, ErrorHandler.IGNORE); }
/** * Create a new {@link PropertySequence} instance. * * @param treeManager The {@link TreeManager} for managing the mapping * between the sequence view and the JCR hierarchy. * @param errorHandler The {@link ErrorHandler} for handling exceptions * occurring while * @return */ public static PropertySequence createPropertySequence(TreeManager treeManager, ErrorHandler errorHandler) { return new PropertySequenceImpl(treeManager, errorHandler); }
public Property getItem(String key) throws RepositoryException { return getParent(key).getProperty(key); }
@Override public Node getParent(String key) throws RepositoryException { return getPredecessor(key); }
@Override public Node getParent(String key) throws RepositoryException { return getPredecessor(key); }
public Iterator<Property> iterator() { return TreeTraverser.propertyIterator(getNodeSequence().iterator(), errorHandler, inclusionPolicy); }
public boolean hasItem(String key) throws RepositoryException { return getParent(key).hasProperty(key); }
private Node getOrCreateParent(String key) throws RepositoryException { Node p = getParent(key); if (treeManager.isRoot(p)) { Node min = getMinimal(); if (min != null) { p = min; renamePath(p, key); } } return p; }
public void removeProperty(String key) throws RepositoryException { Node parent = getParent(key); Property p = parent.getProperty(key); p.remove(); treeManager.join(this, parent, p); if (autoSave) { parent.getSession().save(); } }
/** * Create a new {@link PropertySequence} instance. * * @param treeManager The {@link TreeManager} for managing the mapping * between the sequence view and the JCR hierarchy. * @return */ public static PropertySequence createPropertySequence(TreeManager treeManager) { return new PropertySequenceImpl(treeManager, ErrorHandler.IGNORE); }
/** * Create a new {@link PropertySequence} instance. * * @param treeManager The {@link TreeManager} for managing the mapping * between the sequence view and the JCR hierarchy. * @param errorHandler The {@link ErrorHandler} for handling exceptions * occurring while * @return */ public static PropertySequence createPropertySequence(TreeManager treeManager, ErrorHandler errorHandler) { return new PropertySequenceImpl(treeManager, errorHandler); }
private Node getOrCreateParent(String key) throws RepositoryException { Node p = getParent(key); if (treeManager.isRoot(p)) { Node min = getMinimal(); if (min != null) { p = min; renamePath(p, key); } } return p; }