@Override public void skip(long skipNum) { iterator.skip(skipNum); }
public void skip(long l) { this.propertyIterator.skip(l); }
public void skip(long skipNum) { getDelegate().skip(skipNum); }
public Iterator<Property> iterator(long first, long count) { List<Property> list = new ArrayList<Property>(); try { if (nodeModel.getObject() != null) { PropertyIterator it = nodeModel.getObject().getProperties(); if (it.getSize() > 0) { it.skip(first); for (int i = 0; i < count && it.hasNext(); i++) { Property prop = it.nextProperty(); // boolean isPrimaryType = prop.getName().equals("jcr:primaryType"); // boolean isMixinTypes = prop.getName().equals("jcr:mixinTypes"); // if (!isPrimaryType && !isMixinTypes) { list.add(prop); // } } } } } catch (InvalidItemStateException e) { // This can happen after a node has been deleted and the tree hasn't been refreshed yet } catch (RepositoryException e) { log.error(e.getMessage()); } return list.iterator(); }
public Iterator<Property> iterator(int first, int count) { List<Property> list = new ArrayList<Property>(); try { if (nodeModel.getObject() != null) { PropertyIterator it = nodeModel.getObject().getProperties(); if (it.getSize() > 0) { it.skip(first); for (int i = 0; i < count && it.hasNext(); i++) { Property prop = it.nextProperty(); // boolean isPrimaryType = prop.getName().equals("jcr:primaryType"); // boolean isMixinTypes = prop.getName().equals("jcr:mixinTypes"); // if (!isPrimaryType && !isMixinTypes) { list.add(prop); // } } } } } catch (InvalidItemStateException e) { // This can happen after a node has been deleted and the tree hasn't been refreshed yet } catch (RepositoryException e) { log.error(e.getMessage()); } return list.iterator(); }
@Test public void shouldProvidePropertyIterator() throws Exception { assertThat(iter, notNullValue()); assertThat(iter.getSize(), is(4L)); assertThat(iter.getPosition(), is(0L)); assertThat(iter.hasNext(), is(true)); assertThat(iter.nextProperty(), is(sameInstance(properties.get(0)))); assertThat(iter.getPosition(), is(1L)); assertThat(iter.hasNext(), is(true)); iter.skip(2); assertThat(iter.getPosition(), is(3L)); assertThat(iter.hasNext(), is(true)); assertThat(iter.nextProperty(), is(sameInstance(properties.get(3)))); assertThat(iter.getPosition(), is(4L)); assertThat(iter.hasNext(), is(false)); }