<groupId>com.googlecode.jtype</groupId> <artifactId>jtype</artifactId> <version>0.1.1</version>
808182838485868788
PathImpl path; if (propertyPath.isRootPath()) { path = PathImpl.create(name); } else { path = PathImpl.copy(propertyPath); path.addNode(new NodeImpl(name)); } return new NodeBuilderDefinedContextImpl(parent, messageTemplate, path); }
8889909192939495
path.getLeafNode().setKey(key); } @Override public void moveDown(MetaProperty prop, AccessStrategy access) { path.addNode(new NodeImpl(prop.getName())); super.moveDown(prop, access); }
155156157158159160161162163
* @return the path in dot notation */ public PathImpl getPropertyPath() { PathImpl currentPath = PathImpl.copy(path); if (getMetaProperty() != null) { currentPath.addNode(new NodeImpl(getMetaProperty().getName())); } return currentPath; }
191192193194195196197198199200201
} } private boolean isReachable(GroupValidationContext context) { PathImpl path = context.getPropertyPath(); NodeImpl node = path.getLeafNode(); PathImpl beanPath = path.getPathWithoutLeafNode(); if (beanPath == null) { beanPath = PathImpl.create(null); } try {
135136137138139140141142143144145146147148
assertEquals(null, path.iterator().next().getName()); } public void testToString() { PathImpl path = PathImpl.create(null); path.addNode(new NodeImpl("firstName")); assertEquals("firstName", path.toString()); path = PathImpl.create(null); path.getLeafNode().setIndex(2); assertEquals("[2]", path.toString()); path.addNode(new NodeImpl("firstName")); assertEquals("[2].firstName", path.toString()); }
261262263264265266267268269270271
* <code>false</code> otherwise. */ private boolean isCascadable(GroupValidationContext<?> context, MetaProperty prop, AccessStrategy access) { PathImpl beanPath = context.getPropertyPath(); NodeImpl node = new NodeImpl(prop.getName()); if (beanPath == null) { beanPath = PathImpl.create(null); } try { if (!context.getTraversableResolver().isReachable(
868788899091929394959697
/** * {@inheritDoc} */ @Override public void setCurrentIndex(Integer index) { NodeImpl leaf = path.getLeafNode(); if (leaf.getName() == null) { leaf.setIndex(index); } else { path.addNode(NodeImpl.atIndex(index)); } }
99100101102103104105106107108109110
/** * {@inheritDoc} */ @Override public void setCurrentKey(Object key) { NodeImpl leaf = path.getLeafNode(); if (leaf.getName() == null) { leaf.setKey(key); } else { path.addNode(NodeImpl.atKey(key)); } }
121122123124125126127128129130131132133
/** * {@inheritDoc} */ @Override public void moveUp(Object bean, MetaBean metaBean) { NodeImpl leaf = path.getLeafNode(); if (leaf.isInIterable() && leaf.getName() != null) { leaf.setName(null); } else { path.removeLeafNode(); } super.moveUp(bean, metaBean); // call super! }
172173174175176177178179180181182
* uses prop[index] in property path for elements in to-many-relationships. * * @return the path in dot notation */ public PathImpl getPropertyPath() { PathImpl currentPath = PathImpl.copy(path); if (getMetaProperty() != null) { currentPath.addNode(new NodeImpl(getMetaProperty().getName())); } return currentPath; }