@Override public ThisType setProperty( String propertyName, Object[] values ) { return setProperty(context.getValueFactories().getNameFactory().create(propertyName), values); }
/** * Returns the named property * * @param context the current execution context, used to get a {@link NameFactory name factory} * @param name the name of the property to return * @return the property for the given name */ public Property getProperty( ExecutionContext context, String name ) { Name propertyName = context.getValueFactories().getNameFactory().create(name); return getProperty(propertyName); }
public Property getProperty( ExecutionContext context, String name ) { NameFactory nameFactory = context.getValueFactories().getNameFactory(); return getProperty(nameFactory.create(name)); }
@Override public ThisType setProperty( String propertyName, Object value ) { return setProperty(context.getValueFactories().getNameFactory().create(propertyName), value); }
public CreateAt<Graph> and( String name, Object... values ) { ExecutionContext context = getContext(); PropertyFactory factory = context.getPropertyFactory(); NameFactory nameFactory = context.getValueFactories().getNameFactory(); properties.add(factory.create(nameFactory.create(name), values)); return this; }
public Create<T> and( String name, Object... values ) { ExecutionContext context = getContext(); PropertyFactory factory = context.getPropertyFactory(); NameFactory nameFactory = context.getValueFactories().getNameFactory(); Name propertyName = nameFactory.create(name); properties.put(propertyName, factory.create(propertyName, values)); return this; }
/** * Set a property on a node, starting with the name. The interface returned from this method should be used to specify the * value(s) and the location of the node onto which the property should be set. * * @param propertyName the property name * @return the interface used to specify the values */ public SetValues<BatchConjunction> set( String propertyName ) { Name name = getContext().getValueFactories().getNameFactory().create(propertyName); return set(name); }
/** * Set a property on a node, starting with the name. The interface returned from this method should be used to specify the * value(s) and the location of the node onto which the property should be set. * * @param propertyName the property name * @return the interface used to specify the values */ public SetValues<Conjunction<Graph>> set( String propertyName ) { Name name = getContext().getValueFactories().getNameFactory().create(propertyName); return set(name); }
/** * Request that the property with the given name be read on the node defined via the <code>on(...)</code> method on the * returned {@link On} object. Once the location is specified, the {@link Property property} is read and then returned. * * @param name the name of the property that is to be read * @return the object that is used to specified the node whose property is to be read, and which will return the property */ public On<Property> getProperty( final String name ) { Name nameObj = getContext().getValueFactories().getNameFactory().create(name); return getProperty(nameObj); }
public CreateAction<T> nodeNamed( String name ) { NameFactory factory = getContext().getValueFactories().getNameFactory(); Name nameObj = factory.create(name); return createWith(afterConjunction(), parent, nameObj); }
/** * Utility to create a {@link Name} from a string. * * @param name the string form of the name * @return the name object * @throws ValueFormatException if a name could not be created from the supplied string */ protected Name name( String name ) { return context.getValueFactories().getNameFactory().create(name); }
protected BaseTransaction( ExecutionContext context, Repository<NodeType, WorkspaceType> repository, UUID rootNodeUuid ) { this.rootNodeUuid = rootNodeUuid; this.context = context; this.propertyFactory = context.getPropertyFactory(); this.valueFactories = context.getValueFactories(); this.pathFactory = valueFactories.getPathFactory(); this.nameFactory = valueFactories.getNameFactory(); this.repository = repository; this.rootLocation = Location.create(pathFactory.createRootPath(), rootNodeUuid); }
public Object[] getPropertyValues( Path path, String propertyName ) { Name name = context.getValueFactories().getNameFactory().create(propertyName); Property prop = getProperty(path, name); if (prop != null) { return prop.getValuesAsArray(); } return null; }
private String[] stringValuesOf( Node node, Name propertyName ) { Property property = node.getProperty(propertyName); if (property == null) { // Check whether the property exists with no namespace ... property = node.getProperty(context.getValueFactories().getNameFactory().create(propertyName.getLocalName())); if (property == null) return null; } return context.getValueFactories().getStringFactory().create(property.getValuesAsArray()); }
protected void assertNextRequestIsCreate( Location parent, String child, Property... properties ) { Name name = context.getValueFactories().getNameFactory().create(child); Request request = executedRequests.poll(); assertThat(request, is(instanceOf(CreateNodeRequest.class))); CreateNodeRequest create = (CreateNodeRequest)request; assertThat(create.under(), is(parent)); assertThat(create.named(), is(name)); assertThat(create.properties(), hasItems(properties)); }
@Test public void shouldSerializeAndDeserializeNameProperty() throws Exception { Property prop = createProperty("p1", valueFactories.getNameFactory().create("something")); assertSerializableAndDeserializable(serializer, prop); assertThat(largeValues.getCount(), is(0)); }
private String stringValueOf( Node node, Name propertyName ) { Property property = node.getProperty(propertyName); if (property == null) { // Check whether the property exists with no namespace ... property = node.getProperty(context.getValueFactories().getNameFactory().create(propertyName.getLocalName())); if (property == null) return null; } if (property.isEmpty()) return null; return context.getValueFactories().getStringFactory().create(property.getFirstValue()); }
@SuppressWarnings( "synthetic-access" ) public GraphHandler() { this.pathFactory = context.getValueFactories().getPathFactory(); this.nameFactory = context.getValueFactories().getNameFactory(); this.propFactory = context.getPropertyFactory(); this.parents = new Stack<Path>(); String name = "Handler Source"; source = new InMemoryRepositorySource(); source.setName(name); this.graph = Graph.create(source, context); }
public Property getProperty( String nodePath, String propertyName ) { Path path = context.getValueFactories().getPathFactory().create(nodePath); Name name = context.getValueFactories().getNameFactory().create(propertyName); return getProperty(path, name); }
/** * {@inheritDoc} */ public void setProperty( String nodePath, String propertyName, Object... values ) { Path path = context.getValueFactories().getPathFactory().create(nodePath); Name name = context.getValueFactories().getNameFactory().create(propertyName); setProperty(path, name, values); }